Skip to content

Instantly share code, notes, and snippets.

@spazione
Created March 6, 2024 11:29
Show Gist options
  • Save spazione/c8284771bb42db2c03e31fd1e9c0acbd to your computer and use it in GitHub Desktop.
Save spazione/c8284771bb42db2c03e31fd1e9c0acbd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@use "sass:map";
$headingSettings: (
prefix: 'heading',
vars: (
h1: (
font-size: '10',
line-height: '10',
font-weight: '10',
margin: '1rem 0',
),
display-1: (
font-size: '10',
line-height: '10',
font-weight: '10',
margin: '1rem 0',
),
),
);
@mixin inject-headings($collection, $father: "") {
@each $key, $keys in $collection {
@if $key == "vars" or $key == "prefix" {
$new-father: #{$father} !global;
$prefix-icon: map.get($collection, prefix) !global;
} @else {
$new-father: #{$father}-#{$key} !global;
}
@if $key != "prefix" {
@if type-of($keys) == "map" {
@include inject-headings($keys, $new-father);
} @else if type-of($keys) != "map" {
:where(.#{$prefix-icon}-#{$father}) {
@each $value in $keys {
#{$key}: #{$value};
}
}
}
}
}
}
@include inject-headings($headingSettings)
:where(.heading--h1) {
font-size: 10;
}
:where(.heading--h1) {
line-height: 10;
}
:where(.heading--h1) {
font-weight: 10;
}
:where(.heading--h1) {
margin: 1rem 0;
}
:where(.heading--display-1) {
font-size: 10;
}
:where(.heading--display-1) {
line-height: 10;
}
:where(.heading--display-1) {
font-weight: 10;
}
:where(.heading--display-1) {
margin: 1rem 0;
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment