initial commit
This commit is contained in:
parent
2012aa8834
commit
9ddfa58ace
2289 changed files with 11217 additions and 0 deletions
7
layouts/partials/func/getFontAwesomeColorOpacity.html
Normal file
7
layouts/partials/func/getFontAwesomeColorOpacity.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{ $result := 0 }}
|
||||
{{ $parts := split (index . 0) "/" }}
|
||||
{{ with (index $parts (index . 1)) }}
|
||||
{{ $result = trim . " \t\n" }}
|
||||
{{ end }}
|
||||
|
||||
{{- return $result -}}
|
30
layouts/partials/func/getFontAwesomeSettings.html
Normal file
30
layouts/partials/func/getFontAwesomeSettings.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{ $lengthPattern := "^[\\d\\.]+(?i)(?:cm|in|mm|pc|pt|px|q|%|ch|em|ex|lh|rem|vh|vmax|vmin|vw)(?-i)$" }}
|
||||
|
||||
{{ $data := newScratch }}
|
||||
{{ $data.Set "size" "1em" }}
|
||||
{{ $data.Set "primaryColor" "currentColor" }}
|
||||
{{ $data.Set "primaryOpacity" "1" }}
|
||||
{{ $data.Set "secondaryColor" "currentColor" }}
|
||||
{{ $data.Set "secondaryOpacity" "0.4" }}
|
||||
|
||||
{{ $args := slice .arg1 .arg2 }}
|
||||
{{ range $args }}
|
||||
{{ $length := findRE $lengthPattern . }}
|
||||
{{ with $length }}
|
||||
{{ $data.Set "size" (delimit $length "") }}
|
||||
{{ else }}
|
||||
{{ with . }}
|
||||
{{ $parts := split . ";" }}
|
||||
{{ with (index $parts 0) }}
|
||||
{{ $data.Set "primaryColor" ((partial "func/getFontAwesomeColorOpacity.html" (slice . 0)) | default "currentColor") -}}) }}
|
||||
{{ $data.Set "primaryOpacity" ((partial "func/getFontAwesomeColorOpacity.html" (slice . 1)) | default "1") -}}) }}
|
||||
{{ end }}
|
||||
{{ with (index $parts 1) }}
|
||||
{{ $data.Set "secondaryColor" ((partial "func/getFontAwesomeColorOpacity.html" (slice . 0)) | default "currentColor") -}}) }}
|
||||
{{ $data.Set "secondaryOpacity" ((partial "func/getFontAwesomeColorOpacity.html" (slice . 1)) | default "0.4") -}}) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- return (dict "size" ($data.Get "size") "primaryColor" ($data.Get "primaryColor") "primaryOpacity" ($data.Get "primaryOpacity") "secondaryColor" ($data.Get "secondaryColor") "secondaryOpacity" ($data.Get "secondaryOpacity") ) -}}
|
Loading…
Add table
Add a link
Reference in a new issue