Skip to content

Commit 65738f5

Browse files
authored
Register styles in components layer when using class strategy
Using the `class` strategy makes it work like a collection of form component styles and shouldn't be in the `base` layer. Also addresses tailwindlabs#64.
1 parent cf37807 commit 65738f5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const [baseFontSize, { lineHeight: baseLineHeight }] = defaultTheme.fontSize.bas
55
const { colors, spacing, borderWidth, borderRadius, outline } = defaultTheme
66

77
const forms = plugin.withOptions(function (options = { strategy: 'base' }) {
8-
return function ({ addBase, theme }) {
8+
return function ({ addBase, addComponents, theme }) {
99
const strategy = options.strategy
1010

1111
const rules = [
@@ -249,7 +249,10 @@ const forms = plugin.withOptions(function (options = { strategy: 'base' }) {
249249
},
250250
]
251251

252-
addBase(
252+
({
253+
'base': (rules) => addBase(rules),
254+
'class': (rules) => addComponents(rules)
255+
})[strategy](
253256
rules
254257
.map((rule) => {
255258
if (rule[strategy] === null) {

0 commit comments

Comments
 (0)