]> BookStack Code Mirror - bookstack/blob - resources/sass/_mixins.scss
Merge pull request #5627 from BookStackApp/lexical_20250525
[bookstack] / resources / sass / _mixins.scss
1 // Responsive breakpoint control
2 @mixin smaller-than($size) {
3     @media screen and (max-width: $size) { @content; }
4 }
5 @mixin larger-than($size) {
6     @media screen and (min-width: ($size + 1)) { @content; }
7 }
8 @mixin between($min, $max) {
9   @media screen and (min-width: ($min + 1)) and (max-width: $max) { @content; }
10 }
11
12 // Padding shorthand using logical operators to better support RTL.
13 @mixin padding($t, $r, $b, $l) {
14   padding-block-start: $t;
15   padding-block-end: $b;
16   padding-inline-start: $l;
17   padding-inline-end: $r;
18 }
19
20 // Margin shorthand using logical operators to better support RTL.
21 @mixin margin($t, $r, $b, $l) {
22   margin-block-start: $t;
23   margin-block-end: $b;
24   margin-inline-start: $l;
25   margin-inline-end: $r;
26 }
27
28 // Create a RTL specific style block.
29 // Mostly used as a patch until browser support improves for logical properties.
30 @mixin rtl() {
31   html[dir=rtl] & {
32     @content;
33   }
34 }
35
36 // Define a property for both light and dark mode
37 @mixin lightDark($prop, $light, $dark, $important: false) {
38   #{$prop}: if($important, $light !important, $light);
39   html.dark-mode & {
40     #{$prop}: if($important, $dark !important, $dark);
41   }
42 }
43
44 @mixin whenDark {
45     html.dark-mode & {
46       @content;
47     }
48 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.