Skip to content

Instantly share code, notes, and snippets.

@diarcastro
Created March 11, 2022 17:35
Show Gist options
  • Select an option

  • Save diarcastro/918ef683f018ea772de34410fcfee229 to your computer and use it in GitHub Desktop.

Select an option

Save diarcastro/918ef683f018ea772de34410fcfee229 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@function rem($target: 16, $context: 10) {
$newTarget: $target / ($target * 0 + 1); // Tip to remove the unit from target
@return ($newTarget / $context) * 1rem;
}
$post-mobile : rem(669px);
$tablet : rem(768);
@media screen and (min-width: $post-mobile) {
.test {
color: red;
font-size: rem(24); // How to use it later
}
}
@media screen and (min-width: $tablet) {
.test2 {
color: red;
font-size: rem(12px); // How to use it later
}
}
@media screen and (min-width: 66.9rem) {
.test {
color: red;
font-size: 2.4rem;
}
}
@media screen and (min-width: 76.8rem) {
.test2 {
color: red;
font-size: 1.2rem;
}
}
{
"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