Skip to content

Commit 20ff94e

Browse files
authored
Upgrade stylelint to latest version (#3154)
1 parent 9e301d3 commit 20ff94e

17 files changed

+1114
-945
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ jobs:
108108
if: steps.changed-files.outputs.any_changed == 'true'
109109
run: |
110110
npm ci
111-
npx stylelint ${{ steps.changed-files.outputs.all_changed_files }} --custom-formatter=stylelint-actions-formatters
111+
npx stylelint --rd -q ${{ steps.changed-files.outputs.all_changed_files }} --custom-formatter=stylelint-actions-formatters

.stylelintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
{
1717
"ignoreAtRules": ["mixin", "define-mixin"]
1818
}
19+
],
20+
"plugin/browser-compat": [
21+
true,
22+
{
23+
"severity": "warning",
24+
"allow": {
25+
"features": ["properties.scrollbar-width"],
26+
"flagged": false,
27+
"partialImplementation": true,
28+
"prefix": true
29+
}
30+
}
1931
]
2032
}
2133
}

app/components/primer/alpha/action_list.pcss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ nav-list {
4343
width: 100%;
4444
height: 1px;
4545
content: '';
46-
background: var(--borderColor-muted, var(--color-action-list-item-inline-divider));
46+
/* stylelint-disable-next-line primer/colors */
47+
background: var(--borderColor-muted);
4748
}
4849

4950
/* if descriptionWrap--inline exists, move pseudo divider to wrapper */
@@ -56,7 +57,8 @@ nav-list {
5657
width: 100%;
5758
height: var(--borderWidth-thin);
5859
content: '';
59-
background: var(--borderColor-muted, var(--color-action-list-item-inline-divider));
60+
/* stylelint-disable-next-line primer/colors */
61+
background: var(--borderColor-muted);
6062
}
6163

6264
/* unset the default label pseudo */
@@ -673,7 +675,8 @@ nav-list {
673675
margin-block-end: var(--base-size-8);
674676
margin-inline: calc(-1 * var(--base-size-8));
675677
list-style: none;
676-
background: var(--borderColor-muted, var(--color-action-list-item-inline-divider));
678+
/* stylelint-disable-next-line primer/colors */
679+
background: var(--borderColor-muted);
677680
border: 0;
678681
}
679682

app/components/primer/alpha/button_marketing.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
white-space: nowrap;
1818
vertical-align: middle;
1919
user-select: none;
20+
/* stylelint-disable-next-line primer/colors */
2021
background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%),
2122
var(--color-mktg-btn-bg) !important;
2223
border: 0;

app/components/primer/alpha/dialog.pcss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/* TODO: One day this can be :has(:modal), when it is better supported */
2525
body.has-modal {
26-
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
2726
padding-right: var(--dialog-scrollgutter) !important;
2827
overflow: hidden !important;
2928
}

app/components/primer/alpha/dropdown.pcss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
&::after {
5757
/* stylelint-disable-next-line primer/borders */
5858
border: 7px solid transparent;
59+
/* stylelint-disable-next-line primer/colors */
5960
border-bottom-color: var(--overlay-bgColor);
6061
}
6162

@@ -167,6 +168,7 @@
167168
right: -14px;
168169
left: auto;
169170
border-color: transparent;
171+
/* stylelint-disable-next-line primer/colors */
170172
border-left-color: var(--overlay-bgColor);
171173
}
172174
}
@@ -192,6 +194,7 @@
192194
/* stylelint-disable-next-line primer/spacing */
193195
left: -14px;
194196
border-color: transparent;
197+
/* stylelint-disable-next-line primer/colors */
195198
border-right-color: var(--overlay-bgColor);
196199
}
197200
}
@@ -226,7 +229,7 @@
226229
bottom: -7px;
227230
/* stylelint-disable-next-line primer/spacing */
228231
left: 10px;
229-
/* stylelint-disable-next-line primer/borders */
232+
/* stylelint-disable-next-line primer/borders, primer/colors */
230233
border-top: 7px solid var(--overlay-bgColor);
231234
/* stylelint-disable-next-line primer/borders */
232235
border-right: 7px solid transparent;

app/components/primer/alpha/layout.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
width: 1px;
209209
/* stylelint-disable-next-line primer/spacing */
210210
margin-right: -1px;
211+
/* stylelint-disable-next-line primer/colors */
211212
background: var(--borderColor-default);
212213
}
213214

app/components/primer/alpha/menu.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
left: 0;
6262
width: 2px;
6363
content: '';
64+
/* stylelint-disable-next-line primer/colors */
6465
background-color: var(--underlineNav-borderColor-active);
6566
}
6667
}

app/components/primer/alpha/segmented_control.pcss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
/* stylelint-disable-next-line primer/spacing */
133133
padding-inline: calc(var(--control-medium-paddingInline-normal) - var(--segmentedControl-item-padding));
134134

135-
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
136135
&:focus-visible {
137136
/* stylelint-disable-next-line primer/borders */
138137
border-radius: calc(var(--borderRadius-medium) - var(--segmentedControl-item-padding) / 1);

app/components/primer/alpha/text_field.pcss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
width: var(--borderWidth-thin);
302302
height: var(--base-size-16);
303303
content: '';
304+
/* stylelint-disable-next-line primer/colors */
304305
background: var(--borderColor-default);
305306
}
306307
}
@@ -598,6 +599,7 @@ input[type='checkbox'].FormControl-checkbox {
598599
height: var(--base-size-16);
599600
visibility: hidden;
600601
content: '';
602+
/* stylelint-disable-next-line primer/colors */
601603
background-color: var(--control-checked-fgColor-rest);
602604
transition: visibility 0s linear 230ms;
603605
clip-path: inset(var(--base-size-16) 0 0 0);
@@ -643,18 +645,20 @@ input[type='checkbox'].FormControl-checkbox {
643645

644646
&:disabled {
645647
cursor: not-allowed;
648+
/* stylelint-disable-next-line primer/colors */
646649
background-color: var(--control-fgColor-disabled);
650+
/* stylelint-disable-next-line primer/colors */
647651
border-color: var(--control-fgColor-disabled);
648652
opacity: 1;
649653

650654
&::before {
655+
/* stylelint-disable-next-line primer/colors */
651656
background-color: var(--control-checked-fgColor-rest);
652657
}
653658
}
654659

655660
/* Windows High Contrast mode */
656661
@media (forced-colors: active) {
657-
/* stylelint-disable-next-line primer/colors */
658662
background-color: canvastext;
659663
border-color: canvastext;
660664
}
@@ -706,6 +710,7 @@ input[type='radio'].FormControl-radio {
706710

707711
&[disabled], &:disabled {
708712
cursor: not-allowed;
713+
/* stylelint-disable-next-line primer/colors */
709714
border-color: var(--control-fgColor-disabled);
710715

711716
& ~ .FormControl-radio-labelWrap {
@@ -723,7 +728,6 @@ input[type='radio'].FormControl-radio {
723728

724729
/* Windows High Contrast mode */
725730
@media (forced-colors: active) {
726-
/* stylelint-disable-next-line primer/colors */
727731
background-color: canvastext;
728732
border-color: canvastext;
729733
}

0 commit comments

Comments
 (0)