Skip to content

Commit 7dd9f5a

Browse files
committed
Merge branch 'main' into tobiasahlin/merge-marketing-spacing-utilities
2 parents 3bc025f + b11e1bc commit 7dd9f5a

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

.changeset/smooth-eagles-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": major
3+
---
4+
5+
Remove redundant marketing layout selectors

deprecations.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ const versionDeprecations = {
1616
],
1717
message: `This selector is deprecated, please use pt-X, pr-X, pb-X, and pl-X to set paddings on all sides above spacing level 6.`
1818
},
19+
{
20+
selectors: [
21+
'.top-n0',
22+
'.right-n0',
23+
'.bottom-n0',
24+
'.left-n0',
25+
'.top-md-n0',
26+
'.right-md-n0',
27+
'.bottom-md-n0',
28+
'.left-md-n0',
29+
'.top-lg-n0',
30+
'.right-lg-n0',
31+
'.bottom-lg-n0',
32+
'.left-lg-n0'
33+
],
34+
message: `This selector is deprecated, please use a non-negative selector to set the value to 0 (e.g. top-md-0).`
35+
},
1936
{
2037
selectors: ['.bg-shade-gradient'],
2138
message: `This selector is deprecated, please use "color-bg-secondary" instead of "bg-shade-gradient".`

docs/content/support/v16-migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Most components don't need to be updated and should work without making changes.
2424
| `.Counter--gray` | `.Counter--primary` |
2525
| `.Counter--gray-light` | `.Counter--secondary` |
2626

27-
### Dropdwon
27+
### Dropdown
2828

2929
| [`v15`](https://primer.style/css/components/dropdown#dark) | `v16` |
3030
| ---------------------------------------------------------- | ----- |

src/marketing/utilities/layout.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
@each $breakpoint, $variant in $marketing-position-variants {
77
@include breakpoint($breakpoint) {
88
@each $scale, $size in $spacer-map-extended {
9-
.top#{$variant}-#{$scale} { top: $size !important; }
10-
.right#{$variant}-#{$scale} { right: $size !important; }
11-
.bottom#{$variant}-#{$scale} { bottom: $size !important; }
12-
.left#{$variant}-#{$scale} { left: $size !important; }
9+
@if ($size != 0 or $variant != "") {
10+
.top#{$variant}-#{$scale} { top: $size !important; }
11+
.right#{$variant}-#{$scale} { right: $size !important; }
12+
.bottom#{$variant}-#{$scale} { bottom: $size !important; }
13+
.left#{$variant}-#{$scale} { left: $size !important; }
14+
}
1315

14-
.top#{$variant}-n#{$scale} { top: -$size !important; }
15-
.right#{$variant}-n#{$scale} { right: -$size !important; }
16-
.bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
17-
.left#{$variant}-n#{$scale} { left: -$size !important; }
16+
@if ($size != 0) {
17+
.top#{$variant}-n#{$scale} { top: -$size !important; }
18+
.right#{$variant}-n#{$scale} { right: -$size !important; }
19+
.bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
20+
.left#{$variant}-n#{$scale} { left: -$size !important; }
21+
}
1822
}
1923
}
2024
}

0 commit comments

Comments
 (0)