feat: copy style for new project | have error
This commit is contained in:
43
assets/styles/utils/functions/_get-variable-css.scss
Normal file
43
assets/styles/utils/functions/_get-variable-css.scss
Normal file
@@ -0,0 +1,43 @@
|
||||
/// Get color variable from css to scss
|
||||
/// @param $color-props: color variable : --color-text-rgb, --color-body-text
|
||||
///
|
||||
@function color($color-props) {
|
||||
@return var(--color-#{$color-props});
|
||||
}
|
||||
|
||||
/// Get font variable from css to scss
|
||||
/// @param $font-props: font variable : --font-size-header, --font-size-base
|
||||
///
|
||||
@function font($font-props) {
|
||||
@return var(--font-#{$font-props});
|
||||
}
|
||||
|
||||
/// Get all general variable from css to scss
|
||||
@function v($props) {
|
||||
@return var(--#{$props});
|
||||
}
|
||||
|
||||
/// Example :
|
||||
// :root {
|
||||
// --color-background: #FFFFFF;
|
||||
// }
|
||||
|
||||
// body {
|
||||
// color: color(primary);
|
||||
// }
|
||||
|
||||
// compiled sass code is:
|
||||
|
||||
// body {
|
||||
// color: var(--color-primary);
|
||||
// }
|
||||
|
||||
// .kmacoders {
|
||||
// color: v(--color-background);
|
||||
// }
|
||||
|
||||
// compiled sass code is:
|
||||
|
||||
// .kmacoders {
|
||||
// color: var(----color-background);
|
||||
// }
|
Reference in New Issue
Block a user