Skip to content

Commit 2c14915

Browse files
authored
Revert "Convert padding and border utilities to rem units with fallbacks (#2315)"
This reverts commit 15ef15b.
1 parent 15ef15b commit 2c14915

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/support/variables/misc.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
$border-width: 1px !default;
55
$border-style: solid !default;
66
$border: $border-width $border-style var(--color-border-default) !default;
7-
$border-rem: var(--primer-borderWidth-thin, 1px) solid var(--color-border-default) !default;
87

98
// Border Radius
109
$border-radius-1: 4px !default;

src/utilities/borders.scss

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
// Core border utilities
2-
// stylelint-disable block-opening-brace-space-before, primer/borders
2+
// stylelint-disable block-opening-brace-space-before
33

44
/* Add a gray border to the left and right */
55
.border-x {
6-
border-right: $border-rem !important;
7-
border-left: $border-rem !important;
6+
border-right: $border !important;
7+
border-left: $border !important;
88
}
99

1010
/* Add a gray border to the top and bottom */
1111
.border-y {
12-
border-top: $border-rem !important;
13-
border-bottom: $border-rem !important;
12+
border-top: $border !important;
13+
border-bottom: $border !important;
1414
}
1515

1616
/* Responsive gray borders */
1717
@each $breakpoint, $variant in $responsive-variants {
1818
@include breakpoint($breakpoint) {
1919
/* Add a gray border on all sides at/above this breakpoint */
20-
.border#{$variant} { border: $border-rem !important; }
20+
.border#{$variant} { border: $border !important; }
2121
.border#{$variant}-0 { border: 0 !important; }
2222

23-
.border#{$variant}-top { border-top: $border-rem !important; }
24-
.border#{$variant}-right { border-right: $border-rem !important; }
25-
.border#{$variant}-bottom { border-bottom: $border-rem !important; }
26-
.border#{$variant}-left { border-left: $border-rem !important; }
23+
.border#{$variant}-top { border-top: $border !important; }
24+
.border#{$variant}-right { border-right: $border !important; }
25+
.border#{$variant}-bottom { border-bottom: $border !important; }
26+
.border#{$variant}-left { border-left: $border !important; }
2727

2828
.border#{$variant}-top-0 { border-top: 0 !important; }
2929
.border#{$variant}-right-0 { border-right: 0 !important; }
3030
.border#{$variant}-bottom-0 { border-bottom: 0 !important; }
3131
.border#{$variant}-left-0 { border-left: 0 !important; }
3232

3333
// Rounded corners
34-
.rounded#{$variant} { border-radius: var(--primer-borderRadius-medium, $border-radius-2) !important; }
34+
.rounded#{$variant} { border-radius: $border-radius !important; }
3535
.rounded#{$variant}-0 { border-radius: 0 !important; }
36-
.rounded#{$variant}-1 { border-radius: var(--primer-borderRadius-small, $border-radius-1) !important; }
37-
.rounded#{$variant}-2 { border-radius: var(--primer-borderRadius-medium, $border-radius-2) !important; }
38-
.rounded#{$variant}-3 { border-radius: var(--primer-borderRadius-large, $border-radius-3) !important; }
36+
.rounded#{$variant}-1 { border-radius: $border-radius-1 !important; }
37+
.rounded#{$variant}-2 { border-radius: $border-radius-2 !important; }
38+
.rounded#{$variant}-3 { border-radius: $border-radius-3 !important; }
3939

4040
@each $edge, $corners in $edges {
4141
.rounded#{$variant}-#{$edge}-0 {
@@ -46,29 +46,30 @@
4646

4747
.rounded#{$variant}-#{$edge}-1 {
4848
@each $corner in $corners {
49-
border-#{$corner}-radius: var(--primer-borderRadius-small, $border-radius-1) !important;
49+
border-#{$corner}-radius: $border-radius-1 !important;
5050
}
5151
}
5252

5353
.rounded#{$variant}-#{$edge}-2 {
5454
@each $corner in $corners {
55-
border-#{$corner}-radius: var(--primer-borderRadius-medium, $border-radius-2) !important;
55+
border-#{$corner}-radius: $border-radius-2 !important;
5656
}
5757
}
5858

5959
.rounded#{$variant}-#{$edge}-3 {
6060
@each $corner in $corners {
61-
border-#{$corner}-radius: var(--primer-borderRadius-medium, $border-radius-3) !important;
61+
border-#{$corner}-radius: $border-radius-3 !important;
6262
}
6363
}
6464
}
6565
}
6666
}
6767

6868
/* Add a 50% border-radius to make something into a circle */
69-
.circle { border-radius: var(--primer-borderRadius-full, 50%) !important; }
69+
.circle { border-radius: 50% !important; }
7070

7171
/* Change the border style to dashed, in conjunction with another utility */
7272
.border-dashed {
73+
// stylelint-disable-next-line primer/borders
7374
border-style: dashed !important;
7475
}

src/utilities/padding.scss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
@each $breakpoint, $variant in $responsive-variants {
88
@include breakpoint($breakpoint) {
99
// Loop through the spacer values
10-
@each $scale, $size in $spacer-map-rem-extended {
11-
@if ($scale < length($spacer-map-rem)) {
10+
@each $scale, $size in $spacer-map-extended {
11+
@if ($scale < length($spacer-map)) {
1212
/* Set a $size padding to all sides at $breakpoint */
1313
.p#{$variant}-#{$scale} { padding: $size !important; }
1414
}
@@ -22,7 +22,7 @@
2222
/* Set a $size padding to the left at $breakpoint */
2323
.pl#{$variant}-#{$scale} { padding-left: $size !important; }
2424

25-
@if ($scale < length($spacer-map-rem)) {
25+
@if ($scale < length($spacer-map)) {
2626
/* Set a $size padding to the left & right at $breakpoint */
2727
.px#{$variant}-#{$scale} {
2828
padding-right: $size !important;
@@ -41,16 +41,16 @@
4141

4242
// responsive padding for containers
4343
.p-responsive {
44-
padding-right: var(--base-size-16, $spacer-3) !important;
45-
padding-left: var(--base-size-16, $spacer-3) !important;
44+
padding-right: $spacer-3 !important;
45+
padding-left: $spacer-3 !important;
4646

4747
@include breakpoint(sm) {
48-
padding-right: var(--base-size-40, $spacer-6) !important;
49-
padding-left: var(--base-size-40, $spacer-6) !important;
48+
padding-right: $spacer-6 !important;
49+
padding-left: $spacer-6 !important;
5050
}
5151

5252
@include breakpoint(lg) {
53-
padding-right: var(--base-size-16, $spacer-3) !important;
54-
padding-left: var(--base-size-16, $spacer-3) !important;
53+
padding-right: $spacer-3 !important;
54+
padding-left: $spacer-3 !important;
5555
}
5656
}

0 commit comments

Comments
 (0)