Skip to content

Commit 483d6b2

Browse files
authored
Add stylelint to ci (#167)
* add stylelint to ci * fix stylelint ci * fix workdir * fix workdir * just run stylelint * fix dir * fix lints * global install
1 parent d323c92 commit 483d6b2

File tree

8 files changed

+100
-55
lines changed

8 files changed

+100
-55
lines changed

.github/workflows/stylelint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Stylelint Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- /**
9+
- preview/**/*.rs
10+
- preview/**/Cargo.toml
11+
- primitives/**/*.rs
12+
- primitives/**/Cargo.toml
13+
- .github/**
14+
- Cargo.toml
15+
16+
pull_request:
17+
types: [opened, synchronize, reopened, ready_for_review]
18+
branches:
19+
- main
20+
paths:
21+
- /**
22+
- preview/**/*.rs
23+
- preview/**/Cargo.toml
24+
- primitives/**/*.rs
25+
- primitives/**/Cargo.toml
26+
- .github/**
27+
- Cargo.toml
28+
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
stylelint:
35+
if: github.event.pull_request.draft == false
36+
timeout-minutes: 30
37+
runs-on: ubuntu-latest
38+
steps:
39+
# Do our best to cache the toolchain and node install steps
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: lts/*
44+
- name: Install dependencies
45+
run: |
46+
npm install --save-dev stylelint-config-idiomatic-order
47+
npm install -g stylelint stylelint-config-standard
48+
- name: Stylelint
49+
run: cd ./preview && npx stylelint "**/*.css" --max-warnings=0

preview/assets/hero.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#hero {
22
display: flex;
3+
height: 40rem;
34
flex-direction: column;
45
align-items: center;
56
justify-content: center;
67
margin: 0;
7-
height: 40rem;
88
}
99

1010
#hero > h1,
@@ -36,24 +36,26 @@
3636
position: absolute;
3737
top: 38rem;
3838
left: 50%;
39-
transform: translate(-50%, -50%);
4039
width: 20px;
4140
height: 20px;
41+
animation: scroll-down-icon-animation 3000ms ease-in-out infinite;
4242
fill: none;
4343
stroke: var(--secondary-color-4);
4444
stroke-linecap: round;
4545
stroke-linejoin: round;
4646
stroke-width: 2;
47-
animation: scroll-down-icon-animation 3000ms ease-in-out infinite;
47+
transform: translate(-50%, -50%);
4848
}
4949

5050
@keyframes scroll-down-icon-animation {
5151
0% {
5252
transform: translateY(0);
5353
}
54+
5455
50% {
5556
transform: translateY(10px);
5657
}
58+
5759
100% {
5860
transform: translateY(0);
5961
}
@@ -62,11 +64,11 @@
6264
#hero-search-container {
6365
display: flex;
6466
width: 80%;
65-
padding: 10px;
6667
max-width: 800px;
6768
flex-direction: column;
6869
align-items: center;
6970
justify-content: center;
71+
padding: 10px;
7072
margin: auto;
7173
}
7274

@@ -102,10 +104,10 @@
102104
}
103105

104106
.explaination {
105-
margin-bottom: 1rem;
106-
padding-left: 5vw;
107-
padding-right: 5vw;
108107
min-width: 50vw;
108+
padding-right: 5vw;
109+
padding-left: 5vw;
110+
margin-bottom: 1rem;
109111
text-align: center;
110112
}
111113

@@ -116,8 +118,8 @@
116118

117119
.explaination-box {
118120
display: flex;
119-
max-width: 30vw;
120121
width: 10rem;
122+
max-width: 30vw;
121123
min-height: 10rem;
122124
box-sizing: border-box;
123125
flex-direction: column;

preview/assets/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ body {
187187
}
188188

189189
.component-description {
190-
margin-left: 5vw;
190+
max-width: 90vw;
191191
margin-right: 5vw;
192+
margin-left: 5vw;
192193
font-size: 1em;
193194
overflow-x: scroll;
194-
max-width: 90vw;
195195
}
196196

197197
.component-installation {

preview/src/components/calendar/style.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@
8989
.calendar-grid-cell {
9090
width: 2rem;
9191
border: none;
92+
border-radius: 0.5rem;
9293
aspect-ratio: 1;
9394
background: none;
9495
color: var(--secondary-color-4);
9596
cursor: pointer;
9697
font-size: 14px;
97-
border-radius: 0.5rem;
9898
}
9999

100100
.calendar-grid-cell[data-month="current"]:not([data-disabled="true"]):hover {
@@ -125,54 +125,54 @@
125125

126126
.calendar-grid-cell[data-month="current"][data-unavailable="true"] {
127127
color: var(--secondary-color-6);
128-
text-decoration: line-through;
129128
cursor: not-allowed;
129+
text-decoration: line-through;
130130
}
131131

132132
.calendar-grid-week td {
133-
padding-left: 0;
134133
padding-right: 0;
134+
padding-left: 0;
135135
}
136136

137137
.calendar-grid-week td:first-child .calendar-grid-cell {
138-
border-top-left-radius: 0.5rem;
139138
border-bottom-left-radius: 0.5rem;
139+
border-top-left-radius: 0.5rem;
140140
}
141141

142142
.calendar-grid-week td:last-child .calendar-grid-cell {
143-
border-top-right-radius: 0.5rem;
144143
border-bottom-right-radius: 0.5rem;
144+
border-top-right-radius: 0.5rem;
145145
}
146146

147147
.calendar-grid-cell[data-month="last"][data-selection-between="true"],
148148
.calendar-grid-cell[data-month="next"][data-selection-between="true"] {
149+
border-radius: 0;
149150
background-color: var(--primary-color-5);
150151
color: var(--secondary-color-5);
151-
border-radius: 0;
152152
}
153153

154154
.calendar-grid-cell[data-month="current"][data-selection-between="true"] {
155+
border-radius: 0;
155156
background-color: var(--primary-color-5);
156157
color: var(--secondary-color-4);
157-
border-radius: 0;
158158
}
159159

160160
td:has(.calendar-grid-cell[data-selection-start="true"]) {
161+
padding: 0;
162+
margin-top: 1px;
163+
margin-bottom: 1px;
161164
background-color: var(--primary-color-5);
162-
border-top-left-radius: 0.5rem;
163165
border-bottom-left-radius: 0.5rem;
164-
padding: 0;
165-
margin-top: 1;
166-
margin-bottom: 1;
166+
border-top-left-radius: 0.5rem;
167167
}
168168

169169
td:has(.calendar-grid-cell[data-selection-end="true"]) {
170+
padding: 0;
171+
margin-top: 1px;
172+
margin-bottom: 1px;
170173
background-color: var(--primary-color-5);
171-
border-top-right-radius: 0.5rem;
172174
border-bottom-right-radius: 0.5rem;
173-
padding: 0;
174-
margin-top: 1;
175-
margin-bottom: 1;
175+
border-top-right-radius: 0.5rem;
176176
}
177177

178178
.calendar-grid-cell[data-month="current"][data-selected="true"]:hover {

preview/src/components/card/style.css

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
.card {
22
display: flex;
33
flex-direction: column;
4-
5-
gap: 1.5rem;
64
padding: 1.5rem 0;
7-
color: var(--secondary-color-4);
85
border: 1px solid var(--light, var(--primary-color-6)) var(--dark, var(--primary-color-5));
96
border-radius: 1rem;
107
background-color: var(--light, var(--primary-color-2)) var(--dark, var(--primary-color-3));
118
box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
9+
color: var(--secondary-color-4);
10+
gap: 1.5rem;
1211
}
1312

1413
.card-header {
1514
display: grid;
16-
grid-template-rows: auto auto;
17-
grid-auto-rows: min-content;
1815
align-items: start;
19-
gap: 0.5rem;
2016
padding: 0 1.5rem;
17+
gap: 0.5rem;
18+
grid-auto-rows: min-content;
19+
grid-template-rows: auto auto;
2120
}
2221

2322
.card-header:has([data-slot="card-action"]) {
2423
grid-template-columns: 1fr auto;
2524
}
2625

2726
.card-title {
28-
line-height: 1;
29-
font-weight: 600;
3027
font-size: 1rem;
28+
font-weight: 600;
29+
line-height: 1;
3130
}
3231

3332
.card-description {
@@ -39,8 +38,7 @@
3938
.card-action {
4039
grid-column-start: 2;
4140
grid-row: 1 / span 2;
42-
align-self: start;
43-
justify-self: end;
41+
place-self: start end;
4442
}
4543

4644
.card-content {

preview/src/components/sheet/style.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
display: flex;
4444
box-sizing: border-box;
4545
flex-direction: column;
46-
gap: 1rem;
4746
border: none;
4847
background: var(--primary-color-2);
4948
box-shadow: 0 4px 20px rgb(0 0 0 / 20%);
5049
color: var(--secondary-color-4);
5150
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
51+
gap: 1rem;
5252
will-change: transform;
5353
}
5454

@@ -205,16 +205,16 @@
205205
.sheet-header {
206206
display: flex;
207207
flex-direction: column;
208-
gap: 0.375rem;
209208
padding: 1rem;
209+
gap: 0.375rem;
210210
}
211211

212212
.sheet-footer {
213213
display: flex;
214214
flex-direction: column;
215-
gap: 0.5rem;
216215
padding: 1rem;
217216
margin-top: auto;
217+
gap: 0.5rem;
218218
}
219219

220220
.sheet-title {
@@ -235,10 +235,10 @@
235235
top: 1rem;
236236
right: 1rem;
237237
display: flex;
238-
align-items: center;
239-
justify-content: center;
240238
width: 24px;
241239
height: 24px;
240+
align-items: center;
241+
justify-content: center;
242242
padding: 0;
243243
border: none;
244244
border-radius: 4px;
@@ -256,7 +256,7 @@
256256
width: 20px;
257257
height: 20px;
258258
fill: none;
259-
stroke: currentColor;
259+
stroke: currentcolor;
260260
stroke-linecap: round;
261261
stroke-linejoin: round;
262262
stroke-width: 2;

preview/src/components/skeleton/style.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.skeleton {
2-
background-color: var(--primary-color-5);
32
border-radius: 0.375rem;
43
animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
4+
background-color: var(--primary-color-5);
55
}
66

77
@keyframes skeleton-pulse {
8-
98
0%,
109
100% {
1110
opacity: 1;

preview/src/components/textarea/style.css

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@
22
.textarea {
33
width: 100%;
44
min-height: 4rem;
5+
box-sizing: border-box;
56
padding: 8px 12px;
6-
line-height: 1.5;
7-
font-family: inherit;
7+
border: none;
8+
border-radius: 0.5rem;
9+
margin: 0;
10+
appearance: none;
11+
background: none;
812
color: var(--secondary-color-4);
13+
font-family: inherit;
14+
line-height: 1.5;
915
outline: none;
1016
resize: vertical;
1117
transition: background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 100ms ease-out;
12-
13-
-webkit-appearance: none;
14-
-moz-appearance: none;
15-
appearance: none;
16-
margin: 0;
17-
border: none;
18-
background: none;
19-
box-sizing: border-box;
20-
border-radius: 0.5rem;
2118
}
2219

2320
.textarea:disabled {
@@ -59,7 +56,7 @@
5956
var(--dark, var(--primary-color-3));
6057
}
6158

62-
.textarea[data-style="outline"]:hover:not(:disabled):not(:focus) {
59+
.textarea[data-style="outline"]:hover:not(:disabled, :focus) {
6360
border-color: var(--primary-color-7);
6461
}
6562

0 commit comments

Comments
 (0)