Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/smooth-eagles-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": major
---

Remove redundant marketing layout selectors
17 changes: 17 additions & 0 deletions deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
*/
const versionDeprecations = {
'17.0.0': [
{
selectors: [
'.top-n0',
'.right-n0',
'.bottom-n0',
'.left-n0',
'.top-md-n0',
'.right-md-n0',
'.bottom-md-n0',
'.left-md-n0',
'.top-lg-n0',
'.right-lg-n0',
'.bottom-lg-n0',
'.left-lg-n0'
],
message: `This selector is deprecated, please use a non-negative selector to set the value to 0 (e.g. top-md-0)".`
},
{
selectors: ['.bg-shade-gradient'],
message: `This selector is deprecated, please use "color-bg-secondary" instead of "bg-shade-gradient".`
Expand Down
20 changes: 12 additions & 8 deletions src/marketing/utilities/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
@each $breakpoint, $variant in $marketing-position-variants {
@include breakpoint($breakpoint) {
@each $scale, $size in $marketing-all-spacers {
.top#{$variant}-#{$scale} { top: $size !important; }
.right#{$variant}-#{$scale} { right: $size !important; }
.bottom#{$variant}-#{$scale} { bottom: $size !important; }
.left#{$variant}-#{$scale} { left: $size !important; }
@if ($size != 0 or $variant != "") {
.top#{$variant}-#{$scale} { top: $size !important; }
.right#{$variant}-#{$scale} { right: $size !important; }
.bottom#{$variant}-#{$scale} { bottom: $size !important; }
.left#{$variant}-#{$scale} { left: $size !important; }
}

.top#{$variant}-n#{$scale} { top: -$size !important; }
.right#{$variant}-n#{$scale} { right: -$size !important; }
.bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
.left#{$variant}-n#{$scale} { left: -$size !important; }
@if ($size != 0) {
.top#{$variant}-n#{$scale} { top: -$size !important; }
.right#{$variant}-n#{$scale} { right: -$size !important; }
.bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
.left#{$variant}-n#{$scale} { left: -$size !important; }
}
}
}
}
Expand Down