@media screen and (max-width: $size) { @content; }
}
@mixin larger-than($size) {
- @media screen and (min-width: $size) { @content; }
+ @media screen and (min-width: ($size + 1)) { @content; }
}
@mixin between($min, $max) {
- @media screen and (min-width: $min) and (max-width: $max) { @content; }
+ @media screen and (min-width: ($min + 1)) and (max-width: $max) { @content; }
}
// Padding shorthand using logical operators to better support RTL.
html[dir=rtl] & {
@content;
}
+}
+
+// Define a property for both light and dark mode
+@mixin lightDark($prop, $light, $dark, $important: false) {
+ #{$prop}: if($important, $light !important, $light);
+ html.dark-mode & {
+ #{$prop}: if($important, $dark !important, $dark);
+ }
+}
+
+@mixin whenDark {
+ html.dark-mode & {
+ @content;
+ }
}
\ No newline at end of file