Skip to content

Commit 32852e0

Browse files
authored
Merge pull request #110 from adoxography/feature/case-insensitive-preferred-strategy
Recognize preferredstrategy as preferredStrategy
2 parents 6c8b912 + 1ecf298 commit 32852e0

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {
1111
const { addVariants } = require('./variants');
1212

1313
module.exports = plugin.withOptions((options = {}) => tailwind => {
14-
let preferredStrategy = options.preferredStrategy ?? 'standard';
14+
let preferredStrategy = options.preferredStrategy ?? options.preferredstrategy ?? 'standard';
1515

1616
if (preferredStrategy !== 'standard' && preferredStrategy !== 'pseudoelements') {
1717
// eslint-disable-next-line no-console

test/scrollbar.test.js

+25
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,31 @@ describe('it limits scrollbar properties to Firefox when pseudoelements are pref
192192
}"
193193
`);
194194
});
195+
196+
test('as lowercase', async () => {
197+
const css = await generatePluginCss('scrollbar-none.html', {
198+
pluginOptions: '{ preferredstrategy: "pseudoelements" }'
199+
});
200+
201+
expect(css).toMatchInlineSnapshot(`
202+
".scrollbar-none {
203+
@supports (-moz-appearance:none) {
204+
scrollbar-width: none;
205+
}
206+
&::-webkit-scrollbar {
207+
display: none;
208+
}
209+
}
210+
@layer base {
211+
* {
212+
@supports (-moz-appearance:none) {
213+
scrollbar-color: initial;
214+
scrollbar-width: initial;
215+
}
216+
}
217+
}"
218+
`);
219+
});
195220
});
196221

197222
test('it generates scrollbar track utilities', async () => {

0 commit comments

Comments
 (0)