Add functions to register and assign CSS variables

This commit is contained in:
Jeremy Thomas
2020-08-22 11:19:21 +02:00
parent 0ecc5bd35d
commit 166fcdb32c
11 changed files with 168 additions and 89 deletions

View File

@@ -133,3 +133,23 @@
@function bulmaToRGB($color)
@return red($color), green($color), blue($color)
=registerCSSVar($name, $value, $at-root: true)
@if $at-root
@at-root :root
--#{$name}: #{$value}
@else
--#{$name}: #{$value}
=registerCSSVars($list, $at-root: true)
@if $at-root
@at-root :root
@each $name, $value in $list
--#{$name}: #{$value}
@else
@each $name, $value in $list
--#{$name}: #{$value}
@function assignCSSVar($name, $fallback)
// +registerCSSVar($name, $fallback)
@return var(--#{$name}, #{$fallback})