Visitar URL original
USWDS - Utilities: Add theme setting for custom breakpoints by jamigibbs · Pull Request #5985 · uswds/uswds · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/uswds-core/src/styles/_properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ $system-properties: (
map-collect(
map.get($system-spacing, "large"),
map.get($system-spacing, "larger"),
map.get($system-spacing, "largest")
map.get($system-spacing, "largest"),
map.get($system-spacing, "custom")
),
extended: (),
),
Expand Down
6 changes: 5 additions & 1 deletion packages/uswds-core/src/styles/mixins/_utility-builder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ through all possible variants

$our-breakpoints: map-deep-get($system-properties, breakpoints, standard);
@each $media-key, $media-value in $our-breakpoints {
@if map.get($theme-utility-breakpoints-complete, $media-key) {
@if (map.get($theme-utility-breakpoints-complete, $media-key)) {
@include at-media($media-key) {
@include these-utilities($utilities, $media-key);
}
} @else if (map-has-key($theme-utility-breakpoints-custom, $media-key)) {
@include at-media($media-key) {
@include these-utilities($utilities, $media-key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ $theme-utility-breakpoints-complete: map.merge(
$theme-utility-breakpoints
) !default;

$theme-utility-breakpoints-custom: () !default;

/*
----------------------------------------
Global colors
Expand Down
2 changes: 2 additions & 0 deletions packages/uswds-core/src/styles/tokens/units/spacing.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use "neg-prefix" as *;
@use "../../functions/units/spacing-multiple" as *;
@use "../../settings" as *;

$system-spacing: (
"smaller": (
Expand Down Expand Up @@ -98,6 +99,7 @@ $system-spacing: (
"widescreen": spacing-multiple(175),
// 1400px
),
"custom": $theme-utility-breakpoints-custom,
"special": (
0: spacing-multiple(0),
"auto": auto,
Expand Down