Skip to content

Instantly share code, notes, and snippets.

@MikelArnaiz
Created November 18, 2021 10:03
Show Gist options
  • Save MikelArnaiz/a7f0eac0072baa5c7ad3f7d9bd3fbf4f to your computer and use it in GitHub Desktop.
Save MikelArnaiz/a7f0eac0072baa5c7ad3f7d9bd3fbf4f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@mixin byPlatform($type) {
@if $type == 'mobile' {
font-size: 8px;
line-height: 10px;
}
@if $type == 'table' {
font-size: 12x;
line-height: 15px;
}
@if $type == 'desktop' {
font-size: 16px;
line-height: 20px;
}
}
@mixin getStyles() {
@include byPlatform('mobile');
// @media (min-width: 768px) {
// @include byPlatform('tablet');
// }
// @media (min-width: 1280px) {
// @include byPlatform('desktop');
// }
}
div {
@include getStyles;
// How to style the paragraph with the line-height coming from the mixin getStyles?
p {
// $styles: @include getStyles;
// line-height: $styles['line-height'];
// @include getStyles['line-height'];
}
}
div {
font-size: 8px;
line-height: 10px;
}
div p {
color: red;
}
{
"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