-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
304 additions
and
97 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
inlineSvg: | ||
inlineCSS: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{{ define "main" }} | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col"> | ||
<h1>{{ .Title }}</h1> | ||
<div> | ||
{{ partial "inline-svg" (dict | ||
"src" "icons/bootstrap/clock.svg" | ||
"fs" 1 | ||
"display" "inline" | ||
"title" "SVG Title" | ||
"desc" "SVG Desc" | ||
) }} <span class="fs-1">Inline SVG, fs: 1 (2.5rem) Text fs-1</span> | ||
</div> | ||
<div class="fs-2"> | ||
{{ partial "inline-svg" (dict | ||
"src" "icons/bootstrap/clock.svg" | ||
"display" "inline" | ||
"title" "SVG Title" | ||
"desc" "SVG Desc" | ||
) }} <span class="">Inline SVG & text inherit font size (2 - 2rem)</span> | ||
</div> | ||
<div class="text-primary"> | ||
{{ partial "inline-svg" (dict | ||
"src" "icons/bootstrap/clock.svg" | ||
"fs" 6 | ||
"display" "inline" | ||
"title" "SVG Title" | ||
"desc" "SVG Desc" | ||
) }} <span class="fs-6">Inline SVG, fs: 6 (1rem). Text fs-6</span> | ||
</div> | ||
<div class="d-flex flex-row align-middle pb-2"> | ||
<div class="d-flex align-items-center text-primary me-2 my-2"> | ||
{{ partial "inline-svg" (dict | ||
"src" "icons/bootstrap/clock.svg" | ||
"fs" 2 | ||
"display" "block" | ||
"title" "SVG Title" | ||
"desc" "SVG Desc" | ||
) }} | ||
</div> | ||
<div class="d-flex align-items-center"> | ||
Block SVG, font size 2 (2rem) Text 1rem, | ||
</div> | ||
</div> | ||
<div class="d-flex flex-row align-middle pb-2"> | ||
<div class="d-flex align-items-center text-primary me-2 my-2"> | ||
{{ partial "inline-svg" (dict | ||
"src" "icons/bootstrap/clock.svg" | ||
"rem" 2 | ||
"display" "block" | ||
"title" "SVG Title" | ||
"desc" "SVG Desc" | ||
) }} | ||
</div> | ||
<div class="d-flex align-items-center"> | ||
Block SVG, rem: 2 Text 1rem, | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{ end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
params: | ||
inlineSvg: | ||
inlineCSS: false | ||
inlineStyles: | ||
fs: | ||
1: 2.5 | ||
2: 2 | ||
3: 1.75 | ||
4: 1.5 | ||
5: 1.25 | ||
6: 1 | ||
7: 0.875 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
layouts/partials/hugo-inline-svg/private/inline-styles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{{ $styleAttr := "" }} | ||
{{ if eq site.Params.inlineSvg.inlineCSS true }} | ||
{{ $inline := (slice "color: inherit;" "fill: currentColor;" ) }} | ||
|
||
{{ if eq .display "block" }} | ||
{{ $inline = $inline | append (slice | ||
"display: block;" | ||
"height: 1em;" | ||
"width: 1em;" | ||
"vertical-align: middle;" | ||
) }} | ||
{{ else if eq .display "inline" }} | ||
{{ $inline = $inline | append (slice | ||
"display: inline-block;" | ||
"height: 0.7em;" | ||
"width: 0.7em;" | ||
"vertical-align: baseline;" | ||
|
||
) }} | ||
{{ end }} | ||
|
||
{{ if .fs }} | ||
{{ $fsMap := (dict | ||
"1" "2.5" | ||
"2" "2" | ||
"3" "1.75" | ||
"4" "1.5" | ||
"5" "1.25" | ||
"6" "1" | ||
"7" "0.875" | ||
)}} | ||
{{ $inline = $inline | append (slice (printf "font-size: %vrem;" (index $fsMap (.fs | string)))) }} | ||
{{ else if .rem }} | ||
{{ $inline = $inline | append (slice (printf "font-size: %vrem;" .rem)) }} | ||
{{ else }} | ||
{{ $inline = $inline | append (slice "font-size: inherit;") }} | ||
{{ end }} | ||
|
||
|
||
{{/* create string */}} | ||
{{ $styleAttr = printf `style="%s"` (delimit $inline " ") }} | ||
{{ end }} | ||
|
||
{{ return $styleAttr }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.