Skip to content

Commit 74afa7b

Browse files
committed
Lint CSS
1 parent f54dbda commit 74afa7b

File tree

7 files changed

+53
-28
lines changed

7 files changed

+53
-28
lines changed

bun.lockb

1.47 KB
Binary file not shown.

eslint.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ import globals from 'globals'
33
import js from '@eslint/js'
44
import prettier from 'eslint-plugin-prettier'
55
import eslintConfigPrettier from 'eslint-config-prettier'
6+
import css from '@eslint/css'
67

78
export default defineConfig([
9+
// Lint CSS
10+
{
11+
files: ['src/**/*.css'],
12+
plugins: { css },
13+
language: 'css/css'
14+
},
15+
16+
// Lint javascripts
817
{
918
files: ['src/**/*.{js,mjs,cjs}'],
1019
languageOptions: {globals: globals.browser},
@@ -14,8 +23,9 @@ export default defineConfig([
1423
'no-undef': 'warn',
1524
},
1625
},
26+
27+
// Prettier
1728
{
18-
// Apply Prettier only to files in src directory
1929
files: ['src/**/*.{js,mjs,cjs}'],
2030
plugins: {
2131
prettier: prettier
@@ -24,6 +34,7 @@ export default defineConfig([
2434
'prettier/prettier': 'error'
2535
}
2636
},
27-
// This disables rules that conflict with Prettier globally
37+
38+
// Disable rules that conflict with Prettier globally
2839
eslintConfigPrettier
2940
])

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"release": "release-it"
1919
},
2020
"devDependencies": {
21+
"@eslint/css": "^0.6.0",
2122
"@eslint/js": "^9.23.0",
2223
"astro": "5.5.4",
2324
"ava": "^6.2.0",

src/content/dungeons.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ export const createTestDungeon = () => {
2222
dungeon.graph[3][0].room = MonsterRoom(Monster({hp: 42, intents}))
2323
return dungeon
2424
}
25-

src/ui/components/splash-screen.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ export default class SplashScreen extends Component {
6969
<ul class="Options">
7070
${location.hash
7171
? html`
72-
<li>Found a saved game. <button autofocus onClick=${this.props.onContinue}>Continue?</button></li>
73-
<li><button onClick=${() => this.props.onNewGame()}>New Game</button></li>
74-
`
72+
<li>
73+
Found a saved game. <button autofocus onClick=${this.props.onContinue}>Continue?</button>
74+
</li>
75+
<li><button onClick=${() => this.props.onNewGame()}>New Game</button></li>
76+
`
7577
: html`
7678
<li><button autofocus onClick=${() => this.props.onNewGame()}>Play</button></li>
7779
<li><button onClick=${this.startDeckSelection}>Custom Game</button></li>

src/ui/styles/app.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,10 @@ h2 {
499499
}
500500

501501
.Form {
502-
:is(p) {
502+
& :is(p) {
503503
font-size: smaller;
504504
}
505-
:is(input) {
505+
& :is(input) {
506506
padding: 0.25rem;
507507
margin-top: 0.25rem;
508508
margin-bottom: 0.25rem;
@@ -511,7 +511,7 @@ h2 {
511511
.Form--vertical {
512512
display: flex;
513513
flex-direction: column;
514-
:is(input) {
514+
& :is(input) {
515515
width: 100%;
516516
}
517517
}

src/ui/styles/card.css

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
justify-content: center;
66
min-height: var(--card-height);
77
}
8+
89
.Cards .Card {
910
width: var(--card-width);
1011
height: var(--card-height);
1112
flex-shrink: 1;
1213
}
14+
1315
.Cards--grid {
1416
flex-wrap: wrap;
1517
gap: 0.5rem;
1618
}
19+
1720
.Cards--mini {
1821
--card-height: 11rem;
1922
/* --card-width: 13rem; */
@@ -22,42 +25,41 @@
2225
/* gap: 0; */
2326
/* grid-template-columns: repeat(auto-fill, minmax(min(var(--column-width), 100%), 1fr)); */
2427

25-
26-
.Card-name {
28+
& .Card-name {
2729
font-size: 1rem;
2830
}
29-
.Card-description {
31+
32+
& .Card-description {
3033
font-size: 0.75rem;
3134
}
3235

33-
.Card-media img {
36+
& .Card-media img {
3437
height: 50px;
3538
}
3639
}
40+
3741
.Cards--withUpgrades {
38-
> div {
42+
&>div {
3943
display: flex;
4044
flex-flow: column wrap;
4145
}
4246

43-
.Card {
44-
height: 100%;
47+
& > div:hover .Card:not([data-card-upgraded]) {
48+
display: none;
4549
}
4650

47-
.Card:not([data-card-upgraded]) {
51+
& > div:hover .Card[data-card-upgraded] {
52+
display: flex;
4853
}
49-
.Card[data-card-upgraded] {
50-
display: none;
54+
55+
& .Card {
56+
height: 100%;
5157
}
5258

53-
> div:hover {
54-
.Card:not([data-card-upgraded]) {
55-
display: none;
56-
}
57-
.Card[data-card-upgraded] {
58-
display: flex;
59-
}
59+
& .Card[data-card-upgraded] {
60+
display: none;
6061
}
62+
6163
}
6264

6365
.Card {
@@ -73,6 +75,7 @@
7375
image-rendering: -moz-crisp-edges;
7476
image-rendering: pixelated;
7577
}
78+
7679
.Card-inner {
7780
width: 100%;
7881
flex: 1;
@@ -82,23 +85,27 @@
8285
color: var(--text);
8386
text-align: center;
8487
}
88+
8589
.Card-media {
8690
margin: 0;
8791
border-bottom: 2px solid #2a3335;
8892
background: #111;
8993
}
94+
9095
.Card-media img {
9196
display: block;
9297
width: 100%;
9398
height: 120px;
9499
object-fit: cover;
95100
object-position: center top;
96101
}
102+
97103
@media (max-height: 500px) {
98104
.Card-media img {
99105
height: 70px;
100106
}
101107
}
108+
102109
.Card-name {
103110
margin: 0.5rem 0;
104111
padding: 0.5rem 0 0.1rem;
@@ -107,6 +114,7 @@
107114
background-image: linear-gradient(to bottom, hsla(0, 0%, 0%, 0.2), transparent); */
108115
user-select: none;
109116
}
117+
110118
.Card-type {
111119
margin: -0.75rem auto 0;
112120
padding: 2px 5px 4px;
@@ -118,9 +126,11 @@
118126
border-bottom-width: 2px;
119127
border-radius: 0.4em;
120128
}
129+
121130
.Card[data-card-type='attack'] .Card-type {
122131
background: hsl(0deg 33% 19%);
123132
}
133+
124134
.Card-description {
125135
font-size: 0.875rem;
126136
padding-left: 0.2em;
@@ -129,6 +139,7 @@
129139
margin: 0;
130140
line-height: 1.2;
131141
}
142+
132143
.Card-energy {
133144
position: absolute;
134145
top: -1.3em;
@@ -139,6 +150,7 @@
139150
box-shadow: none;
140151
border-width: 0.15rem;
141152
}
153+
142154
.Hand .Card[disabled] .EnergyBadge {
143155
color: #fb1515;
144156
background-color: hsl(0deg 73% 25%);
@@ -148,14 +160,14 @@
148160
display: flex;
149161
flex-flow: column;
150162

151-
stw-card + button {
163+
& stw-card+button {
152164
margin: 0 auto;
153165
font-size: 1rem;
154166
position: relative;
155167
top: -1rem;
156168
}
157169

158-
stw-card + button:active:not([disabled]) {
170+
& stw-card+button:active:not([disabled]) {
159171
top: calc(-1rem + 2px);
160172
}
161173
}

0 commit comments

Comments
 (0)