@@ -6,17 +6,20 @@ const { colors, spacing, borderWidth, borderRadius, outline } = defaultTheme
6
6
7
7
const forms = plugin . withOptions ( function ( options ) {
8
8
return function ( { addBase, theme } ) {
9
- const swap = function ( initial , classes ) {
10
- return options && options . useFormClasses === true ? classes : initial
9
+ const strategy = options && options . strategy === 'class' ? 'class' : 'base'
10
+
11
+ const swap = function ( baseSelectors , classSelectors ) {
12
+ return strategy === 'class' ? classSelectors : baseSelectors
11
13
}
12
14
13
- const baseSelectors =
14
- ( options && options . useFormClasses ) === true
15
- ? '.form-input, .form-textarea, .form-select'
16
- : "[type='text'], [type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select"
15
+ const baseSelectors = {
16
+ class : '.form-input, .form-textarea, .form-select' ,
17
+ base :
18
+ "[type='text'],[type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select" ,
19
+ }
17
20
18
21
addBase ( {
19
- [ baseSelectors ] : {
22
+ [ baseSelectors [ strategy ] ] : {
20
23
appearance : 'none' ,
21
24
'background-color' : '#fff' ,
22
25
'border-color' : theme ( 'colors.gray.500' , colors . gray [ 500 ] ) ,
0 commit comments