Skip to content

Instantly share code, notes, and snippets.

@influxweb
Created March 18, 2022 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save influxweb/c7e5811434090318b664f33c05ed924a to your computer and use it in GitHub Desktop.
Save influxweb/c7e5811434090318b664f33c05ed924a to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@use "sass:meta";
/**
* Use this mixin to declare a set of CSS Custom Properties.
* The variables in $css_variables will be properly prefixed.
* The use of this mixin is encouraged to keep a good scalability.
*/
@mixin cssvars($css_variables, $prefix: rt) {
:root {
@each $name, $value in $css_variables {
--#{$prefix}-#{$name}: #{$value};
}
}
}
/**
* This mixin is used to change a CSS property value.
* It will change a declared css variable auto-prefixing it.
*/
@mixin cssvar($name, $prefix: rt, $value: '') {
--#{$prefix}-#{$name}: #{$value};
}
/**
* Retrieve a css variable value with already auto-prefixed.
* Use the mixin if you want to change the variable value.
*/
@function cssvar($name, $prefix: rt) {
@return var(--#{$prefix}-#{$name});
}
$primary-font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !default;
$global-font-size: 16px !default;
@include cssvars((
app-surface-color: transparent,
font-family-primary: #{meta.inspect($primary-font-family)},
global-font-size: #{$global-font-size}
));
body {
background-color: cssvar(app-surface-color);
}
/**
* Use this mixin to declare a set of CSS Custom Properties.
* The variables in $css_variables will be properly prefixed.
* The use of this mixin is encouraged to keep a good scalability.
*/
/**
* This mixin is used to change a CSS property value.
* It will change a declared css variable auto-prefixing it.
*/
/**
* Retrieve a css variable value with already auto-prefixed.
* Use the mixin if you want to change the variable value.
*/
:root {
--rt-app-surface-color: transparent;
--rt-font-family-primary: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--rt-global-font-size: 16px;
}
body {
background-color: var(--rt-app-surface-color);
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment