Skip to content

Commit 8a15968

Browse files
nschonninzakasharish-sethuramanmdjermanovic
authored
docs: add Stylelint configuration and cleanup (#16379)
* build: add initial Stylelint setup * fix: stylelint no-eol-whitespace * fix: stylelint no-empty-first-line * fix: stylelint max-empty-lines * fix: stylelint rule-empty-line-before * fix: stylelint block-closing-brace-empty-line-before * fix: stylelint block-closing-brace-newline-after * fix: stylelint block-opening-brace-newline-after * fix: stylelint block-opening-brace-space-before * fix: stylelint declaration-colon-newline-after * fix: stylelint declaration-colon-space-after * fix: stylelint declaration-empty-line-before * fix: stylelint length-zero-no-unit * fix: stylelint indentation of 4 * fix: stylelint media-feature-colon-space-after * fix: stylelint no-duplicate-at-import-rules * fix: stylelint scss/at-import-partial-extension * fix: stylelint scss/double-slash-comment-empty-line-before * fix: stylelint selector-attribute-quotes * fix: stylelint selector-combinator-space-after * fix: stylelint selector-combinator-space-before * fix: stylelint selector-descendant-combinator-no-non-space * fix: stylelint selector-list-comma-newline-after * fix: stylelint selector-pseudo-element-colon-notation * fix: stylelint string-quotes * fix: stylelint value-list-comma-newline-after * ci: add Stylelint hook for docs * docs: add direct Stylelint dep * docs: ignore re-copied SCSS files in _site * Update docs/src/assets/scss/print.scss Co-authored-by: Nick Schonning <[email protected]> * Update docs/package.json Co-authored-by: Strek <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Nick Schonning <[email protected]> * Add `lint:fix:scss` script * Update docs/src/assets/scss/syntax-highlighter.scss Co-authored-by: Strek <[email protected]> * Update docs/.stylelintrc.json Co-authored-by: Milos Djermanovic <[email protected]> Co-authored-by: Nicholas C. Zakas <[email protected]> Co-authored-by: Strek <[email protected]> Co-authored-by: Milos Djermanovic <[email protected]>
1 parent 9b0a469 commit 8a15968

29 files changed

+149
-169
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- name: Install Docs Packages
2929
working-directory: docs
3030
run: npm install
31+
- name: Stylelint Docs
32+
working-directory: docs
33+
run: npm run lint:scss
3134
- name: Lint Docs JS Files
3235
run: node Makefile lintDocsJS
3336

docs/.stylelintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": ["stylelint-config-standard-scss"],
3+
"rules": {
4+
"alpha-value-notation": null,
5+
"at-rule-empty-line-before": null,
6+
"color-function-notation": null,
7+
"color-hex-case": null,
8+
"custom-property-empty-line-before": null,
9+
"custom-property-pattern": null,
10+
"declaration-block-no-duplicate-properties": null,
11+
"declaration-block-no-redundant-longhand-properties": null,
12+
"declaration-block-no-shorthand-property-overrides": null,
13+
"hue-degree-notation": null,
14+
"indentation": 4,
15+
"max-line-length": null,
16+
"no-descending-specificity": null,
17+
"no-duplicate-selectors": null,
18+
"number-leading-zero": null,
19+
"number-no-trailing-zeros": null,
20+
"property-no-unknown": null,
21+
"property-no-vendor-prefix": null,
22+
"selector-class-pattern": null,
23+
"value-keyword-case": null
24+
},
25+
"ignoreFiles": [
26+
"_site/**"
27+
]
28+
}

docs/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"build:sass": "sass --style=compressed src/assets/scss:src/assets/css --no-source-map",
1616
"build:eleventy": "npx @11ty/eleventy",
1717
"start": "npm-run-all build:sass --parallel watch:*",
18-
"build": "npm-run-all build:sass build:eleventy images"
18+
"build": "npm-run-all build:sass build:eleventy images",
19+
"lint:scss": "stylelint \"**/*.scss\"",
20+
"lint:fix:scss": "npm run lint:scss -- --fix"
1921
},
2022
"devDependencies": {
2123
"@11ty/eleventy": "^1.0.1",
@@ -40,7 +42,9 @@
4042
"netlify-cli": "^10.3.1",
4143
"npm-run-all": "^4.1.5",
4244
"rimraf": "^3.0.2",
43-
"sass": "^1.52.1"
45+
"sass": "^1.52.1",
46+
"stylelint": "^14.13.0",
47+
"stylelint-config-standard-scss": "^5.0.0"
4448
},
4549
"engines": {
4650
"node": ">=14.0.0"

docs/src/assets/scss/carbon-ads.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.hero-ad {
2-
@media all and (max-width: 800px) {
3-
display: none;
4-
}
2+
@media all and (max-width: 800px) {
3+
display: none;
4+
}
55
}
66

77
#carbonads * {

docs/src/assets/scss/components/alert.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
}
4343
}
4444

45-
4645
[data-theme="dark"] {
4746
.alert {
4847
&.alert--warning {
@@ -101,7 +100,6 @@
101100
}
102101
}
103102

104-
105103
.alert__learn-more {
106104
display: block;
107105
font-weight: 500;

docs/src/assets/scss/components/buttons.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ button {
2323
align-items: center;
2424
justify-content: center;
2525
border-radius: var(--border-radius);
26-
27-
transition: background-color .2s linear,
28-
border-color .2s linear;
26+
transition: background-color .2s linear, border-color .2s linear;
2927

3028
svg {
3129
color: inherit;

docs/src/assets/scss/components/docs-index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
}
144144

145145
#ham-top {
146-
147146
transform: rotate(41deg);
148147
}
149148

docs/src/assets/scss/components/docs-navigation.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
margin-bottom: 2rem;
1414
margin-block-end: 2rem;
1515

16-
1716
@media all and (min-width: 1024px) {
1817
font-size: var(--step-0);
1918
margin-top: 0;
@@ -50,7 +49,6 @@
5049
}
5150
}
5251

53-
5452
.docs-nav-panel {
5553
@media all and (min-width: 1024px) {
5654
display: flex;
@@ -83,11 +81,9 @@
8381
align-items: center;
8482
margin-left: .5rem;
8583
margin-right: -10px;
86-
8784
margin-inline-start: .5rem;
8885
margin-inline-end: -10px;
8986

90-
9187
svg {
9288
width: 40px;
9389
height: 40px;
@@ -118,7 +114,6 @@
118114
}
119115

120116
#ham-top {
121-
122117
transform: rotate(41deg);
123118
}
124119

@@ -128,8 +123,6 @@
128123
}
129124
}
130125

131-
132-
133126
@media all and (min-width: 1024px) {
134127
.docs-site-nav {
135128
flex-direction: row;
@@ -151,5 +144,4 @@
151144
order: 1;
152145
}
153146
}
154-
155147
}

docs/src/assets/scss/components/hero.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
}
4141

4242
.hero--homepage {
43-
4443
.section-title {
4544
margin-bottom: 1.5rem;
4645
margin-block-end: 1.5rem;

docs/src/assets/scss/components/index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
}
8080

8181
#ham-top {
82-
8382
transform: rotate(41deg);
8483
}
8584

0 commit comments

Comments
 (0)