[READ-ONLY] Mirror of https://github.com/hacknug/tailwindcss-plugin-utils. A bunch of utilities to help you create and maintain plugins for Tailwind. www.npmjs.com/package/@hacknug/tailwindcss-plugin-utils
0

Configure Feed

Select the types of activity you want to include in your feed.

Remove pluginOptions leftovers in generatePluginCss

Nestor Vera (Aug 1, 2019, 1:53 PM +0200) 343016fe 6e0adb72

+6 -14
+2 -2
src/index.js
··· 90 90 * generatePluginCss() 91 91 * @param {*} tailwindConfig 92 92 * @param {*} testConfig 93 - * @param {*} pluginOptions 94 93 */ 95 94 96 - export const generatePluginCss = (tailwindConfig = {}, testConfig = {}, pluginOptions = {}) => { 95 + // TODO: Allow users to configure what is it that the helper generates aka `@tailwind utilities` 96 + export const generatePluginCss = (tailwindConfig = {}, testConfig = {}) => { 97 97 const customizer = (objValue, srcValue, key) => { 98 98 if (key === 'variants' && _.isArray(objValue) && _.isEmpty(objValue)) { 99 99 return srcValue
+4 -12
src/index.test.js
··· 83 83 describe('generatePluginCss()', () => { 84 84 test('default utilities', () => { 85 85 const testConfig = {} 86 - const pluginOptions = {} 87 - 88 86 const expectedCss = ` 89 87 .col-count-2 { column-count: 2 } 90 88 .col-count-4 { column-count: 4 } ··· 96 94 .col-span-all { column-span: all } 97 95 ` 98 96 99 - return generatePluginCss(tailwindConfig, testConfig, pluginOptions) 97 + return generatePluginCss(tailwindConfig, testConfig) 100 98 .then(css => expect(css).toMatchCss(expectedCss)) 101 99 }) 102 100 test('responsive variants', () => { 103 101 const testConfig = { variants: ['responsive'] } 104 - const pluginOptions = {} 105 - 106 102 const expectedCss = ` 107 103 .col-count-2 { column-count: 2 } 108 104 .col-count-4 { column-count: 4 } ··· 125 121 } 126 122 ` 127 123 128 - return generatePluginCss(tailwindConfig, testConfig, pluginOptions) 124 + return generatePluginCss(tailwindConfig, testConfig) 129 125 .then(css => expect(css).toMatchCss(expectedCss)) 130 126 }) 131 127 test('handles merging configs correctly', () => { ··· 133 129 theme: { screens: { md: '768px' } }, 134 130 variants: ['responsive'], 135 131 } 136 - const pluginOptions = {} 137 - 138 132 const expectedCss = ` 139 133 .col-count-2 { column-count: 2 } 140 134 .col-count-4 { column-count: 4 } ··· 168 162 } 169 163 ` 170 164 171 - return generatePluginCss(tailwindConfig, testConfig, pluginOptions) 165 + return generatePluginCss(tailwindConfig, testConfig) 172 166 .then(css => expect(css).toMatchCss(expectedCss)) 173 167 }) 174 168 test('handles merging mixed `variants`', () => { ··· 179 173 columnSpan: ['responsive'], 180 174 }, 181 175 } 182 - const pluginOptions = {} 183 - 184 176 const expectedCss = ` 185 177 .col-count-2 { column-count: 2 } 186 178 .col-count-4 { column-count: 4 } ··· 203 195 } 204 196 ` 205 197 206 - return generatePluginCss(tailwindConfig, testConfig, pluginOptions) 198 + return generatePluginCss(tailwindConfig, testConfig) 207 199 .then(css => expect(css).toMatchCss(expectedCss)) 208 200 }) 209 201 })