Skip to content

Commit 9453e16

Browse files
committed
chore: wip
1 parent a75b2cd commit 9453e16

File tree

6 files changed

+909
-1
lines changed

6 files changed

+909
-1
lines changed

packages/headwind/src/config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const defaultConfig: HeadwindConfig = {
9393
peer: true,
9494
before: true,
9595
after: true,
96+
marker: true,
9697
first: true,
9798
last: true,
9899
odd: true,
@@ -103,6 +104,23 @@ export const defaultConfig: HeadwindConfig = {
103104
checked: true,
104105
'focus-within': true,
105106
'focus-visible': true,
107+
placeholder: true,
108+
selection: true,
109+
file: true,
110+
required: true,
111+
valid: true,
112+
invalid: true,
113+
'read-only': true,
114+
autofill: true,
115+
open: true,
116+
closed: true,
117+
empty: true,
118+
enabled: true,
119+
only: true,
120+
target: true,
121+
indeterminate: true,
122+
default: true,
123+
optional: true,
106124
print: true,
107125
rtl: true,
108126
ltr: true,

packages/headwind/src/generator.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,62 @@ export class CSSGenerator {
151151
else if (variant === 'after' && this.config.variants.after) {
152152
selector += '::after'
153153
}
154+
else if (variant === 'marker' && this.config.variants.marker) {
155+
selector += '::marker'
156+
}
157+
else if (variant === 'placeholder' && this.config.variants.placeholder) {
158+
selector += '::placeholder'
159+
}
160+
else if (variant === 'selection' && this.config.variants.selection) {
161+
selector += '::selection'
162+
}
163+
else if (variant === 'file' && this.config.variants.file) {
164+
selector += '::file-selector-button'
165+
}
166+
// Form state pseudo-classes
167+
else if (variant === 'required' && this.config.variants.required) {
168+
selector += ':required'
169+
}
170+
else if (variant === 'valid' && this.config.variants.valid) {
171+
selector += ':valid'
172+
}
173+
else if (variant === 'invalid' && this.config.variants.invalid) {
174+
selector += ':invalid'
175+
}
176+
else if (variant === 'read-only' && this.config.variants['read-only']) {
177+
selector += ':read-only'
178+
}
179+
else if (variant === 'autofill' && this.config.variants.autofill) {
180+
selector += ':autofill'
181+
}
182+
// Additional state pseudo-classes
183+
else if (variant === 'open' && this.config.variants.open) {
184+
selector += '[open]'
185+
}
186+
else if (variant === 'closed' && this.config.variants.closed) {
187+
selector += ':not([open])'
188+
}
189+
else if (variant === 'empty' && this.config.variants.empty) {
190+
selector += ':empty'
191+
}
192+
else if (variant === 'enabled' && this.config.variants.enabled) {
193+
selector += ':enabled'
194+
}
195+
else if (variant === 'only' && this.config.variants.only) {
196+
selector += ':only-child'
197+
}
198+
else if (variant === 'target' && this.config.variants.target) {
199+
selector += ':target'
200+
}
201+
else if (variant === 'indeterminate' && this.config.variants.indeterminate) {
202+
selector += ':indeterminate'
203+
}
204+
else if (variant === 'default' && this.config.variants.default) {
205+
selector += ':default'
206+
}
207+
else if (variant === 'optional' && this.config.variants.optional) {
208+
selector += ':optional'
209+
}
154210
// Group/Peer variants
155211
else if (variant.startsWith('group-') && this.config.variants.group) {
156212
const groupVariant = variant.slice(6) // Remove 'group-'

packages/headwind/src/types.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export interface VariantConfig {
3636
// Pseudo-elements
3737
before: boolean
3838
after: boolean
39-
// Pseudo-classes
39+
marker: boolean
40+
// Pseudo-classes - Basic
4041
first: boolean
4142
last: boolean
4243
odd: boolean
@@ -47,6 +48,25 @@ export interface VariantConfig {
4748
checked: boolean
4849
'focus-within': boolean
4950
'focus-visible': boolean
51+
// Pseudo-classes - Form states
52+
placeholder: boolean
53+
selection: boolean
54+
file: boolean
55+
required: boolean
56+
valid: boolean
57+
invalid: boolean
58+
'read-only': boolean
59+
autofill: boolean
60+
// Pseudo-classes - Additional states
61+
open: boolean
62+
closed: boolean
63+
empty: boolean
64+
enabled: boolean
65+
only: boolean
66+
target: boolean
67+
indeterminate: boolean
68+
default: boolean
69+
optional: boolean
5070
// Media
5171
print: boolean
5272
// Direction

0 commit comments

Comments
 (0)