0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-15 15:29:22 +01:00

56 lines
2.1 KiB
SCSS
Raw Normal View History

2024-07-29 22:04:11 -07:00
@use "sass:map";
@use "sass:meta";
@use "../mixins/breakpoints";
@use "../mixins/utilities" as mixins-utilities;
@use "../utilities";
2024-07-30 11:16:28 +02:00
@use "../setup/variables";
2024-07-29 22:04:11 -07:00
@use "../vendor/rfs";
2019-05-23 11:56:03 +02:00
// Loop over each breakpoint
2024-07-29 22:04:11 -07:00
@each $breakpoint in map.keys(variables.$grid-breakpoints) {
2019-05-23 11:56:03 +02:00
// Generate media query if needed
2024-07-29 22:04:11 -07:00
@include breakpoints.media-breakpoint-up($breakpoint) {
$infix: breakpoints.breakpoint-infix($breakpoint, variables.$grid-breakpoints);
2019-05-23 11:56:03 +02:00
// Loop over each utility property
2024-07-29 22:04:11 -07:00
@each $key, $utility in utilities.$utilities {
2019-05-23 11:56:03 +02:00
// 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
2024-07-29 22:04:11 -07:00
@if meta.type-of($utility) == "map" and (map.get($utility, responsive) or $infix == "") {
@include mixins-utilities.generate-utility($utility, $infix);
2019-05-23 11:56:03 +02:00
}
}
}
}
2020-02-15 12:01:32 +01:00
// RFS rescaling
2024-07-29 22:04:11 -07:00
@media (min-width: rfs.$rfs-mq-value) {
@each $breakpoint in map.keys(variables.$grid-breakpoints) {
$infix: breakpoints.breakpoint-infix($breakpoint, variables.$grid-breakpoints);
2020-02-15 12:01:32 +01:00
2024-07-29 22:04:11 -07:00
@if (map.get(variables.$grid-breakpoints, $breakpoint) < rfs.$rfs-breakpoint) {
2020-02-15 12:01:32 +01:00
// Loop over each utility property
2024-07-29 22:04:11 -07:00
@each $key, $utility in utilities.$utilities {
2020-02-15 12:01:32 +01:00
// 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
2024-07-29 22:04:11 -07:00
@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);
2020-02-15 12:01:32 +01:00
}
}
}
}
}
2019-05-23 11:56:03 +02:00
// Print utilities
@media print {
2024-07-29 22:04:11 -07:00
@each $key, $utility in utilities.$utilities {
2019-05-23 11:56:03 +02:00
// The utility can be disabled with `false`, thus check if the utility is a map first
// Then check if the utility needs print styles
2024-07-29 22:04:11 -07:00
@if meta.type-of($utility) == "map" and map.get($utility, print) == true {
@include mixins-utilities.generate-utility($utility, "-print");
2019-05-23 11:56:03 +02:00
}
}
}