This repository was archived by the owner on Dec 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const postcss = require('postcss');
44const tailwindcss = require ( 'tailwindcss' ) ;
55const altPlugin = require ( './index.js' ) ;
66
7- const generatePluginCss = ( variants = [ ] ) => {
7+ const generatePluginCss = ( variants = [ ] , pluginOptions = { } ) => {
88 return postcss (
99 tailwindcss ( {
1010 theme : {
@@ -14,8 +14,8 @@ const generatePluginCss = (variants = []) => {
1414 } ,
1515 corePlugins : false ,
1616 plugins : [
17- altPlugin ( ) ,
18- ( { e , addUtilities } ) => {
17+ altPlugin ( pluginOptions ) ,
18+ ( { addUtilities } ) => {
1919 addUtilities ( {
2020 '.block' : {
2121 'display' : 'block' ,
@@ -227,3 +227,24 @@ test('all variants can be chained with the responsive variant', () => {
227227 ` ) ;
228228 } ) ;
229229} ) ;
230+
231+ test ( 'the alt class name can be customized' , ( ) => {
232+ return generatePluginCss ( [ 'alt' , 'alt-hover' , 'alt-group-focus-within' ] , {
233+ className : 'special' ,
234+ } ) . then ( css => {
235+ expect ( css ) . toMatchCss ( `
236+ .block {
237+ display: block;
238+ }
239+ .special .special\\:block {
240+ display: block;
241+ }
242+ .special .special\\:hover\\:block:hover {
243+ display: block;
244+ }
245+ .special .group:focus-within .special\\:group-focus-within\\:block {
246+ display: block;
247+ }
248+ ` ) ;
249+ } ) ;
250+ } ) ;
You can’t perform that action at this time.
0 commit comments