0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-23 20:54:22 +01:00
Mark Otto 7915584fa4 lol
2024-07-29 22:04:11 -07:00

56 lines
2.1 KiB
SCSS

@use "sass:map";
@use "sass:meta";
@use "../mixins/breakpoints";
@use "../mixins/utilities" as mixins-utilities;
@use "../utilities";
@use "../variables";
@use "../vendor/rfs";
// Loop over each breakpoint
@each $breakpoint in map.keys(variables.$grid-breakpoints) {
// Generate media query if needed
@include breakpoints.media-breakpoint-up($breakpoint) {
$infix: breakpoints.breakpoint-infix($breakpoint, variables.$grid-breakpoints);
// Loop over each utility property
@each $key, $utility in utilities.$utilities {
// The utility can be disabled with `false`, thus check if the utility is a map first
// Only proceed if responsive media queries are enabled or if it's the base media query
@if meta.type-of($utility) == "map" and (map.get($utility, responsive) or $infix == "") {
@include mixins-utilities.generate-utility($utility, $infix);
}
}
}
}
// RFS rescaling
@media (min-width: rfs.$rfs-mq-value) {
@each $breakpoint in map.keys(variables.$grid-breakpoints) {
$infix: breakpoints.breakpoint-infix($breakpoint, variables.$grid-breakpoints);
@if (map.get(variables.$grid-breakpoints, $breakpoint) < rfs.$rfs-breakpoint) {
// Loop over each utility property
@each $key, $utility in utilities.$utilities {
// The utility can be disabled with `false`, thus check if the utility is a map first
// Only proceed if responsive media queries are enabled or if it's the base media query
@if meta.type-of($utility) == "map" and map.get($utility, rfs) and (map.get($utility, responsive) or $infix == "") {
@include mixins-utilities.generate-utility($utility, $infix, true);
}
}
}
}
}
// Print utilities
@media print {
@each $key, $utility in utilities.$utilities {
// The utility can be disabled with `false`, thus check if the utility is a map first
// Then check if the utility needs print styles
@if meta.type-of($utility) == "map" and map.get($utility, print) == true {
@include mixins-utilities.generate-utility($utility, "-print");
}
}
}