Skip to content

Instantly share code, notes, and snippets.

@Kurtz1993
Last active July 15, 2020 19:29
Show Gist options
  • Save Kurtz1993/1357003b77e91f0086876e613ab4302a to your computer and use it in GitHub Desktop.
Save Kurtz1993/1357003b77e91f0086876e613ab4302a to your computer and use it in GitHub Desktop.
/**
*
* Makes working with themeable CSS variables easier.
*
* $property: the CSS property to theme.
* $cssVariable: The CSS variable that will store the themed value.
* $fallback: The value to use as a fallback but as well for the CSS variable default value.
*/
@mixin themeable($property, $cssVariable, $fallback) {
#{$property}: #{$fallback};
#{$property}: var(--#{$cssVariable}, #{$fallback});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment