Skip to content

Commit a4c6d8a

Browse files
chore: wip
1 parent e1e3f4f commit a4c6d8a

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

packages/headwind/src/generator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { CSSRule, HeadwindConfig, ParsedClass } from './types'
2+
import type { UtilityRule } from './rules'
23
import { parseClass } from './parser'
34
import { builtInRules } from './rules'
45

@@ -44,7 +45,9 @@ export class CSSGenerator {
4445
// Merge theme.extend into theme (allows users to add custom values without replacing defaults)
4546
if (config.theme.extend) {
4647
const { extend, ...baseTheme } = this.config.theme
47-
this.config.theme = deepMerge(baseTheme, extend) as typeof this.config.theme
48+
if (extend) {
49+
this.config.theme = deepMerge(baseTheme, extend) as typeof this.config.theme
50+
}
4851
}
4952

5053
// Pre-compile blocklist patterns for performance

packages/headwind/src/rules-layout.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const columnRuleRule: UtilityRule = (parsed, config) => {
9898
'8': '8px',
9999
}
100100
if (widths[parsed.value]) {
101-
return { 'column-rule-width': widths[parsed.value] }
101+
return { 'column-rule-width': widths[parsed.value] } as Record<string, string>
102102
}
103103

104104
// Check for colors
@@ -107,14 +107,14 @@ export const columnRuleRule: UtilityRule = (parsed, config) => {
107107
const [colorName, shade] = parts
108108
const colorValue = config.theme.colors[colorName]
109109
if (typeof colorValue === 'object' && colorValue[shade]) {
110-
return { 'column-rule-color': colorValue[shade] }
110+
return { 'column-rule-color': colorValue[shade] } as Record<string, string>
111111
}
112112
}
113113

114114
// Direct color
115115
const directColor = config.theme.colors[parsed.value]
116116
if (typeof directColor === 'string') {
117-
return { 'column-rule-color': directColor }
117+
return { 'column-rule-color': directColor } as Record<string, string>
118118
}
119119

120120
// Style
@@ -127,7 +127,7 @@ export const columnRuleRule: UtilityRule = (parsed, config) => {
127127
none: 'none',
128128
}
129129
if (styles[parsed.value]) {
130-
return { 'column-rule-style': styles[parsed.value] }
130+
return { 'column-rule-style': styles[parsed.value] } as Record<string, string>
131131
}
132132
}
133133
}

packages/headwind/src/rules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ export const displayRule: UtilityRule = (parsed) => {
2727
export const containerRule: UtilityRule = (parsed) => {
2828
// @container -> container-type: inline-size (most common use case)
2929
if (parsed.utility === '@container') {
30-
return { 'container-type': 'inline-size' }
30+
return { 'container-type': 'inline-size' } as Record<string, string>
3131
}
3232
// @container-normal -> container-type: normal (for size containment without inline-size)
3333
if (parsed.utility === '@container-normal') {
34-
return { 'container-type': 'normal' }
34+
return { 'container-type': 'normal' } as Record<string, string>
3535
}
3636
// @container/name -> container-type: inline-size; container-name: name
3737
if (parsed.utility.startsWith('@container/')) {
3838
const name = parsed.utility.slice(11) // Remove '@container/'
3939
return {
4040
'container-type': 'inline-size',
4141
'container-name': name,
42-
}
42+
} as Record<string, string>
4343
}
4444
}
4545

packages/headwind/src/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Scanner {
1515
constructor(
1616
private patterns: string[],
1717
private transformer: CompileClassTransformer | null | undefined = undefined,
18-
private extractOptions?: ExtractClassesOptions,
18+
private extractOptions: ExtractClassesOptions | undefined = undefined,
1919
) {}
2020

2121
/**

pickier.config.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import type { PickierConfig } from 'pickier'
2-
3-
const config: PickierConfig = {
1+
const config = {
42
verbose: false,
53

64
ignores: [
@@ -10,10 +8,10 @@ const config: PickierConfig = {
108
'docs/**',
119
'packages/*/docs/**',
1210
'*.min.js',
13-
],
11+
] as const,
1412

1513
lint: {
16-
ext: ['.ts', '.js', '.json', '.yaml', '.yml'],
14+
ext: ['.ts', '.js', '.json', '.yaml', '.yml'] as const,
1715
},
1816

1917
format: {

0 commit comments

Comments
 (0)