X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/da1cea06ca5db56a9635bf8bb01da2516d601620..refs/pull/5721/head:/resources/sass/_mixins.scss diff --git a/resources/sass/_mixins.scss b/resources/sass/_mixins.scss index 8a6becf6b..fc5086008 100644 --- a/resources/sass/_mixins.scss +++ b/resources/sass/_mixins.scss @@ -3,10 +3,10 @@ @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. @@ -31,4 +31,18 @@ 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