Visitar URL original
USWDS - Utilities: Custom breakpoints by mahoneycm · Pull Request #6048 · uswds/uswds · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b40b9ab
add $theme-utility-breakpoints-custom setting
jamigibbs Jul 19, 2024
e6c7682
run prettier
jamigibbs Jul 19, 2024
47a5d0a
Revert "run prettier"
jamigibbs Jul 19, 2024
5abc90c
run prettier again and fix mapping error
jamigibbs Jul 19, 2024
0e59b9f
Remove theme token from system-spacing tokens
mahoneycm Sep 4, 2024
fa93556
Merge all breakpoint maps into 'complete' map
mahoneycm Sep 4, 2024
a03b062
Restore utility breakpoint builder to simpler structure now that cust…
mahoneycm Sep 4, 2024
333a726
Add error message to rem-to-user-em function
mahoneycm Sep 4, 2024
0ea2129
Move custom breakpoints from standard to extended; refactor utility b…
mahoneycm Sep 13, 2024
5169607
Run prettier
mahoneycm Sep 13, 2024
6354d4e
Create and implement px-to-user-em sass function
mahoneycm Sep 18, 2024
eea0ec4
Add unit test and error message to px-to-user-em
mahoneycm Sep 18, 2024
3c6e0fa
Remove period from warning valid value list
mahoneycm Sep 18, 2024
4d3c318
Remove unsuded settings at-rule from spacing tokens
mahoneycm Sep 18, 2024
6b22e0a
Merge branch 'develop' of github.com:uswds/uswds into cm-custom-break…
mahoneycm Sep 19, 2024
f319030
Add "and can not be generated" to warning message
Sep 24, 2024
6fb3bcb
Add custom breakpoints to grid-gap, col, & offset
Sep 26, 2024
4a93553
Add custom breakpoints for grid-container
Sep 26, 2024
9c6fbd7
Merge pull request #6083 from uswds/al-custom-breakpoints
amyleadem Oct 1, 2024
3261823
Add more context to breakpoint units warning
thisisdano Oct 3, 2024
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
Prev Previous commit
Next Next commit
Run prettier
  • Loading branch information
mahoneycm committed Sep 13, 2024
commit 51696073e66c90cda350b92fc1ba63939d1bbff9
16 changes: 12 additions & 4 deletions packages/uswds-core/src/styles/mixins/helpers/at-media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ $custom-breakpoints: map-deep-get($system-properties, breakpoints, extended);
@content;
}
} @else if map.has-key($custom-breakpoints, $quoted-bp) {
@if unit(map.get($custom-breakpoints, $quoted-bp)) == "rem" or unit(map.get($custom-breakpoints, $quoted-bp)) == "px" {
@if unit(map.get($custom-breakpoints, $quoted-bp)) ==
"rem" or
unit(map.get($custom-breakpoints, $quoted-bp)) ==
"px"
{
$bp: map.get($custom-breakpoints, $quoted-bp);
@media all and (min-width: #{$bp}) {
@content;
Expand All @@ -43,13 +47,17 @@ $custom-breakpoints: map-deep-get($system-properties, breakpoints, extended);
$bp: rem-to-user-em(map.get($our-breakpoints, $quoted-bp)) - 0.01em;
} @else {
$bp: rem-to-px(map.get($our-breakpoints, $quoted-bp)) - 1px;
}
}
@media all and (max-width: #{$bp}) {
@content;
}
} @else if map.has-key($custom-breakpoints, $quoted-bp) {
@if unit(map.get($custom-breakpoints, $quoted-bp)) == "rem" or unit(map.get($custom-breakpoints, $quoted-bp)) == "px" {
$bp: map.get($custom-breakpoints, $quoted-bp) - .1;
@if unit(map.get($custom-breakpoints, $quoted-bp)) ==
"rem" or
unit(map.get($custom-breakpoints, $quoted-bp)) ==
"px"
{
$bp: map.get($custom-breakpoints, $quoted-bp) - 0.1;
@media all and (max-width: #{$bp}) {
@content;
}
Expand Down