Skip to content

Instantly share code, notes, and snippets.

@firefoxic
Created January 9, 2024 17:00
Show Gist options
  • Save firefoxic/eb0d6a5e490831e9a0bd221d028645bf to your computer and use it in GitHub Desktop.
Save firefoxic/eb0d6a5e490831e9a0bd221d028645bf to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
$breakpoint-tablet: 768px;
$breakpoint-desktop: 1280px;
$breakpoint-gap: 0.02px;
$mobile-only: "(max-width: #{$breakpoint-tablet - $breakpoint-gap})";
$tablet-only: "(min-width: #{$breakpoint-tablet}) and (max-width: #{$breakpoint-desktop - $breakpoint-gap})";
$desktop-only: "(min-width: #{$breakpoint-desktop})";
$not-mobile: "(min-width: #{$breakpoint-tablet})";
$not-desktop: "(max-width: #{$breakpoint-desktop - $breakpoint-gap})";
.block {
color: red;
@media #{$mobile-only} {
color: orangered;
}
@media #{$tablet-only} {
color: orange;
}
@media #{$desktop-only} {
color: yellow;
}
@media #{$not-mobile} {
color: yellowgreen;
}
@media #{$not-desktop} {
color: green;
}
}
.block {
color: red;
}
@media (max-width: 767.98px) {
.block {
color: orangered;
}
}
@media (min-width: 768px) and (max-width: 1279.98px) {
.block {
color: orange;
}
}
@media (min-width: 1280px) {
.block {
color: yellow;
}
}
@media (min-width: 768px) {
.block {
color: yellowgreen;
}
}
@media (max-width: 1279.98px) {
.block {
color: green;
}
}
{
"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