BookStackApp_BookStack/resources/sass/_spacing.scss
Dan Brown 8ec26e8083
SASS: Updated to use modules and address deprecations
Changes the name of our spacing variables due to the prefixing -/_
meaning private in the use of new "use" rather than include.

All now modular too, so all variables/mixins are accessed via their
package.

Also renamed variables file to vars for simpler/cleaner access/writing.

eg. '$-m' is now 'vars.$m'
2024-12-09 13:25:35 +00:00

46 lines
1.2 KiB
SCSS

@use "vars";
// Here we generate spacing utility classes for our sizes for all box sides and axis.
// These will output to classes like .px-m (Padding on x-axis, medium size) or .mr-l (Margin right, large size)
@mixin spacing($prop, $propLetter) {
@each $sizeLetter, $size in vars.$spacing {
.#{$propLetter}-#{$sizeLetter} {
#{$prop}: $size !important;
}
.#{$propLetter}x-#{$sizeLetter} {
#{$prop}-inline-start: $size !important;
#{$prop}-inline-end: $size !important;
}
.#{$propLetter}y-#{$sizeLetter} {
#{$prop}-top: $size !important;
#{$prop}-bottom: $size !important;
}
.#{$propLetter}t-#{$sizeLetter} {
#{$prop}-top: $size !important;
}
.#{$propLetter}r-#{$sizeLetter} {
#{$prop}-inline-end: $size !important;
}
.#{$propLetter}b-#{$sizeLetter} {
#{$prop}-bottom: $size !important;
}
.#{$propLetter}l-#{$sizeLetter} {
#{$prop}-inline-start: $size !important;
}
}
}
@include spacing('margin', 'm');
@include spacing('padding', 'p');
@each $sizeLetter, $size in vars.$spacing {
.gap-#{$sizeLetter} {
gap: $size !important;
}
.gap-x-#{$sizeLetter} {
column-gap: $size !important;
}
.gap-y-#{$sizeLetter} {
row-gap: $size !important;
}
}