Skip to content

Instantly share code, notes, and snippets.

@martinherweg
Created March 18, 2022 12:23
Show Gist options
  • Save martinherweg/7f58b7d5de9226c40ccc0b16bb10fa6e to your computer and use it in GitHub Desktop.
Save martinherweg/7f58b7d5de9226c40ccc0b16bb10fa6e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@use 'sass:map';
$themes: ['default', 'yellow', 'purple-yellow', 'gold', 'midnight-blue', 'purple-blue'];
$themeIcons: ();
@each $theme in $themes {
$index: index($themes, $theme);
@if $theme == 'default' {
$themeIcons: map.set($themeIcons, $theme, '');
} @else {
$themeIcons: map.set($themeIcons, $theme, 'theme#{$index}')
}
}
@mixin themesIcon($icon) {
@each $theme, $iconName in $themeIcons {
.t-color--#{$theme} & {
background-image: url('~ASSETS/svg/single/#{$icon}-#{$iconName}.svg');
}
}
}
.blabla__image {
@include themesIcon('dot-ring');
}
.t-color--default .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-.svg");
}
.t-color--yellow .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-theme2.svg");
}
.t-color--purple-yellow .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-theme3.svg");
}
.t-color--gold .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-theme4.svg");
}
.t-color--midnight-blue .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-theme5.svg");
}
.t-color--purple-blue .blabla__image {
background-image: url("~ASSETS/svg/single/dot-ring-theme6.svg");
}
{
"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