Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating and autofixing stylelint #1765

Merged
merged 14 commits into from Dec 8, 2021
Merged
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -26,11 +26,13 @@ jobs:
if [ $? -eq 0 ]
then
set -e
git stash
git remote update
git fetch
git checkout --track origin/$GITHUB_HEAD_REF
git config --local user.email "actions@github.com"
git config --local user.name "Actions Auto Build"
git stash pop
git add src
git commit -m "Stylelint auto-fixes"
git push
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -42,7 +42,7 @@
"@changesets/cli": "2.18.1",
"@github/prettier-config": "0.0.4",
"@koddsson/postcss-sass": "5.0.0",
"@primer/stylelint-config": "12.1.1",
"@primer/stylelint-config": "12.2.0",
"autoprefixer": "10.4.0",
"cssstats": "4.0.2",
"eslint": "8.4.0",
Expand All @@ -64,7 +64,6 @@
"prettier": "2.5.1",
"semver": "7.3.5",
"stylelint": "14.1.0",
"stylelint-scss": "4.0.0",
"table": "6.7.5"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion src/actionlist/action-list-item.scss
Expand Up @@ -204,7 +204,7 @@
visibility: hidden;
opacity: 0;
transition:
visibility 0 linear $actionList-item-checkmark-transition-timing,
visibility 0 linear $actionList-item-checkmark-transition-timing,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was driving me crazy!

opacity $actionList-item-checkmark-transition-timing;
}

Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/autocomplete.scss
Expand Up @@ -44,7 +44,7 @@
}

&.selected,
&[aria-selected=true],
&[aria-selected='true'],
&.navigation-focus {
color: var(--color-fg-on-emphasis);
text-decoration: none;
Expand Down
1 change: 1 addition & 0 deletions src/base/base.scss
Expand Up @@ -46,6 +46,7 @@ hr,
background: transparent;
border: 0;
border-bottom: $border-width $border-style var(--color-border-muted);

@include clearfix();
}

Expand Down
1 change: 0 additions & 1 deletion src/base/index.scss
@@ -1,5 +1,4 @@
@import '../support/index.scss';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda liked that the import that doesn't output any styles is somewhat visually separated. But we can always add a comment to separate it. So the stylelint rule should still be fine to keep.

@import './normalize.scss';
@import './base.scss';
@import './kbd.scss';
Expand Down
1 change: 0 additions & 1 deletion src/blankslate/index.scss
@@ -1,3 +1,2 @@
@import '../support/index.scss';

@import './blankslate.scss';
2 changes: 1 addition & 1 deletion src/breadcrumb/breadcrumb.scss
Expand Up @@ -21,7 +21,7 @@
}

.breadcrumb-item-selected,
.breadcrumb-item[aria-current]:not([aria-current=false]) {
.breadcrumb-item[aria-current]:not([aria-current='false']) {
&::after {
content: none;
}
Expand Down
5 changes: 3 additions & 2 deletions src/buttons/button-group.scss
Expand Up @@ -6,6 +6,7 @@
.BtnGroup {
display: inline-block;
vertical-align: middle;

@include clearfix();

// Proper spacing for multiple button groups (a la, gollum editor)
Expand Down Expand Up @@ -33,7 +34,7 @@
}

&.selected,
&[aria-selected=true],
&[aria-selected='true'],
&:focus,
&:active,
&:hover {
Expand Down Expand Up @@ -66,7 +67,7 @@
}

&.selected,
&[aria-selected=true],
&[aria-selected='true'],
&:focus,
&:active,
&:hover {
Expand Down
18 changes: 9 additions & 9 deletions src/buttons/button.scss
Expand Up @@ -24,7 +24,7 @@

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
cursor: default;
}

Expand Down Expand Up @@ -84,14 +84,14 @@
}

&.selected,
&[aria-selected=true] {
&[aria-selected='true'] {
background-color: var(--color-btn-selected-bg);
box-shadow: var(--color-primer-shadow-inset);
}

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-primer-fg-disabled);
background-color: var(--color-btn-bg);
border-color: var(--color-btn-border);
Expand Down Expand Up @@ -127,14 +127,14 @@

&:active,
&.selected,
&[aria-selected=true] {
&[aria-selected='true'] {
background-color: var(--color-btn-primary-selected-bg);
box-shadow: var(--color-btn-primary-selected-shadow);
}

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-btn-primary-disabled-text);
background-color: var(--color-btn-primary-disabled-bg);
border-color: var(--color-btn-primary-disabled-border);
Expand Down Expand Up @@ -184,7 +184,7 @@

&:active,
&.selected,
&[aria-selected=true] {
&[aria-selected='true'] {
color: var(--color-btn-outline-selected-text);
background-color: var(--color-btn-outline-selected-bg);
border-color: var(--color-btn-outline-selected-border);
Expand All @@ -193,7 +193,7 @@

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-btn-outline-disabled-text);
background-color: var(--color-btn-outline-disabled-bg);
border-color: var(--color-btn-border);
Expand Down Expand Up @@ -242,7 +242,7 @@

&:active,
&.selected,
&[aria-selected=true] {
&[aria-selected='true'] {
color: var(--color-btn-danger-selected-text);
background-color: var(--color-btn-danger-selected-bg);
border-color: var(--color-btn-danger-selected-border);
Expand All @@ -251,7 +251,7 @@

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-btn-danger-disabled-text);
background-color: var(--color-btn-danger-disabled-bg);
border-color: var(--color-btn-border);
Expand Down
11 changes: 5 additions & 6 deletions src/buttons/misc.scss
Expand Up @@ -21,7 +21,7 @@
}

&:disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
&,
&:hover {
color: var(--color-primer-fg-disabled);
Expand Down Expand Up @@ -50,7 +50,7 @@
&:active,
&:focus,
&.selected,
&[aria-selected=true],
&[aria-selected='true'],
&.zeroclipboard-is-active {
color: var(--color-accent-fg);
background-color: none;
Expand All @@ -59,14 +59,13 @@
box-shadow: var(--color-btn-focus-shadow);
}

&:active
&.zeroclipboard-is-active {
&:active &.zeroclipboard-is-active {
background-color: var(--color-btn-selected-bg);
}

&:disabled,
&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-primer-fg-disabled);
background-color: transparent;
}
Expand All @@ -93,7 +92,7 @@
&:hover { color: var(--color-accent-fg); }

&.disabled,
&[aria-disabled=true] {
&[aria-disabled='true'] {
color: var(--color-primer-fg-disabled);
cursor: default;

Expand Down
1 change: 1 addition & 0 deletions src/color-modes/native.scss
Expand Up @@ -2,6 +2,7 @@
// Enables color modes for native elements

@include color-mode(light) { color-scheme: light; }

@include color-mode(dark) { color-scheme: dark; }

[data-color-mode] {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/dark.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_dark.scss';

@include color-mode-theme(dark) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/dark_colorblind.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_dark_colorblind.scss';

@include color-mode-theme(dark_colorblind) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/dark_dimmed.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_dark_dimmed.scss';

@include color-mode-theme(dark_dimmed) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/dark_high_contrast.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_dark_high_contrast.scss';

@include color-mode-theme(dark_high_contrast) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/light.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_light.scss';

@include color-mode-theme(light, true) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/light_colorblind.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_light_colorblind.scss';

@include color-mode-theme(light_colorblind) {
Expand Down
1 change: 0 additions & 1 deletion src/color-modes/themes/light_high_contrast.scss
@@ -1,5 +1,4 @@
@import '../../support/index.scss';

@import '@primer/primitives/dist/scss/colors/_light_high_contrast.scss';

@include color-mode-theme(light_high_contrast) {
Expand Down
2 changes: 2 additions & 0 deletions src/forms/form-control.scss
Expand Up @@ -54,6 +54,7 @@ label {
// Ensures inputs don't zoom on mobile iPhone but are body-font size on iPad
@supports (-webkit-touch-callout: none) {
font-size: $h4-size;

@include breakpoint(md) {
font-size: $body-font-size;
}
Expand Down Expand Up @@ -181,6 +182,7 @@ textarea.form-control {
.hfields {
// stylelint-disable-next-line primer/spacing
margin: 15px 0;

@include clearfix;

.form-group {
Expand Down
1 change: 0 additions & 1 deletion src/labels/index.scss
@@ -1,6 +1,5 @@
@import '../support/index.scss';
@import './mixins.scss';

@import './issue-labels.scss';
@import './labels.scss';
@import './states.scss';
Expand Down
1 change: 1 addition & 0 deletions src/labels/labels.scss
Expand Up @@ -10,6 +10,7 @@
.label, // TODO: Deprecte
.Label {
@include labels-base;

border-color: var(--color-border-default);

&:hover {
Expand Down
1 change: 0 additions & 1 deletion src/layout/index.scss
@@ -1,6 +1,5 @@
@import '../support/index.scss';
@import './mixins.scss';

@import './container.scss';
@import './grid.scss';
@import './grid-offset.scss';
Expand Down
6 changes: 1 addition & 5 deletions src/layout/layout.scss
Expand Up @@ -2,6 +2,7 @@

.Layout {
display: grid;

--Layout-sidebar-width: #{map-get($sidebar-width, 'sm')};
--Layout-gutter: 16px;

Expand All @@ -25,7 +26,6 @@

grid-auto-flow: column;
grid-template-columns: auto 0 1fr; // sidebar column, separator, main column
// stylelint-disable-next-line primer/no-undefined-vars
grid-gap: var(--Layout-gutter);

.Layout-sidebar {
Expand Down Expand Up @@ -146,7 +146,6 @@
}

.Layout-sidebar {
// stylelint-disable-next-line primer/no-undefined-vars
width: var(--Layout-sidebar-width);
}

Expand All @@ -169,17 +168,14 @@
}

.Layout-main-centered-md {
// stylelint-disable-next-line primer/no-undefined-vars
max-width: calc(#{$container-md} + var(--Layout-sidebar-width) + var(--Layout-gutter));
}

.Layout-main-centered-lg {
// stylelint-disable-next-line primer/no-undefined-vars
max-width: calc(#{$container-lg} + var(--Layout-sidebar-width) + var(--Layout-gutter));
}

.Layout-main-centered-xl {
// stylelint-disable-next-line primer/no-undefined-vars
max-width: calc(#{$container-xl} + var(--Layout-sidebar-width) + var(--Layout-gutter));
}
}
6 changes: 3 additions & 3 deletions src/layout/mixins.scss
Expand Up @@ -7,9 +7,9 @@
.Layout-sidebar,
.Layout-divider,
.Layout-main {
width: 100% !important;
grid-column: 1 !important;
}
width: 100% !important;
grid-column: 1 !important;
}

&.Layout--sidebarPosition-flowRow-start {
.Layout-sidebar {
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/images.scss
Expand Up @@ -10,12 +10,12 @@
box-sizing: content-box;
background-color: var(--color-canvas-default);

&[align=right] {
&[align='right'] {
// stylelint-disable-next-line primer/spacing
padding-left: 20px;
}

&[align=left] {
&[align='left'] {
// stylelint-disable-next-line primer/spacing
padding-right: 20px;
}
Expand Down