Skip to content

Instantly share code, notes, and snippets.

@leocaseiro
Created June 20, 2022 08:35
Show Gist options
  • Save leocaseiro/4a05fe69afeca09bdcc6d7a729ce5a18 to your computer and use it in GitHub Desktop.
Save leocaseiro/4a05fe69afeca09bdcc6d7a729ce5a18 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.game {
$majorsImp: 'Fireplace1', 'Fireplace2', 'CookingHearth1', 'CookingHearth2', 'ClayOven', 'StoneOven', 'Joinery', 'Pottery', 'Basket', 'Well';
@each $mId in $majorsImp {
$i: index($majorsImp, $mId);
&[data-id='Major_#{$mId}'] {
.card-icon {
background-position-x: (($i - 1) % 5) * 100% / 4;
background-position-y: (($i - 1 - ($i - 1) % 5) / 5) * 100%;
}
}
}
}
.game[data-id=Major_Fireplace1] .card-icon {
background-position-x: 0%;
background-position-y: 0%;
}
.game[data-id=Major_Fireplace2] .card-icon {
background-position-x: 25%;
background-position-y: 0%;
}
.game[data-id=Major_CookingHearth1] .card-icon {
background-position-x: 50%;
background-position-y: 0%;
}
.game[data-id=Major_CookingHearth2] .card-icon {
background-position-x: 75%;
background-position-y: 0%;
}
.game[data-id=Major_ClayOven] .card-icon {
background-position-x: 100%;
background-position-y: 0%;
}
.game[data-id=Major_StoneOven] .card-icon {
background-position-x: 0%;
background-position-y: 100%;
}
.game[data-id=Major_Joinery] .card-icon {
background-position-x: 25%;
background-position-y: 100%;
}
.game[data-id=Major_Pottery] .card-icon {
background-position-x: 50%;
background-position-y: 100%;
}
.game[data-id=Major_Basket] .card-icon {
background-position-x: 75%;
background-position-y: 100%;
}
.game[data-id=Major_Well] .card-icon {
background-position-x: 100%;
background-position-y: 100%;
}
{
"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