Skip to content

Commit 247821e

Browse files
authored
setup Stylelint for website, adjust rules, fix warnings (#5140)
* setup Stylelint for website, adjust rules, fix warnings * also lint swizzled CSS files * fix CI checks command * move stylelint deps, deduplicate lock
1 parent fa7ae30 commit 247821e

13 files changed

Lines changed: 533 additions & 93 deletions

File tree

website/.stylelintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": ["stylelint-scss"],
3+
"extends": ["stylelint-config-standard-scss"],
4+
"rules": {
5+
"at-rule-no-unknown": null,
6+
"custom-property-pattern": null,
7+
"alpha-value-notation": "number",
8+
"layer-name-pattern": null,
9+
"media-feature-range-notation": "prefix",
10+
"selector-class-pattern": null,
11+
"selector-pseudo-element-colon-notation": "single",
12+
"scss/at-rule-no-unknown": true
13+
}
14+
}

website/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
"format:examples": "eslint-examples-jsx --fix && eslint-examples-tsx --fix",
2626
"prettier": "yarn format:style",
2727
"lint": "yarn --cwd ../ lint:website",
28+
"lint:styles": "stylelint **/*.{scss,css}",
2829
"lint:examples": "eslint-examples-jsx && eslint-examples-tsx && tsc-examples",
2930
"lint:markdown:images": "node ../scripts/src/image-check.ts",
3031
"lint:markdown:links": "remark ../docs --quiet -r .remarkrc.withBrokenLinks.mjs",
31-
"ci:lint": "yarn lint && yarn lint:examples && yarn lint:markdown:images && prettier --check src/**/*.scss",
32+
"ci:lint": "yarn lint && yarn lint:styles && yarn lint:examples && yarn lint:markdown:images && prettier --check src/**/*.scss",
3233
"pwa:generate": "npx pwa-asset-generator ./static/img/header_logo.svg ./static/img/pwa --padding '40px' --background 'rgb(32, 35, 42)' --icon-only --opaque true",
3334
"update-redirects": "node ../scripts/src/update-redirects.ts",
3435
"build:vercel": "docusaurus build",
@@ -76,6 +77,9 @@
7677
"prettier": "^3.8.4",
7778
"remark-cli": "^12.0.1",
7879
"sass": "1.101.0",
80+
"stylelint": "^17.13.0",
81+
"stylelint-config-standard-scss": "^17.0.0",
82+
"stylelint-scss": "^7.2.0",
7983
"typescript": "^6.0.3"
8084
}
8185
}

website/src/components/Home/Community/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@media only screen and (max-width: 900px) {
2121
.featureContainer {
2222
flex-direction: column;
23-
gap: 0rem;
23+
gap: 0;
2424
max-width: 600px;
2525
}
2626

website/src/components/Home/Framework/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
border: 1px solid var(--home-border);
1717
border-radius: 12px;
1818
overflow: hidden;
19-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.03);
19+
box-shadow: 0 4px 8px rgb(0 0 0 / 0.03);
2020
background-color: var(--home-background);
2121
display: flex;
2222
flex-direction: column;

website/src/components/Home/Hero/styles.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
}
122122

123123
.secondaryButton {
124-
border: none;
125124
padding: 10px 24px;
126125
border-radius: 99rem;
127126
font-weight: bold;

website/src/components/Home/Platforms/styles.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
background-color: var(--home-background);
3333
border-radius: 0.5rem;
3434
border: 1px solid var(--home-border);
35-
overflow: hidden;
3635
position: relative;
3736
height: calc(100% + 4rem);
38-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.03);
37+
box-shadow: 0 4px 8px rgb(0 0 0 / 0.03);
3938
overflow: hidden;
4039
}
4140

@@ -121,9 +120,10 @@
121120
@media only screen and (max-width: 450px) {
122121
.codeEditorContentContainer pre,
123122
.codeEditorContentContainer code {
124-
padding: 16px 16px;
123+
padding: 16px;
125124
font-size: 3.2vw;
126125
}
126+
127127
.deviceContainer {
128128
width: calc(100% - 2rem);
129129
}

website/src/components/Home/Watch/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
.videoContainer {
1616
border: 1px solid var(--home-border);
1717
border-radius: 12px;
18-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
18+
box-shadow: 0 4px 8px rgb(0 0 0 / 0.03);
1919
padding: 16px;
2020
display: flex;
2121
flex-direction: column;

website/src/css/_shared.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
%hash-link-style {
2828
&,
29-
&::before {
29+
&:before {
3030
color: var(--subtle);
3131
border-bottom: 0 !important;
3232
}

0 commit comments

Comments
 (0)