Skip to content

Commit

Permalink
stringify in user config always wins
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Oct 20, 2022
1 parent f1c81c9 commit 0705e41
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shaggy-chefs-attack.md
@@ -0,0 +1,5 @@
---
'twind': patch
---

stringify in user config always wins
1 change: 1 addition & 0 deletions packages/twind/src/define-config.ts
Expand Up @@ -34,6 +34,7 @@ export function defineConfig<Theme = BaseTheme, Presets extends Preset<any>[] =
darkColor: userConfig.darkColor,
preflight: userConfig.preflight !== false && asArray(userConfig.preflight),
theme: userConfig.theme as TwindConfig<BaseTheme & ExtractThemes<Theme, Presets>>['theme'],
stringify: userConfig.stringify,
} as TwindPresetConfig<Theme>,
])) {
const {
Expand Down
3 changes: 2 additions & 1 deletion packages/twind/src/sheets.ts
@@ -1,3 +1,4 @@
import { warn } from './internal/warn'
import type { Sheet, SheetRule } from './types'
import { asArray, noop } from './utils'

Expand Down Expand Up @@ -59,7 +60,7 @@ export function cssom(element?: CSSStyleSheet | Element | null | false): Sheet<C
// ::-moz-focus-inner
// :-moz-focusring
if (!/:-[mwo]/.test(cssText)) {
console.warn(error, cssText)
warn((error as Error).message, 'TWIND_INVALID_CSS', cssText)
}
}
},
Expand Down

0 comments on commit 0705e41

Please sign in to comment.