mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-23 20:54:22 +01:00
Update source Sass to use Sass map module for all map functions, save for custom map-loop() which we may need to remove
This commit is contained in:
parent
97fba7154c
commit
0c46e484eb
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@use "mixins/border-radius" as *;
|
@use "mixins/border-radius" as *;
|
||||||
@ -61,7 +62,7 @@
|
|||||||
|
|
||||||
// scss-docs-start alert-modifiers
|
// scss-docs-start alert-modifiers
|
||||||
// Generate contextual modifier classes for colorizing the alert
|
// Generate contextual modifier classes for colorizing the alert
|
||||||
@each $state in map-keys($theme-colors) {
|
@each $state in map.keys($theme-colors) {
|
||||||
.alert-#{$state} {
|
.alert-#{$state} {
|
||||||
--#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis);
|
--#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis);
|
||||||
--#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle);
|
--#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@use "mixins/caret" as *;
|
@use "mixins/caret" as *;
|
||||||
@ -95,7 +96,7 @@
|
|||||||
// We deliberately hardcode the `bs-` prefix because we check
|
// We deliberately hardcode the `bs-` prefix because we check
|
||||||
// this custom property in JS to determine Popper's positioning
|
// this custom property in JS to determine Popper's positioning
|
||||||
|
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
@include media-breakpoint-up($breakpoint) {
|
@include media-breakpoint-up($breakpoint) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "colors" as *;
|
@use "colors" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@ -126,7 +127,7 @@
|
|||||||
//
|
//
|
||||||
// Change the layout of list group items from vertical (default) to horizontal.
|
// Change the layout of list group items from vertical (default) to horizontal.
|
||||||
|
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
@include media-breakpoint-up($breakpoint) {
|
@include media-breakpoint-up($breakpoint) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
|
|
||||||
@ -187,7 +188,7 @@
|
|||||||
// Add modifier classes to change text and background color on individual items.
|
// Add modifier classes to change text and background color on individual items.
|
||||||
// Organizationally, this must come after the `:hover` states.
|
// Organizationally, this must come after the `:hover` states.
|
||||||
|
|
||||||
@each $state in map-keys($theme-colors) {
|
@each $state in map.keys($theme-colors) {
|
||||||
.list-group-item-#{$state} {
|
.list-group-item-#{$state} {
|
||||||
--#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
|
--#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
|
||||||
--#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
|
--#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "colors" as *;
|
@use "colors" as *;
|
||||||
@use "functions" as *;
|
@use "functions" as *;
|
||||||
@ -105,7 +106,7 @@ $utilities-colors: $theme-colors-rgb !default;
|
|||||||
// scss-docs-end utilities-colors
|
// scss-docs-end utilities-colors
|
||||||
|
|
||||||
// scss-docs-start utilities-text-colors
|
// scss-docs-start utilities-text-colors
|
||||||
$utilities-text: map-merge(
|
$utilities-text: map.merge(
|
||||||
$utilities-colors,
|
$utilities-colors,
|
||||||
(
|
(
|
||||||
"black": to-rgb($black),
|
"black": to-rgb($black),
|
||||||
@ -128,7 +129,7 @@ $utilities-text-emphasis-colors: (
|
|||||||
// scss-docs-end utilities-text-colors
|
// scss-docs-end utilities-text-colors
|
||||||
|
|
||||||
// scss-docs-start utilities-bg-colors
|
// scss-docs-start utilities-bg-colors
|
||||||
$utilities-bg: map-merge(
|
$utilities-bg: map.merge(
|
||||||
$utilities-colors,
|
$utilities-colors,
|
||||||
(
|
(
|
||||||
"black": to-rgb($black),
|
"black": to-rgb($black),
|
||||||
@ -151,7 +152,7 @@ $utilities-bg-subtle: (
|
|||||||
// scss-docs-end utilities-bg-colors
|
// scss-docs-end utilities-bg-colors
|
||||||
|
|
||||||
// scss-docs-start utilities-border-colors
|
// scss-docs-start utilities-border-colors
|
||||||
$utilities-border: map-merge(
|
$utilities-border: map.merge(
|
||||||
$utilities-colors,
|
$utilities-colors,
|
||||||
(
|
(
|
||||||
"black": to-rgb($black),
|
"black": to-rgb($black),
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@use "mixins/border-radius" as *;
|
@use "mixins/border-radius" as *;
|
||||||
@ -215,7 +216,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// scss-docs-start modal-fullscreen-loop
|
// scss-docs-start modal-fullscreen-loop
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
$postfix: if($infix != "", $infix + "-down", "");
|
$postfix: if($infix != "", $infix + "-down", "");
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@use "mixins/border-radius" as *;
|
@use "mixins/border-radius" as *;
|
||||||
@ -201,7 +202,7 @@
|
|||||||
// Generate series of `.navbar-expand-*` responsive classes for configuring
|
// Generate series of `.navbar-expand-*` responsive classes for configuring
|
||||||
// where your navbar collapses.
|
// where your navbar collapses.
|
||||||
.navbar-expand {
|
.navbar-expand {
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
||||||
$infix: breakpoint-infix($next, $grid-breakpoints);
|
$infix: breakpoint-infix($next, $grid-breakpoints);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@use "mixins/box-shadow" as *;
|
@use "mixins/box-shadow" as *;
|
||||||
@ -24,7 +25,7 @@
|
|||||||
// scss-docs-end offcanvas-css-vars
|
// scss-docs-end offcanvas-css-vars
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
||||||
$infix: breakpoint-infix($next, $grid-breakpoints);
|
$infix: breakpoint-infix($next, $grid-breakpoints);
|
||||||
|
|
||||||
@ -33,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
$next: breakpoint-next($breakpoint, $grid-breakpoints);
|
||||||
$infix: breakpoint-infix($next, $grid-breakpoints);
|
$infix: breakpoint-infix($next, $grid-breakpoints);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "colors" as *;
|
@use "colors" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@ -190,7 +191,7 @@
|
|||||||
// Generate series of `.table-responsive-*` classes for configuring the screen
|
// Generate series of `.table-responsive-*` classes for configuring the screen
|
||||||
// size of where your table will overflow.
|
// size of where your table will overflow.
|
||||||
|
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
|
|
||||||
@include media-breakpoint-down($breakpoint) {
|
@include media-breakpoint-down($breakpoint) {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "config" as *;
|
@use "config" as *;
|
||||||
@use "colors" as *;
|
@use "colors" as *;
|
||||||
@use "variables" as *;
|
@use "variables" as *;
|
||||||
@ -8,7 +9,7 @@
|
|||||||
|
|
||||||
$utilities: () !default;
|
$utilities: () !default;
|
||||||
// stylelint-disable-next-line scss/dollar-variable-default
|
// stylelint-disable-next-line scss/dollar-variable-default
|
||||||
$utilities: map-merge(
|
$utilities: map.merge(
|
||||||
(
|
(
|
||||||
// scss-docs-start utils-vertical-align
|
// scss-docs-start utils-vertical-align
|
||||||
"align": (
|
"align": (
|
||||||
@ -366,43 +367,43 @@ $utilities: map-merge(
|
|||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin,
|
property: margin,
|
||||||
class: m,
|
class: m,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-x": (
|
"margin-x": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-right margin-left,
|
property: margin-right margin-left,
|
||||||
class: mx,
|
class: mx,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-y": (
|
"margin-y": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-top margin-bottom,
|
property: margin-top margin-bottom,
|
||||||
class: my,
|
class: my,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-top": (
|
"margin-top": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-top,
|
property: margin-top,
|
||||||
class: mt,
|
class: mt,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-end": (
|
"margin-end": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-right,
|
property: margin-right,
|
||||||
class: me,
|
class: me,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-bottom": (
|
"margin-bottom": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-bottom,
|
property: margin-bottom,
|
||||||
class: mb,
|
class: mb,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
"margin-start": (
|
"margin-start": (
|
||||||
responsive: true,
|
responsive: true,
|
||||||
property: margin-left,
|
property: margin-left,
|
||||||
class: ms,
|
class: ms,
|
||||||
values: map-merge($spacers, (auto: auto))
|
values: map.merge($spacers, (auto: auto))
|
||||||
),
|
),
|
||||||
// Negative margin utilities
|
// Negative margin utilities
|
||||||
"negative-margin": (
|
"negative-margin": (
|
||||||
@ -592,7 +593,7 @@ $utilities: map-merge(
|
|||||||
local-vars: (
|
local-vars: (
|
||||||
"text-opacity": 1
|
"text-opacity": 1
|
||||||
),
|
),
|
||||||
values: map-merge(
|
values: map.merge(
|
||||||
$utilities-text-colors,
|
$utilities-text-colors,
|
||||||
(
|
(
|
||||||
"muted": var(--#{$prefix}secondary-color), // deprecated
|
"muted": var(--#{$prefix}secondary-color), // deprecated
|
||||||
@ -650,7 +651,7 @@ $utilities: map-merge(
|
|||||||
local-vars: (
|
local-vars: (
|
||||||
"link-underline-opacity": 1
|
"link-underline-opacity": 1
|
||||||
),
|
),
|
||||||
values: map-merge(
|
values: map.merge(
|
||||||
$utilities-links-underline,
|
$utilities-links-underline,
|
||||||
(
|
(
|
||||||
null: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-underline-opacity, 1)),
|
null: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-underline-opacity, 1)),
|
||||||
@ -678,7 +679,7 @@ $utilities: map-merge(
|
|||||||
local-vars: (
|
local-vars: (
|
||||||
"bg-opacity": 1
|
"bg-opacity": 1
|
||||||
),
|
),
|
||||||
values: map-merge(
|
values: map.merge(
|
||||||
$utilities-bg-colors,
|
$utilities-bg-colors,
|
||||||
(
|
(
|
||||||
"transparent": transparent,
|
"transparent": transparent,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
@use "../variables" as *;
|
@use "../variables" as *;
|
||||||
@use "../mixins/border-radius" as *;
|
@use "../mixins/border-radius" as *;
|
||||||
@use "../mixins/transition" as *;
|
@use "../mixins/transition" as *;
|
||||||
|
|
||||||
.form-floating {
|
.form-floating {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../config" as *;
|
@use "../config" as *;
|
||||||
@use "../variables" as *;
|
@use "../variables" as *;
|
||||||
@use "../vendor/rfs" as *;
|
@use "../vendor/rfs" as *;
|
||||||
@ -121,7 +122,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$validation-messages: "";
|
$validation-messages: "";
|
||||||
@each $state in map-keys($form-validation-states) {
|
@each $state in map.keys($form-validation-states) {
|
||||||
$validation-messages: $validation-messages + ":not(." + unquote($state) + "-tooltip)" + ":not(." + unquote($state) + "-feedback)";
|
$validation-messages: $validation-messages + ":not(." + unquote($state) + "-tooltip)" + ":not(." + unquote($state) + "-feedback)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../config" as *;
|
@use "../config" as *;
|
||||||
@use "../variables" as *;
|
@use "../variables" as *;
|
||||||
@use "../layout/breakpoints" as *;
|
@use "../layout/breakpoints" as *;
|
||||||
@ -21,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Responsive sticky top and bottom
|
// Responsive sticky top and bottom
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
@include media-breakpoint-up($breakpoint) {
|
@include media-breakpoint-up($breakpoint) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../config" as *;
|
@use "../config" as *;
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +18,7 @@
|
|||||||
// md
|
// md
|
||||||
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl xxl))
|
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl xxl))
|
||||||
// md
|
// md
|
||||||
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map.keys($breakpoints)) {
|
||||||
$n: index($breakpoint-names, $name);
|
$n: index($breakpoint-names, $name);
|
||||||
@if not $n {
|
@if not $n {
|
||||||
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
|
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
|
||||||
@ -30,7 +31,7 @@
|
|||||||
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
||||||
// 576px
|
// 576px
|
||||||
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
|
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
|
||||||
$min: map-get($breakpoints, $name);
|
$min: map.get($breakpoints, $name);
|
||||||
@return if($min != 0, $min, null);
|
@return if($min != 0, $min, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,7 @@
|
|||||||
// >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
// >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px))
|
||||||
// 767.98px
|
// 767.98px
|
||||||
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
|
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
|
||||||
$max: map-get($breakpoints, $name);
|
$max: map.get($breakpoints, $name);
|
||||||
@return if($max and $max > 0, $max - .02, null);
|
@return if($max and $max > 0, $max - .02, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../config" as *;
|
@use "../config" as *;
|
||||||
|
|
||||||
// Utility generator
|
// Utility generator
|
||||||
// Used to generate utilities & print utilities
|
// Used to generate utilities & print utilities
|
||||||
@mixin generate-utility($utility, $infix: "", $is-rfs-media-query: false) {
|
@mixin generate-utility($utility, $infix: "", $is-rfs-media-query: false) {
|
||||||
$values: map-get($utility, values);
|
$values: map.get($utility, values);
|
||||||
|
|
||||||
// If the values are a list or string, convert it into a map
|
// If the values are a list or string, convert it into a map
|
||||||
@if type-of($values) == "string" or type-of(nth($values, 1)) != "list" {
|
@if type-of($values) == "string" or type-of(nth($values, 1)) != "list" {
|
||||||
@ -11,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@each $key, $value in $values {
|
@each $key, $value in $values {
|
||||||
$properties: map-get($utility, property);
|
$properties: map.get($utility, property);
|
||||||
|
|
||||||
// Multiple properties are possible, for example with vertical or horizontal margins or paddings
|
// Multiple properties are possible, for example with vertical or horizontal margins or paddings
|
||||||
@if type-of($properties) == "string" {
|
@if type-of($properties) == "string" {
|
||||||
@ -19,21 +20,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use custom class if present
|
// Use custom class if present
|
||||||
$property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
|
$property-class: if(map.has-key($utility, class), map.get($utility, class), nth($properties, 1));
|
||||||
$property-class: if($property-class == null, "", $property-class);
|
$property-class: if($property-class == null, "", $property-class);
|
||||||
|
|
||||||
// Use custom CSS variable name if present, otherwise default to `class`
|
// Use custom CSS variable name if present, otherwise default to `class`
|
||||||
$css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class));
|
$css-variable-name: if(map.has-key($utility, css-variable-name), map.get($utility, css-variable-name), map.get($utility, class));
|
||||||
|
|
||||||
// State params to generate pseudo-classes
|
// State params to generate pseudo-classes
|
||||||
$state: if(map-has-key($utility, state), map-get($utility, state), ());
|
$state: if(map.has-key($utility, state), map.get($utility, state), ());
|
||||||
|
|
||||||
$infix: if($property-class == "" and str-slice($infix, 1, 1) == "-", str-slice($infix, 2), $infix);
|
$infix: if($property-class == "" and str-slice($infix, 1, 1) == "-", str-slice($infix, 2), $infix);
|
||||||
|
|
||||||
// Don't prefix if value key is null (e.g. with shadow class)
|
// Don't prefix if value key is null (e.g. with shadow class)
|
||||||
$property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
|
$property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
|
||||||
|
|
||||||
@if map-get($utility, rfs) {
|
@if map.get($utility, rfs) {
|
||||||
// Inside the media query
|
// Inside the media query
|
||||||
@if $is-rfs-media-query {
|
@if $is-rfs-media-query {
|
||||||
$val: rfs-value($value);
|
$val: rfs-value($value);
|
||||||
@ -46,9 +47,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$is-css-var: map-get($utility, css-var);
|
$is-css-var: map.get($utility, css-var);
|
||||||
$is-local-vars: map-get($utility, local-vars);
|
$is-local-vars: map.get($utility, local-vars);
|
||||||
$is-rtl: map-get($utility, rtl);
|
$is-rtl: map.get($utility, rtl);
|
||||||
|
|
||||||
@if $value != null {
|
@if $value != null {
|
||||||
@if $is-rtl == false {
|
@if $is-rtl == false {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../config" as *;
|
@use "../config" as *;
|
||||||
@use "../variables" as *;
|
@use "../variables" as *;
|
||||||
@use "../vendor/rfs" as *;
|
@use "../vendor/rfs" as *;
|
||||||
@ -6,7 +7,7 @@
|
|||||||
@use "../utilities" as *;
|
@use "../utilities" as *;
|
||||||
|
|
||||||
// Loop over each breakpoint
|
// Loop over each breakpoint
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
|
|
||||||
// Generate media query if needed
|
// Generate media query if needed
|
||||||
@include media-breakpoint-up($breakpoint) {
|
@include media-breakpoint-up($breakpoint) {
|
||||||
@ -16,7 +17,7 @@
|
|||||||
@each $key, $utility in $utilities {
|
@each $key, $utility in $utilities {
|
||||||
// The utility can be disabled with `false`, thus check if the utility is a map first
|
// 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
|
// Only proceed if responsive media queries are enabled or if it's the base media query
|
||||||
@if type-of($utility) == "map" and (map-get($utility, responsive) or $infix == "") {
|
@if type-of($utility) == "map" and (map.get($utility, responsive) or $infix == "") {
|
||||||
@include generate-utility($utility, $infix);
|
@include generate-utility($utility, $infix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25,15 +26,15 @@
|
|||||||
|
|
||||||
// RFS rescaling
|
// RFS rescaling
|
||||||
@media (min-width: $rfs-mq-value) {
|
@media (min-width: $rfs-mq-value) {
|
||||||
@each $breakpoint in map-keys($grid-breakpoints) {
|
@each $breakpoint in map.keys($grid-breakpoints) {
|
||||||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
|
||||||
|
|
||||||
@if (map-get($grid-breakpoints, $breakpoint) < $rfs-breakpoint) {
|
@if (map.get($grid-breakpoints, $breakpoint) < $rfs-breakpoint) {
|
||||||
// Loop over each utility property
|
// Loop over each utility property
|
||||||
@each $key, $utility in $utilities {
|
@each $key, $utility in $utilities {
|
||||||
// The utility can be disabled with `false`, thus check if the utility is a map first
|
// 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
|
// Only proceed if responsive media queries are enabled or if it's the base media query
|
||||||
@if type-of($utility) == "map" and map-get($utility, rfs) and (map-get($utility, responsive) or $infix == "") {
|
@if type-of($utility) == "map" and map.get($utility, rfs) and (map.get($utility, responsive) or $infix == "") {
|
||||||
@include generate-utility($utility, $infix, true);
|
@include generate-utility($utility, $infix, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,7 +48,7 @@
|
|||||||
@each $key, $utility in $utilities {
|
@each $key, $utility in $utilities {
|
||||||
// The utility can be disabled with `false`, thus check if the utility is a map first
|
// The utility can be disabled with `false`, thus check if the utility is a map first
|
||||||
// Then check if the utility needs print styles
|
// Then check if the utility needs print styles
|
||||||
@if type-of($utility) == "map" and map-get($utility, print) == true {
|
@if type-of($utility) == "map" and map.get($utility, print) == true {
|
||||||
@include generate-utility($utility, "-print");
|
@include generate-utility($utility, "-print");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
scss/vendor/_rfs.scss
vendored
6
scss/vendor/_rfs.scss
vendored
@ -1,3 +1,5 @@
|
|||||||
|
@use "sass:map";
|
||||||
|
|
||||||
// stylelint-disable scss/dimension-no-non-numeric-values
|
// stylelint-disable scss/dimension-no-non-numeric-values
|
||||||
|
|
||||||
// SCSS RFS mixin
|
// SCSS RFS mixin
|
||||||
@ -88,8 +90,8 @@ $rfs-base-value-unit: unit($rfs-base-value);
|
|||||||
"em": 1em,
|
"em": 1em,
|
||||||
"%": 1%
|
"%": 1%
|
||||||
);
|
);
|
||||||
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
|
@if ($dividend-unit != $divisor-unit and map.has-key($unit-map, $dividend-unit)) {
|
||||||
$result: $result * map-get($unit-map, $dividend-unit);
|
$result: $result * map.get($unit-map, $dividend-unit);
|
||||||
}
|
}
|
||||||
@return $result;
|
@return $result;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
@use "sass:map";
|
||||||
@use "../../../scss/config" as *;
|
@use "../../../scss/config" as *;
|
||||||
@use "../../../scss/colors" as *;
|
@use "../../../scss/colors" as *;
|
||||||
@use "../../../scss/layout/breakpoints" as *;
|
@use "../../../scss/layout/breakpoints" as *;
|
||||||
@ -7,7 +8,7 @@
|
|||||||
// Docs color palette classes
|
// Docs color palette classes
|
||||||
//
|
//
|
||||||
|
|
||||||
@each $color, $value in map-merge($colors, ("gray-500": $gray-500)) {
|
@each $color, $value in map.merge($colors, ("gray-500": $gray-500)) {
|
||||||
.swatch-#{$color} {
|
.swatch-#{$color} {
|
||||||
color: color-contrast($value);
|
color: color-contrast($value);
|
||||||
background-color: #{$value};
|
background-color: #{$value};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user