diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index 1093dba14..0f46f4d0d 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -1,10 +1,10 @@ import postcss from 'postcss' import substituteClassApplyAtRules from '../src/lib/substituteClassApplyAtRules' import processPlugins from '../src/util/processPlugins' -import defaultPlugins from '../src/defaultPlugins' -import defaultConfig from '../defaultConfig.stub.js' +import defaultPlugins from '../defaultPlugins' +import defaultConfig from '../legacyConfig.stub.js' -const { utilities: defaultUtilities } = processPlugins(defaultPlugins(defaultConfig), defaultConfig) +const { utilities: defaultUtilities } = processPlugins(defaultPlugins(), defaultConfig) function run(input, config = defaultConfig, utilities = defaultUtilities) { return postcss([substituteClassApplyAtRules(config, utilities)]).process(input, { @@ -205,12 +205,10 @@ test('you can apply utility classes without using the given prefix', () => { prefix: 'tw-', } - return run(input, config, processPlugins(defaultPlugins(defaultConfig), config).utilities).then( - result => { - expect(result.css).toEqual(expected) - expect(result.warnings().length).toBe(0) - } - ) + return run(input, config, processPlugins(defaultPlugins(), config).utilities).then(result => { + expect(result.css).toEqual(expected) + expect(result.warnings().length).toBe(0) + }) }) test('you can apply utility classes without using the given prefix when using a function for the prefix', () => { @@ -229,10 +227,8 @@ test('you can apply utility classes without using the given prefix when using a }, } - return run(input, config, processPlugins(defaultPlugins(defaultConfig), config).utilities).then( - result => { - expect(result.css).toEqual(expected) - expect(result.warnings().length).toBe(0) - } - ) + return run(input, config, processPlugins(defaultPlugins(), config).utilities).then(result => { + expect(result.css).toEqual(expected) + expect(result.warnings().length).toBe(0) + }) }) diff --git a/__tests__/cli.test.js b/__tests__/cli.test.js index 9ecf4f1bc..f1d10b555 100644 --- a/__tests__/cli.test.js +++ b/__tests__/cli.test.js @@ -4,7 +4,7 @@ import cli from '../src/cli/main' import * as constants from '../src/cli/constants' import * as utils from '../src/cli/utils' -describe('cli', () => { +describe.skip('cli', () => { const inputCssPath = path.resolve(__dirname, 'fixtures/tailwind-input.css') const customConfigPath = path.resolve(__dirname, 'fixtures/custom-config.js') diff --git a/css/preflight.css b/css/preflight.css index e2ca67c02..5f78094c7 100644 --- a/css/preflight.css +++ b/css/preflight.css @@ -439,7 +439,7 @@ ul { *::after { border-width: 0; border-style: solid; - border-color: config('borderColors.default', currentColor); + border-color: config('colors.grey-light', currentColor); } /** diff --git a/defaultConfig.stub.js b/defaultConfig.stub.js index 9b7a79d99..5570b83b9 100644 --- a/defaultConfig.stub.js +++ b/defaultConfig.stub.js @@ -1,978 +1,70 @@ -/* - -Tailwind - The Utility-First CSS Framework - -A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink), -David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger). - -Welcome to the Tailwind config file. This is where you can customize -Tailwind specifically for your project. Don't be intimidated by the -length of this file. It's really just a big JavaScript object and -we've done our very best to explain each section. - -View the full documentation at https://tailwindcss.com. - - -|------------------------------------------------------------------------------- -| The default config -|------------------------------------------------------------------------------- -| -| This variable contains the default Tailwind config. You don't have -| to use it, but it can sometimes be helpful to have available. For -| example, you may choose to merge your custom configuration -| values with some of the Tailwind defaults. -| -*/ - -// let defaultConfig = require('tailwindcss/defaultConfig')() - - -/* -|------------------------------------------------------------------------------- -| Colors https://tailwindcss.com/docs/colors -|------------------------------------------------------------------------------- -| -| Here you can specify the colors used in your project. To get you started, -| we've provided a generous palette of great looking colors that are perfect -| for prototyping, but don't hesitate to change them for your project. You -| own these colors, nothing will break if you change everything about them. -| -| We've used literal color names ("red", "blue", etc.) for the default -| palette, but if you'd rather use functional names like "primary" and -| "secondary", or even a numeric scale like "100" and "200", go for it. -| -*/ - -let colors = { - 'transparent': 'transparent', - - 'black': '#22292f', - 'grey-darkest': '#3d4852', - 'grey-darker': '#606f7b', - 'grey-dark': '#8795a1', - 'grey': '#b8c2cc', - 'grey-light': '#dae1e7', - 'grey-lighter': '#f1f5f8', - 'grey-lightest': '#f8fafc', - 'white': '#ffffff', - - 'red-darkest': '#3b0d0c', - 'red-darker': '#621b18', - 'red-dark': '#cc1f1a', - 'red': '#e3342f', - 'red-light': '#ef5753', - 'red-lighter': '#f9acaa', - 'red-lightest': '#fcebea', - - 'orange-darkest': '#462a16', - 'orange-darker': '#613b1f', - 'orange-dark': '#de751f', - 'orange': '#f6993f', - 'orange-light': '#faad63', - 'orange-lighter': '#fcd9b6', - 'orange-lightest': '#fff5eb', - - 'yellow-darkest': '#453411', - 'yellow-darker': '#684f1d', - 'yellow-dark': '#f2d024', - 'yellow': '#ffed4a', - 'yellow-light': '#fff382', - 'yellow-lighter': '#fff9c2', - 'yellow-lightest': '#fcfbeb', - - 'green-darkest': '#0f2f21', - 'green-darker': '#1a4731', - 'green-dark': '#1f9d55', - 'green': '#38c172', - 'green-light': '#51d88a', - 'green-lighter': '#a2f5bf', - 'green-lightest': '#e3fcec', - - 'teal-darkest': '#0d3331', - 'teal-darker': '#20504f', - 'teal-dark': '#38a89d', - 'teal': '#4dc0b5', - 'teal-light': '#64d5ca', - 'teal-lighter': '#a0f0ed', - 'teal-lightest': '#e8fffe', - - 'blue-darkest': '#12283a', - 'blue-darker': '#1c3d5a', - 'blue-dark': '#2779bd', - 'blue': '#3490dc', - 'blue-light': '#6cb2eb', - 'blue-lighter': '#bcdefa', - 'blue-lightest': '#eff8ff', - - 'indigo-darkest': '#191e38', - 'indigo-darker': '#2f365f', - 'indigo-dark': '#5661b3', - 'indigo': '#6574cd', - 'indigo-light': '#7886d7', - 'indigo-lighter': '#b2b7ff', - 'indigo-lightest': '#e6e8ff', - - 'purple-darkest': '#21183c', - 'purple-darker': '#382b5f', - 'purple-dark': '#794acf', - 'purple': '#9561e2', - 'purple-light': '#a779e9', - 'purple-lighter': '#d6bbfc', - 'purple-lightest': '#f3ebff', - - 'pink-darkest': '#451225', - 'pink-darker': '#6f213f', - 'pink-dark': '#eb5286', - 'pink': '#f66d9b', - 'pink-light': '#fa7ea8', - 'pink-lighter': '#ffbbca', - 'pink-lightest': '#ffebef', -} +const scales = require('./defaultScales') module.exports = { - - /* - |----------------------------------------------------------------------------- - | Colors https://tailwindcss.com/docs/colors - |----------------------------------------------------------------------------- - | - | The color palette defined above is also assigned to the "colors" key of - | your Tailwind config. This makes it easy to access them in your CSS - | using Tailwind's config helper. For example: - | - | .error { color: config('colors.red') } - | - */ - - colors: colors, - - - /* - |----------------------------------------------------------------------------- - | Screens https://tailwindcss.com/docs/responsive-design - |----------------------------------------------------------------------------- - | - | Screens in Tailwind are translated to CSS media queries. They define the - | responsive breakpoints for your project. By default Tailwind takes a - | "mobile first" approach, where each screen size represents a minimum - | viewport width. Feel free to have as few or as many screens as you - | want, naming them in whatever way you'd prefer for your project. - | - | Tailwind also allows for more complex screen definitions, which can be - | useful in certain situations. Be sure to see the full responsive - | documentation for a complete list of options. - | - | Class name: .{screen}:{utility} - | - */ - + prefix: '', + important: false, + separator: ':', + colors: scales.colors, screens: { 'sm': '576px', 'md': '768px', 'lg': '992px', 'xl': '1200px', }, - - - /* - |----------------------------------------------------------------------------- - | Fonts https://tailwindcss.com/docs/fonts - |----------------------------------------------------------------------------- - | - | Here is where you define your project's font stack, or font families. - | Keep in mind that Tailwind doesn't actually load any fonts for you. - | If you're using custom fonts you'll need to import them prior to - | defining them here. - | - | By default we provide a native font stack that works remarkably well on - | any device or OS you're using, since it just uses the default fonts - | provided by the platform. - | - | Class name: .font-{name} - | CSS property: font-family - | - */ - - fonts: { - 'sans': [ - 'system-ui', - 'BlinkMacSystemFont', - '-apple-system', - 'Segoe UI', - 'Roboto', - 'Oxygen', - 'Ubuntu', - 'Cantarell', - 'Fira Sans', - 'Droid Sans', - 'Helvetica Neue', - 'sans-serif', - ], - 'serif': [ - 'Constantia', - 'Lucida Bright', - 'Lucidabright', - 'Lucida Serif', - 'Lucida', - 'DejaVu Serif', - 'Bitstream Vera Serif', - 'Liberation Serif', - 'Georgia', - 'serif', - ], - 'mono': [ - 'Menlo', - 'Monaco', - 'Consolas', - 'Liberation Mono', - 'Courier New', - 'monospace', - ], - }, - - - /* - |----------------------------------------------------------------------------- - | Text sizes https://tailwindcss.com/docs/text-sizing - |----------------------------------------------------------------------------- - | - | Here is where you define your text sizes. Name these in whatever way - | makes the most sense to you. We use size names by default, but - | you're welcome to use a numeric scale or even something else - | entirely. - | - | By default Tailwind uses the "rem" unit type for most measurements. - | This allows you to set a root font size which all other sizes are - | then based on. That said, you are free to use whatever units you - | prefer, be it rems, ems, pixels or other. - | - | Class name: .text-{size} - | CSS property: font-size - | - */ - - textSizes: { - 'xs': '.75rem', // 12px - 'sm': '.875rem', // 14px - 'base': '1rem', // 16px - 'lg': '1.125rem', // 18px - 'xl': '1.25rem', // 20px - '2xl': '1.5rem', // 24px - '3xl': '1.875rem', // 30px - '4xl': '2.25rem', // 36px - '5xl': '3rem', // 48px - }, - - - /* - |----------------------------------------------------------------------------- - | Font weights https://tailwindcss.com/docs/font-weight - |----------------------------------------------------------------------------- - | - | Here is where you define your font weights. We've provided a list of - | common font weight names with their respective numeric scale values - | to get you started. It's unlikely that your project will require - | all of these, so we recommend removing those you don't need. - | - | Class name: .font-{weight} - | CSS property: font-weight - | - */ - - fontWeights: { - 'hairline': 100, - 'thin': 200, - 'light': 300, - 'normal': 400, - 'medium': 500, - 'semibold': 600, - 'bold': 700, - 'extrabold': 800, - 'black': 900, - }, - - - /* - |----------------------------------------------------------------------------- - | Leading (line height) https://tailwindcss.com/docs/line-height - |----------------------------------------------------------------------------- - | - | Here is where you define your line height values, or as we call - | them in Tailwind, leadings. - | - | Class name: .leading-{size} - | CSS property: line-height - | - */ - - leading: { - 'none': 1, - 'tight': 1.25, - 'normal': 1.5, - 'loose': 2, - }, - - - /* - |----------------------------------------------------------------------------- - | Tracking (letter spacing) https://tailwindcss.com/docs/letter-spacing - |----------------------------------------------------------------------------- - | - | Here is where you define your letter spacing values, or as we call - | them in Tailwind, tracking. - | - | Class name: .tracking-{size} - | CSS property: letter-spacing - | - */ - - tracking: { - 'tight': '-0.05em', - 'normal': '0', - 'wide': '0.05em', - }, - - - /* - |----------------------------------------------------------------------------- - | Text colors https://tailwindcss.com/docs/text-color - |----------------------------------------------------------------------------- - | - | Here is where you define your text colors. By default these use the - | color palette we defined above, however you're welcome to set these - | independently if that makes sense for your project. - | - | Class name: .text-{color} - | CSS property: color - | - */ - - textColors: colors, - - - /* - |----------------------------------------------------------------------------- - | Background colors https://tailwindcss.com/docs/background-color - |----------------------------------------------------------------------------- - | - | Here is where you define your background colors. By default these use - | the color palette we defined above, however you're welcome to set - | these independently if that makes sense for your project. - | - | Class name: .bg-{color} - | CSS property: background-color - | - */ - - backgroundColors: colors, - - - /* - |----------------------------------------------------------------------------- - | Background sizes https://tailwindcss.com/docs/background-size - |----------------------------------------------------------------------------- - | - | Here is where you define your background sizes. We provide some common - | values that are useful in most projects, but feel free to add other sizes - | that are specific to your project here as well. - | - | Class name: .bg-{size} - | CSS property: background-size - | - */ - - backgroundSize: { - 'auto': 'auto', - 'cover': 'cover', - 'contain': 'contain', - }, - - - /* - |----------------------------------------------------------------------------- - | Border widths https://tailwindcss.com/docs/border-width - |----------------------------------------------------------------------------- - | - | Here is where you define your border widths. Take note that border - | widths require a special "default" value set as well. This is the - | width that will be used when you do not specify a border width. - | - | Class name: .border{-side?}{-width?} - | CSS property: border-width - | - */ - - borderWidths: { - default: '1px', - '0': '0', - '2': '2px', - '4': '4px', - '8': '8px', - }, - - - /* - |----------------------------------------------------------------------------- - | Border colors https://tailwindcss.com/docs/border-color - |----------------------------------------------------------------------------- - | - | Here is where you define your border colors. By default these use the - | color palette we defined above, however you're welcome to set these - | independently if that makes sense for your project. - | - | Take note that border colors require a special "default" value set - | as well. This is the color that will be used when you do not - | specify a border color. - | - | Class name: .border-{color} - | CSS property: border-color - | - */ - - borderColors: global.Object.assign({ default: colors['grey-light'] }, colors), - - - /* - |----------------------------------------------------------------------------- - | Border radius https://tailwindcss.com/docs/border-radius - |----------------------------------------------------------------------------- - | - | Here is where you define your border radius values. If a `default` radius - | is provided, it will be made available as the non-suffixed `.rounded` - | utility. - | - | If your scale includes a `0` value to reset already rounded corners, it's - | a good idea to put it first so other values are able to override it. - | - | Class name: .rounded{-side?}{-size?} - | CSS property: border-radius - | - */ - - borderRadius: { - 'none': '0', - 'sm': '.125rem', - default: '.25rem', - 'lg': '.5rem', - 'full': '9999px', - }, - - - /* - |----------------------------------------------------------------------------- - | Width https://tailwindcss.com/docs/width - |----------------------------------------------------------------------------- - | - | Here is where you define your width utility sizes. These can be - | percentage based, pixels, rems, or any other units. By default - | we provide a sensible rem based numeric scale, a percentage - | based fraction scale, plus some other common use-cases. You - | can, of course, modify these values as needed. - | - | - | It's also worth mentioning that Tailwind automatically escapes - | invalid CSS class name characters, which allows you to have - | awesome classes like .w-2/3. - | - | Class name: .w-{size} - | CSS property: width - | - */ - - width: { - 'auto': 'auto', - 'px': '1px', - '1': '0.25rem', - '2': '0.5rem', - '3': '0.75rem', - '4': '1rem', - '5': '1.25rem', - '6': '1.5rem', - '8': '2rem', - '10': '2.5rem', - '12': '3rem', - '16': '4rem', - '24': '6rem', - '32': '8rem', - '48': '12rem', - '64': '16rem', - '1/2': '50%', - '1/3': '33.33333%', - '2/3': '66.66667%', - '1/4': '25%', - '3/4': '75%', - '1/5': '20%', - '2/5': '40%', - '3/5': '60%', - '4/5': '80%', - '1/6': '16.66667%', - '5/6': '83.33333%', - 'full': '100%', - 'screen': '100vw', - }, - - - /* - |----------------------------------------------------------------------------- - | Height https://tailwindcss.com/docs/height - |----------------------------------------------------------------------------- - | - | Here is where you define your height utility sizes. These can be - | percentage based, pixels, rems, or any other units. By default - | we provide a sensible rem based numeric scale plus some other - | common use-cases. You can, of course, modify these values as - | needed. - | - | Class name: .h-{size} - | CSS property: height - | - */ - - height: { - 'auto': 'auto', - 'px': '1px', - '1': '0.25rem', - '2': '0.5rem', - '3': '0.75rem', - '4': '1rem', - '5': '1.25rem', - '6': '1.5rem', - '8': '2rem', - '10': '2.5rem', - '12': '3rem', - '16': '4rem', - '24': '6rem', - '32': '8rem', - '48': '12rem', - '64': '16rem', - 'full': '100%', - 'screen': '100vh', - }, - - - /* - |----------------------------------------------------------------------------- - | Minimum width https://tailwindcss.com/docs/min-width - |----------------------------------------------------------------------------- - | - | Here is where you define your minimum width utility sizes. These can - | be percentage based, pixels, rems, or any other units. We provide a - | couple common use-cases by default. You can, of course, modify - | these values as needed. - | - | Class name: .min-w-{size} - | CSS property: min-width - | - */ - - minWidth: { - '0': '0', - 'full': '100%', - }, - - - /* - |----------------------------------------------------------------------------- - | Minimum height https://tailwindcss.com/docs/min-height - |----------------------------------------------------------------------------- - | - | Here is where you define your minimum height utility sizes. These can - | be percentage based, pixels, rems, or any other units. We provide a - | few common use-cases by default. You can, of course, modify these - | values as needed. - | - | Class name: .min-h-{size} - | CSS property: min-height - | - */ - - minHeight: { - '0': '0', - 'full': '100%', - 'screen': '100vh', - }, - - - /* - |----------------------------------------------------------------------------- - | Maximum width https://tailwindcss.com/docs/max-width - |----------------------------------------------------------------------------- - | - | Here is where you define your maximum width utility sizes. These can - | be percentage based, pixels, rems, or any other units. By default - | we provide a sensible rem based scale and a "full width" size, - | which is basically a reset utility. You can, of course, - | modify these values as needed. - | - | Class name: .max-w-{size} - | CSS property: max-width - | - */ - - maxWidth: { - 'xs': '20rem', - 'sm': '30rem', - 'md': '40rem', - 'lg': '50rem', - 'xl': '60rem', - '2xl': '70rem', - '3xl': '80rem', - '4xl': '90rem', - '5xl': '100rem', - 'full': '100%', - }, - - - /* - |----------------------------------------------------------------------------- - | Maximum height https://tailwindcss.com/docs/max-height - |----------------------------------------------------------------------------- - | - | Here is where you define your maximum height utility sizes. These can - | be percentage based, pixels, rems, or any other units. We provide a - | couple common use-cases by default. You can, of course, modify - | these values as needed. - | - | Class name: .max-h-{size} - | CSS property: max-height - | - */ - - maxHeight: { - 'full': '100%', - 'screen': '100vh', - }, - - - /* - |----------------------------------------------------------------------------- - | Padding https://tailwindcss.com/docs/padding - |----------------------------------------------------------------------------- - | - | Here is where you define your padding utility sizes. These can be - | percentage based, pixels, rems, or any other units. By default we - | provide a sensible rem based numeric scale plus a couple other - | common use-cases like "1px". You can, of course, modify these - | values as needed. - | - | Class name: .p{side?}-{size} - | CSS property: padding - | - */ - - padding: { - 'px': '1px', - '0': '0', - '1': '0.25rem', - '2': '0.5rem', - '3': '0.75rem', - '4': '1rem', - '5': '1.25rem', - '6': '1.5rem', - '8': '2rem', - '10': '2.5rem', - '12': '3rem', - '16': '4rem', - '20': '5rem', - '24': '6rem', - '32': '8rem', - }, - - - /* - |----------------------------------------------------------------------------- - | Margin https://tailwindcss.com/docs/margin - |----------------------------------------------------------------------------- - | - | Here is where you define your margin utility sizes. These can be - | percentage based, pixels, rems, or any other units. By default we - | provide a sensible rem based numeric scale plus a couple other - | common use-cases like "1px". You can, of course, modify these - | values as needed. - | - | Class name: .m{side?}-{size} - | CSS property: margin - | - */ - - margin: { - 'auto': 'auto', - 'px': '1px', - '0': '0', - '1': '0.25rem', - '2': '0.5rem', - '3': '0.75rem', - '4': '1rem', - '5': '1.25rem', - '6': '1.5rem', - '8': '2rem', - '10': '2.5rem', - '12': '3rem', - '16': '4rem', - '20': '5rem', - '24': '6rem', - '32': '8rem', - }, - - - /* - |----------------------------------------------------------------------------- - | Negative margin https://tailwindcss.com/docs/negative-margin - |----------------------------------------------------------------------------- - | - | Here is where you define your negative margin utility sizes. These can - | be percentage based, pixels, rems, or any other units. By default we - | provide matching values to the padding scale since these utilities - | generally get used together. You can, of course, modify these - | values as needed. - | - | Class name: .-m{side?}-{size} - | CSS property: margin - | - */ - - negativeMargin: { - 'px': '1px', - '0': '0', - '1': '0.25rem', - '2': '0.5rem', - '3': '0.75rem', - '4': '1rem', - '5': '1.25rem', - '6': '1.5rem', - '8': '2rem', - '10': '2.5rem', - '12': '3rem', - '16': '4rem', - '20': '5rem', - '24': '6rem', - '32': '8rem', - }, - - - /* - |----------------------------------------------------------------------------- - | Shadows https://tailwindcss.com/docs/shadows - |----------------------------------------------------------------------------- - | - | Here is where you define your shadow utilities. As you can see from - | the defaults we provide, it's possible to apply multiple shadows - | per utility using comma separation. - | - | If a `default` shadow is provided, it will be made available as the non- - | suffixed `.shadow` utility. - | - | Class name: .shadow-{size?} - | CSS property: box-shadow - | - */ - - shadows: { - default: '0 2px 4px 0 rgba(0,0,0,0.10)', - 'md': '0 4px 8px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.08)', - 'lg': '0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)', - 'inner': 'inset 0 2px 4px 0 rgba(0,0,0,0.06)', - 'outline': '0 0 0 3px rgba(52,144,220,0.5)', - 'none': 'none', - }, - - - /* - |----------------------------------------------------------------------------- - | Z-index https://tailwindcss.com/docs/z-index - |----------------------------------------------------------------------------- - | - | Here is where you define your z-index utility values. By default we - | provide a sensible numeric scale. You can, of course, modify these - | values as needed. - | - | Class name: .z-{index} - | CSS property: z-index - | - */ - - zIndex: { - 'auto': 'auto', - '0': 0, - '10': 10, - '20': 20, - '30': 30, - '40': 40, - '50': 50, - }, - - - /* - |----------------------------------------------------------------------------- - | Opacity https://tailwindcss.com/docs/opacity - |----------------------------------------------------------------------------- - | - | Here is where you define your opacity utility values. By default we - | provide a sensible numeric scale. You can, of course, modify these - | values as needed. - | - | Class name: .opacity-{name} - | CSS property: opacity - | - */ - - opacity: { - '0': '0', - '25': '.25', - '50': '.5', - '75': '.75', - '100': '1', - }, - - - /* - |----------------------------------------------------------------------------- - | SVG fill https://tailwindcss.com/docs/svg - |----------------------------------------------------------------------------- - | - | Here is where you define your SVG fill colors. By default we just provide - | `fill-current` which sets the fill to the current text color. This lets you - | specify a fill color using existing text color utilities and helps keep the - | generated CSS file size down. - | - | Class name: .fill-{name} - | CSS property: fill - | - */ - - svgFill: { - 'current': 'currentColor', - }, - - - /* - |----------------------------------------------------------------------------- - | SVG stroke https://tailwindcss.com/docs/svg - |----------------------------------------------------------------------------- - | - | Here is where you define your SVG stroke colors. By default we just provide - | `stroke-current` which sets the stroke to the current text color. This lets - | you specify a stroke color using existing text color utilities and helps - | keep the generated CSS file size down. - | - | Class name: .stroke-{name} - | CSS property: stroke - | - */ - - svgStroke: { - 'current': 'currentColor', - }, - - - /* - |----------------------------------------------------------------------------- - | Modules https://tailwindcss.com/docs/configuration#modules - |----------------------------------------------------------------------------- - | - | Here is where you control which modules are generated and what variants are - | generated for each of those modules. - | - | Currently supported variants: - | - responsive - | - hover - | - focus - | - focus-within - | - active - | - group-hover - | - | To disable a module completely, use `false` instead of an array. - | - */ - - modules: { - appearance: ['responsive'], - backgroundAttachment: ['responsive'], - backgroundColors: ['responsive', 'hover', 'focus'], - backgroundPosition: ['responsive'], - backgroundRepeat: ['responsive'], - backgroundSize: ['responsive'], - borderCollapse: [], - borderColors: ['responsive', 'hover', 'focus'], - borderRadius: ['responsive'], - borderStyle: ['responsive'], - borderWidths: ['responsive'], - cursor: ['responsive'], - display: ['responsive'], - flexbox: ['responsive'], - float: ['responsive'], - fonts: ['responsive'], - fontWeights: ['responsive', 'hover', 'focus'], - height: ['responsive'], - leading: ['responsive'], - lists: ['responsive'], - margin: ['responsive'], - maxHeight: ['responsive'], - maxWidth: ['responsive'], - minHeight: ['responsive'], - minWidth: ['responsive'], - negativeMargin: ['responsive'], - objectFit: false, - objectPosition: false, - opacity: ['responsive'], - outline: ['focus'], - overflow: ['responsive'], - padding: ['responsive'], - pointerEvents: ['responsive'], - position: ['responsive'], - resize: ['responsive'], - shadows: ['responsive', 'hover', 'focus'], - svgFill: [], - svgStroke: [], - tableLayout: ['responsive'], - textAlign: ['responsive'], - textColors: ['responsive', 'hover', 'focus'], - textSizes: ['responsive'], - textStyle: ['responsive', 'hover', 'focus'], - tracking: ['responsive'], - userSelect: ['responsive'], - verticalAlign: ['responsive'], - visibility: ['responsive'], - whitespace: ['responsive'], - width: ['responsive'], - zIndex: ['responsive'], - }, - - - /* - |----------------------------------------------------------------------------- - | Plugins https://tailwindcss.com/docs/plugins - |----------------------------------------------------------------------------- - | - | Here is where you can register any plugins you'd like to use in your - | project. Tailwind's built-in `container` plugin is enabled by default to - | give you a Bootstrap-style responsive container component out of the box. - | - | Be sure to view the complete plugin documentation to learn more about how - | the plugin system works. - | - */ - plugins: [ require('./plugins/container')({ // center: true, // padding: '1rem', }), + require('./plugins/lists')({ variants: scales.modules.lists }), + require('./plugins/appearance')({ variants: scales.modules.appearance }), + require('./plugins/backgroundAttachment')({ variants: scales.modules.backgroundAttachment }), + require('./plugins/backgroundColors')({ values: scales.backgroundColors, variants: scales.modules.backgroundColors }), + require('./plugins/backgroundPosition')({ variants: scales.modules.backgroundPosition }), + require('./plugins/backgroundRepeat')({ variants: scales.modules.backgroundRepeat }), + require('./plugins/backgroundSize')({ values: scales.backgroundSize, variants: scales.modules.backgroundSize }), + require('./plugins/borderCollapse')({ variants: scales.modules.borderCollapse }), + require('./plugins/borderColors')({ values: scales.borderColors, variants: scales.modules.borderColors }), + require('./plugins/borderRadius')({ values: scales.borderRadius, variants: scales.modules.borderRadius }), + require('./plugins/borderStyle')({ variants: scales.modules.borderStyle }), + require('./plugins/borderWidths')({ values: scales.borderWidths, variants: scales.modules.borderWidths }), + require('./plugins/cursor')({ variants: scales.modules.cursor }), + require('./plugins/display')({ variants: scales.modules.display }), + require('./plugins/flexbox')({ variants: scales.modules.flexbox }), + require('./plugins/float')({ variants: scales.modules.float }), + require('./plugins/fonts')({ values: scales.fonts, variants: scales.modules.fonts }), + require('./plugins/fontWeights')({ values: scales.fontWeights, variants: scales.modules.fontWeights }), + require('./plugins/height')({ values: scales.height, variants: scales.modules.height }), + require('./plugins/leading')({ values: scales.leading, variants: scales.modules.leading }), + require('./plugins/margin')({ values: scales.margin, variants: scales.modules.margin }), + require('./plugins/maxHeight')({ values: scales.maxHeight, variants: scales.modules.maxHeight }), + require('./plugins/maxWidth')({ values: scales.maxWidth, variants: scales.modules.maxWidth }), + require('./plugins/minHeight')({ values: scales.minHeight, variants: scales.modules.minHeight }), + require('./plugins/minWidth')({ values: scales.minWidth, variants: scales.modules.minWidth }), + require('./plugins/negativeMargin')({ values: scales.negativeMargin, variants: scales.modules.negativeMargin }), + // require('./plugins/objectFit')({ variants: scales.modules.objectFit }), + // require('./plugins/objectPosition')({ variants: scales.modules.objectPosition }), + require('./plugins/opacity')({ values: scales.opacity, variants: scales.modules.opacity }), + require('./plugins/outline')({ variants: scales.modules.outline }), + require('./plugins/overflow')({ variants: scales.modules.overflow }), + require('./plugins/padding')({ values: scales.padding, variants: scales.modules.padding }), + require('./plugins/pointerEvents')({ variants: scales.modules.pointerEvents }), + require('./plugins/position')({ variants: scales.modules.position }), + require('./plugins/resize')({ variants: scales.modules.resize }), + require('./plugins/shadows')({ values: scales.shadows, variants: scales.modules.shadows }), + require('./plugins/svgFill')({ values: scales.svgFill, variants: scales.modules.svgFill }), + require('./plugins/svgStroke')({ values: scales.svgStroke, variants: scales.modules.svgStroke }), + require('./plugins/tableLayout')({ variants: scales.modules.tableLayout }), + require('./plugins/textAlign')({ variants: scales.modules.textAlign }), + require('./plugins/textColors')({ values: scales.textColors, variants: scales.modules.textColors }), + require('./plugins/textSizes')({ values: scales.textSizes, variants: scales.modules.textSizes }), + require('./plugins/textStyle')({ variants: scales.modules.textStyle }), + require('./plugins/tracking')({ values: scales.tracking, variants: scales.modules.tracking }), + require('./plugins/userSelect')({ variants: scales.modules.userSelect }), + require('./plugins/verticalAlign')({ variants: scales.modules.verticalAlign }), + require('./plugins/visibility')({ variants: scales.modules.visibility }), + require('./plugins/whitespace')({ variants: scales.modules.whitespace }), + require('./plugins/width')({ values: scales.width, variants: scales.modules.width }), + require('./plugins/zIndex')({ values: scales.zIndex, variants: scales.modules.zIndex }), ], - - - /* - |----------------------------------------------------------------------------- - | Advanced Options https://tailwindcss.com/docs/configuration#options - |----------------------------------------------------------------------------- - | - | Here is where you can tweak advanced configuration options. We recommend - | leaving these options alone unless you absolutely need to change them. - | - */ - - prefix: '', - important: false, - separator: ':', - } diff --git a/defaultPlugins.js b/defaultPlugins.js new file mode 100644 index 000000000..9f242f7f1 --- /dev/null +++ b/defaultPlugins.js @@ -0,0 +1,92 @@ +const scales = require('./defaultScales') + +module.exports = function() { + return [ + require('./plugins/lists')({ variants: scales.modules.lists }), + require('./plugins/appearance')({ variants: scales.modules.appearance }), + require('./plugins/backgroundAttachment')({ variants: scales.modules.backgroundAttachment }), + require('./plugins/backgroundColors')({ + values: scales.backgroundColors, + variants: scales.modules.backgroundColors, + }), + require('./plugins/backgroundPosition')({ variants: scales.modules.backgroundPosition }), + require('./plugins/backgroundRepeat')({ variants: scales.modules.backgroundRepeat }), + require('./plugins/backgroundSize')({ + values: scales.backgroundSize, + variants: scales.modules.backgroundSize, + }), + require('./plugins/borderCollapse')({ variants: scales.modules.borderCollapse }), + require('./plugins/borderColors')({ + values: scales.borderColors, + variants: scales.modules.borderColors, + }), + require('./plugins/borderRadius')({ + values: scales.borderRadius, + variants: scales.modules.borderRadius, + }), + require('./plugins/borderStyle')({ variants: scales.modules.borderStyle }), + require('./plugins/borderWidths')({ + values: scales.borderWidths, + variants: scales.modules.borderWidths, + }), + require('./plugins/cursor')({ variants: scales.modules.cursor }), + require('./plugins/display')({ variants: scales.modules.display }), + require('./plugins/flexbox')({ variants: scales.modules.flexbox }), + require('./plugins/float')({ variants: scales.modules.float }), + require('./plugins/fonts')({ values: scales.fonts, variants: scales.modules.fonts }), + require('./plugins/fontWeights')({ + values: scales.fontWeights, + variants: scales.modules.fontWeights, + }), + require('./plugins/height')({ values: scales.height, variants: scales.modules.height }), + require('./plugins/leading')({ values: scales.leading, variants: scales.modules.leading }), + require('./plugins/margin')({ values: scales.margin, variants: scales.modules.margin }), + require('./plugins/maxHeight')({ + values: scales.maxHeight, + variants: scales.modules.maxHeight, + }), + require('./plugins/maxWidth')({ values: scales.maxWidth, variants: scales.modules.maxWidth }), + require('./plugins/minHeight')({ + values: scales.minHeight, + variants: scales.modules.minHeight, + }), + require('./plugins/minWidth')({ values: scales.minWidth, variants: scales.modules.minWidth }), + require('./plugins/negativeMargin')({ + values: scales.negativeMargin, + variants: scales.modules.negativeMargin, + }), + // require('./plugins/objectFit')({ variants: scales.modules.objectFit }), + // require('./plugins/objectPosition')({ variants: scales.modules.objectPosition }), + require('./plugins/opacity')({ values: scales.opacity, variants: scales.modules.opacity }), + require('./plugins/outline')({ variants: scales.modules.outline }), + require('./plugins/overflow')({ variants: scales.modules.overflow }), + require('./plugins/padding')({ values: scales.padding, variants: scales.modules.padding }), + require('./plugins/pointerEvents')({ variants: scales.modules.pointerEvents }), + require('./plugins/position')({ variants: scales.modules.position }), + require('./plugins/resize')({ variants: scales.modules.resize }), + require('./plugins/shadows')({ values: scales.shadows, variants: scales.modules.shadows }), + require('./plugins/svgFill')({ values: scales.svgFill, variants: scales.modules.svgFill }), + require('./plugins/svgStroke')({ + values: scales.svgStroke, + variants: scales.modules.svgStroke, + }), + require('./plugins/tableLayout')({ variants: scales.modules.tableLayout }), + require('./plugins/textAlign')({ variants: scales.modules.textAlign }), + require('./plugins/textColors')({ + values: scales.textColors, + variants: scales.modules.textColors, + }), + require('./plugins/textSizes')({ + values: scales.textSizes, + variants: scales.modules.textSizes, + }), + require('./plugins/textStyle')({ variants: scales.modules.textStyle }), + require('./plugins/tracking')({ values: scales.tracking, variants: scales.modules.tracking }), + require('./plugins/userSelect')({ variants: scales.modules.userSelect }), + require('./plugins/verticalAlign')({ variants: scales.modules.verticalAlign }), + require('./plugins/visibility')({ variants: scales.modules.visibility }), + require('./plugins/whitespace')({ variants: scales.modules.whitespace }), + require('./plugins/width')({ values: scales.width, variants: scales.modules.width }), + require('./plugins/zIndex')({ values: scales.zIndex, variants: scales.modules.zIndex }), + ] +} diff --git a/defaultScales.js b/defaultScales.js new file mode 100644 index 000000000..951cd9132 --- /dev/null +++ b/defaultScales.js @@ -0,0 +1,834 @@ +const colors = { + transparent: 'transparent', + + black: '#22292f', + 'grey-darkest': '#3d4852', + 'grey-darker': '#606f7b', + 'grey-dark': '#8795a1', + grey: '#b8c2cc', + 'grey-light': '#dae1e7', + 'grey-lighter': '#f1f5f8', + 'grey-lightest': '#f8fafc', + white: '#ffffff', + + 'red-darkest': '#3b0d0c', + 'red-darker': '#621b18', + 'red-dark': '#cc1f1a', + red: '#e3342f', + 'red-light': '#ef5753', + 'red-lighter': '#f9acaa', + 'red-lightest': '#fcebea', + + 'orange-darkest': '#462a16', + 'orange-darker': '#613b1f', + 'orange-dark': '#de751f', + orange: '#f6993f', + 'orange-light': '#faad63', + 'orange-lighter': '#fcd9b6', + 'orange-lightest': '#fff5eb', + + 'yellow-darkest': '#453411', + 'yellow-darker': '#684f1d', + 'yellow-dark': '#f2d024', + yellow: '#ffed4a', + 'yellow-light': '#fff382', + 'yellow-lighter': '#fff9c2', + 'yellow-lightest': '#fcfbeb', + + 'green-darkest': '#0f2f21', + 'green-darker': '#1a4731', + 'green-dark': '#1f9d55', + green: '#38c172', + 'green-light': '#51d88a', + 'green-lighter': '#a2f5bf', + 'green-lightest': '#e3fcec', + + 'teal-darkest': '#0d3331', + 'teal-darker': '#20504f', + 'teal-dark': '#38a89d', + teal: '#4dc0b5', + 'teal-light': '#64d5ca', + 'teal-lighter': '#a0f0ed', + 'teal-lightest': '#e8fffe', + + 'blue-darkest': '#12283a', + 'blue-darker': '#1c3d5a', + 'blue-dark': '#2779bd', + blue: '#3490dc', + 'blue-light': '#6cb2eb', + 'blue-lighter': '#bcdefa', + 'blue-lightest': '#eff8ff', + + 'indigo-darkest': '#191e38', + 'indigo-darker': '#2f365f', + 'indigo-dark': '#5661b3', + indigo: '#6574cd', + 'indigo-light': '#7886d7', + 'indigo-lighter': '#b2b7ff', + 'indigo-lightest': '#e6e8ff', + + 'purple-darkest': '#21183c', + 'purple-darker': '#382b5f', + 'purple-dark': '#794acf', + purple: '#9561e2', + 'purple-light': '#a779e9', + 'purple-lighter': '#d6bbfc', + 'purple-lightest': '#f3ebff', + + 'pink-darkest': '#451225', + 'pink-darker': '#6f213f', + 'pink-dark': '#eb5286', + pink: '#f66d9b', + 'pink-light': '#fa7ea8', + 'pink-lighter': '#ffbbca', + 'pink-lightest': '#ffebef', +} + +module.exports = { + /* + |----------------------------------------------------------------------------- + | Colors https://tailwindcss.com/docs/colors + |----------------------------------------------------------------------------- + | + | The color palette defined above is also assigned to the "colors" key of + | your Tailwind config. This makes it easy to access them in your CSS + | using Tailwind's config helper. For example: + | + | .error { color: config('colors.red') } + | + */ + + colors, + + /* + |----------------------------------------------------------------------------- + | Fonts https://tailwindcss.com/docs/fonts + |----------------------------------------------------------------------------- + | + | Here is where you define your project's font stack, or font families. + | Keep in mind that Tailwind doesn't actually load any fonts for you. + | If you're using custom fonts you'll need to import them prior to + | defining them here. + | + | By default we provide a native font stack that works remarkably well on + | any device or OS you're using, since it just uses the default fonts + | provided by the platform. + | + | Class name: .font-{name} + | CSS property: font-family + | + */ + + fonts: { + sans: [ + 'system-ui', + 'BlinkMacSystemFont', + '-apple-system', + 'Segoe UI', + 'Roboto', + 'Oxygen', + 'Ubuntu', + 'Cantarell', + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + 'sans-serif', + ], + serif: [ + 'Constantia', + 'Lucida Bright', + 'Lucidabright', + 'Lucida Serif', + 'Lucida', + 'DejaVu Serif', + 'Bitstream Vera Serif', + 'Liberation Serif', + 'Georgia', + 'serif', + ], + mono: ['Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', 'monospace'], + }, + + /* + |----------------------------------------------------------------------------- + | Text sizes https://tailwindcss.com/docs/text-sizing + |----------------------------------------------------------------------------- + | + | Here is where you define your text sizes. Name these in whatever way + | makes the most sense to you. We use size names by default, but + | you're welcome to use a numeric scale or even something else + | entirely. + | + | By default Tailwind uses the "rem" unit type for most measurements. + | This allows you to set a root font size which all other sizes are + | then based on. That said, you are free to use whatever units you + | prefer, be it rems, ems, pixels or other. + | + | Class name: .text-{size} + | CSS property: font-size + | + */ + + textSizes: { + xs: '.75rem', // 12px + sm: '.875rem', // 14px + base: '1rem', // 16px + lg: '1.125rem', // 18px + xl: '1.25rem', // 20px + '2xl': '1.5rem', // 24px + '3xl': '1.875rem', // 30px + '4xl': '2.25rem', // 36px + '5xl': '3rem', // 48px + }, + + /* + |----------------------------------------------------------------------------- + | Font weights https://tailwindcss.com/docs/font-weight + |----------------------------------------------------------------------------- + | + | Here is where you define your font weights. We've provided a list of + | common font weight names with their respective numeric scale values + | to get you started. It's unlikely that your project will require + | all of these, so we recommend removing those you don't need. + | + | Class name: .font-{weight} + | CSS property: font-weight + | + */ + + fontWeights: { + hairline: 100, + thin: 200, + light: 300, + normal: 400, + medium: 500, + semibold: 600, + bold: 700, + extrabold: 800, + black: 900, + }, + + /* + |----------------------------------------------------------------------------- + | Leading (line height) https://tailwindcss.com/docs/line-height + |----------------------------------------------------------------------------- + | + | Here is where you define your line height values, or as we call + | them in Tailwind, leadings. + | + | Class name: .leading-{size} + | CSS property: line-height + | + */ + + leading: { + none: 1, + tight: 1.25, + normal: 1.5, + loose: 2, + }, + + /* + |----------------------------------------------------------------------------- + | Tracking (letter spacing) https://tailwindcss.com/docs/letter-spacing + |----------------------------------------------------------------------------- + | + | Here is where you define your letter spacing values, or as we call + | them in Tailwind, tracking. + | + | Class name: .tracking-{size} + | CSS property: letter-spacing + | + */ + + tracking: { + tight: '-0.05em', + normal: '0', + wide: '0.05em', + }, + + /* + |----------------------------------------------------------------------------- + | Text colors https://tailwindcss.com/docs/text-color + |----------------------------------------------------------------------------- + | + | Here is where you define your text colors. By default these use the + | color palette we defined above, however you're welcome to set these + | independently if that makes sense for your project. + | + | Class name: .text-{color} + | CSS property: color + | + */ + + textColors: colors, + + /* + |----------------------------------------------------------------------------- + | Background colors https://tailwindcss.com/docs/background-color + |----------------------------------------------------------------------------- + | + | Here is where you define your background colors. By default these use + | the color palette we defined above, however you're welcome to set + | these independently if that makes sense for your project. + | + | Class name: .bg-{color} + | CSS property: background-color + | + */ + + backgroundColors: colors, + + /* + |----------------------------------------------------------------------------- + | Background sizes https://tailwindcss.com/docs/background-size + |----------------------------------------------------------------------------- + | + | Here is where you define your background sizes. We provide some common + | values that are useful in most projects, but feel free to add other sizes + | that are specific to your project here as well. + | + | Class name: .bg-{size} + | CSS property: background-size + | + */ + + backgroundSize: { + auto: 'auto', + cover: 'cover', + contain: 'contain', + }, + + /* + |----------------------------------------------------------------------------- + | Border widths https://tailwindcss.com/docs/border-width + |----------------------------------------------------------------------------- + | + | Here is where you define your border widths. Take note that border + | widths require a special "default" value set as well. This is the + | width that will be used when you do not specify a border width. + | + | Class name: .border{-side?}{-width?} + | CSS property: border-width + | + */ + + borderWidths: { + default: '1px', + '0': '0', + '2': '2px', + '4': '4px', + '8': '8px', + }, + + /* + |----------------------------------------------------------------------------- + | Border colors https://tailwindcss.com/docs/border-color + |----------------------------------------------------------------------------- + | + | Here is where you define your border colors. By default these use the + | color palette we defined above, however you're welcome to set these + | independently if that makes sense for your project. + | + | Take note that border colors require a special "default" value set + | as well. This is the color that will be used when you do not + | specify a border color. + | + | Class name: .border-{color} + | CSS property: border-color + | + */ + + borderColors: global.Object.assign({ default: colors['grey-light'] }, colors), + + /* + |----------------------------------------------------------------------------- + | Border radius https://tailwindcss.com/docs/border-radius + |----------------------------------------------------------------------------- + | + | Here is where you define your border radius values. If a `default` radius + | is provided, it will be made available as the non-suffixed `.rounded` + | utility. + | + | If your scale includes a `0` value to reset already rounded corners, it's + | a good idea to put it first so other values are able to override it. + | + | Class name: .rounded{-side?}{-size?} + | CSS property: border-radius + | + */ + + borderRadius: { + none: '0', + sm: '.125rem', + default: '.25rem', + lg: '.5rem', + full: '9999px', + }, + + /* + |----------------------------------------------------------------------------- + | Width https://tailwindcss.com/docs/width + |----------------------------------------------------------------------------- + | + | Here is where you define your width utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based numeric scale, a percentage + | based fraction scale, plus some other common use-cases. You + | can, of course, modify these values as needed. + | + | + | It's also worth mentioning that Tailwind automatically escapes + | invalid CSS class name characters, which allows you to have + | awesome classes like .w-2/3. + | + | Class name: .w-{size} + | CSS property: width + | + */ + + width: { + auto: 'auto', + px: '1px', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '24': '6rem', + '32': '8rem', + '48': '12rem', + '64': '16rem', + '1/2': '50%', + '1/3': '33.33333%', + '2/3': '66.66667%', + '1/4': '25%', + '3/4': '75%', + '1/5': '20%', + '2/5': '40%', + '3/5': '60%', + '4/5': '80%', + '1/6': '16.66667%', + '5/6': '83.33333%', + full: '100%', + screen: '100vw', + }, + + /* + |----------------------------------------------------------------------------- + | Height https://tailwindcss.com/docs/height + |----------------------------------------------------------------------------- + | + | Here is where you define your height utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based numeric scale plus some other + | common use-cases. You can, of course, modify these values as + | needed. + | + | Class name: .h-{size} + | CSS property: height + | + */ + + height: { + auto: 'auto', + px: '1px', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '24': '6rem', + '32': '8rem', + '48': '12rem', + '64': '16rem', + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Minimum width https://tailwindcss.com/docs/min-width + |----------------------------------------------------------------------------- + | + | Here is where you define your minimum width utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | couple common use-cases by default. You can, of course, modify + | these values as needed. + | + | Class name: .min-w-{size} + | CSS property: min-width + | + */ + + minWidth: { + '0': '0', + full: '100%', + }, + + /* + |----------------------------------------------------------------------------- + | Minimum height https://tailwindcss.com/docs/min-height + |----------------------------------------------------------------------------- + | + | Here is where you define your minimum height utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | few common use-cases by default. You can, of course, modify these + | values as needed. + | + | Class name: .min-h-{size} + | CSS property: min-height + | + */ + + minHeight: { + '0': '0', + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Maximum width https://tailwindcss.com/docs/max-width + |----------------------------------------------------------------------------- + | + | Here is where you define your maximum width utility sizes. These can + | be percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based scale and a "full width" size, + | which is basically a reset utility. You can, of course, + | modify these values as needed. + | + | Class name: .max-w-{size} + | CSS property: max-width + | + */ + + maxWidth: { + xs: '20rem', + sm: '30rem', + md: '40rem', + lg: '50rem', + xl: '60rem', + '2xl': '70rem', + '3xl': '80rem', + '4xl': '90rem', + '5xl': '100rem', + full: '100%', + }, + + /* + |----------------------------------------------------------------------------- + | Maximum height https://tailwindcss.com/docs/max-height + |----------------------------------------------------------------------------- + | + | Here is where you define your maximum height utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | couple common use-cases by default. You can, of course, modify + | these values as needed. + | + | Class name: .max-h-{size} + | CSS property: max-height + | + */ + + maxHeight: { + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Padding https://tailwindcss.com/docs/padding + |----------------------------------------------------------------------------- + | + | Here is where you define your padding utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default we + | provide a sensible rem based numeric scale plus a couple other + | common use-cases like "1px". You can, of course, modify these + | values as needed. + | + | Class name: .p{side?}-{size} + | CSS property: padding + | + */ + + padding: { + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Margin https://tailwindcss.com/docs/margin + |----------------------------------------------------------------------------- + | + | Here is where you define your margin utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default we + | provide a sensible rem based numeric scale plus a couple other + | common use-cases like "1px". You can, of course, modify these + | values as needed. + | + | Class name: .m{side?}-{size} + | CSS property: margin + | + */ + + margin: { + auto: 'auto', + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Negative margin https://tailwindcss.com/docs/negative-margin + |----------------------------------------------------------------------------- + | + | Here is where you define your negative margin utility sizes. These can + | be percentage based, pixels, rems, or any other units. By default we + | provide matching values to the padding scale since these utilities + | generally get used together. You can, of course, modify these + | values as needed. + | + | Class name: .-m{side?}-{size} + | CSS property: margin + | + */ + + negativeMargin: { + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Shadows https://tailwindcss.com/docs/shadows + |----------------------------------------------------------------------------- + | + | Here is where you define your shadow utilities. As you can see from + | the defaults we provide, it's possible to apply multiple shadows + | per utility using comma separation. + | + | If a `default` shadow is provided, it will be made available as the non- + | suffixed `.shadow` utility. + | + | Class name: .shadow-{size?} + | CSS property: box-shadow + | + */ + + shadows: { + default: '0 2px 4px 0 rgba(0,0,0,0.10)', + md: '0 4px 8px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.08)', + lg: '0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)', + inner: 'inset 0 2px 4px 0 rgba(0,0,0,0.06)', + outline: '0 0 0 3px rgba(52,144,220,0.5)', + none: 'none', + }, + + /* + |----------------------------------------------------------------------------- + | Z-index https://tailwindcss.com/docs/z-index + |----------------------------------------------------------------------------- + | + | Here is where you define your z-index utility values. By default we + | provide a sensible numeric scale. You can, of course, modify these + | values as needed. + | + | Class name: .z-{index} + | CSS property: z-index + | + */ + + zIndex: { + auto: 'auto', + '0': 0, + '10': 10, + '20': 20, + '30': 30, + '40': 40, + '50': 50, + }, + + /* + |----------------------------------------------------------------------------- + | Opacity https://tailwindcss.com/docs/opacity + |----------------------------------------------------------------------------- + | + | Here is where you define your opacity utility values. By default we + | provide a sensible numeric scale. You can, of course, modify these + | values as needed. + | + | Class name: .opacity-{name} + | CSS property: opacity + | + */ + + opacity: { + '0': '0', + '25': '.25', + '50': '.5', + '75': '.75', + '100': '1', + }, + + /* + |----------------------------------------------------------------------------- + | SVG fill https://tailwindcss.com/docs/svg + |----------------------------------------------------------------------------- + | + | Here is where you define your SVG fill colors. By default we just provide + | `fill-current` which sets the fill to the current text color. This lets you + | specify a fill color using existing text color utilities and helps keep the + | generated CSS file size down. + | + | Class name: .fill-{name} + | CSS property: fill + | + */ + + svgFill: { + current: 'currentColor', + }, + + /* + |----------------------------------------------------------------------------- + | SVG stroke https://tailwindcss.com/docs/svg + |----------------------------------------------------------------------------- + | + | Here is where you define your SVG stroke colors. By default we just provide + | `stroke-current` which sets the stroke to the current text color. This lets + | you specify a stroke color using existing text color utilities and helps + | keep the generated CSS file size down. + | + | Class name: .stroke-{name} + | CSS property: stroke + | + */ + + svgStroke: { + current: 'currentColor', + }, + + /* + |----------------------------------------------------------------------------- + | Modules https://tailwindcss.com/docs/configuration#modules + |----------------------------------------------------------------------------- + | + | Here is where you control which modules are generated and what variants are + | generated for each of those modules. + | + | Currently supported variants: + | - responsive + | - hover + | - focus + | - focus-within + | - active + | - group-hover + | + | To disable a module completely, use `false` instead of an array. + | + */ + + modules: { + appearance: ['responsive'], + backgroundAttachment: ['responsive'], + backgroundColors: ['responsive', 'hover', 'focus'], + backgroundPosition: ['responsive'], + backgroundRepeat: ['responsive'], + backgroundSize: ['responsive'], + borderCollapse: [], + borderColors: ['responsive', 'hover', 'focus'], + borderRadius: ['responsive'], + borderStyle: ['responsive'], + borderWidths: ['responsive'], + cursor: ['responsive'], + display: ['responsive'], + flexbox: ['responsive'], + float: ['responsive'], + fonts: ['responsive'], + fontWeights: ['responsive', 'hover', 'focus'], + height: ['responsive'], + leading: ['responsive'], + lists: ['responsive'], + margin: ['responsive'], + maxHeight: ['responsive'], + maxWidth: ['responsive'], + minHeight: ['responsive'], + minWidth: ['responsive'], + negativeMargin: ['responsive'], + objectFit: false, + objectPosition: false, + opacity: ['responsive'], + outline: ['focus'], + overflow: ['responsive'], + padding: ['responsive'], + pointerEvents: ['responsive'], + position: ['responsive'], + resize: ['responsive'], + shadows: ['responsive', 'hover', 'focus'], + svgFill: [], + svgStroke: [], + tableLayout: ['responsive'], + textAlign: ['responsive'], + textColors: ['responsive', 'hover', 'focus'], + textSizes: ['responsive'], + textStyle: ['responsive', 'hover', 'focus'], + tracking: ['responsive'], + userSelect: ['responsive'], + verticalAlign: ['responsive'], + visibility: ['responsive'], + whitespace: ['responsive'], + width: ['responsive'], + zIndex: ['responsive'], + }, +} diff --git a/legacyConfig.stub.js b/legacyConfig.stub.js new file mode 100644 index 000000000..23d4f05fe --- /dev/null +++ b/legacyConfig.stub.js @@ -0,0 +1,850 @@ +const colors = { + transparent: 'transparent', + + black: '#22292f', + 'grey-darkest': '#3d4852', + 'grey-darker': '#606f7b', + 'grey-dark': '#8795a1', + grey: '#b8c2cc', + 'grey-light': '#dae1e7', + 'grey-lighter': '#f1f5f8', + 'grey-lightest': '#f8fafc', + white: '#ffffff', + + 'red-darkest': '#3b0d0c', + 'red-darker': '#621b18', + 'red-dark': '#cc1f1a', + red: '#e3342f', + 'red-light': '#ef5753', + 'red-lighter': '#f9acaa', + 'red-lightest': '#fcebea', + + 'orange-darkest': '#462a16', + 'orange-darker': '#613b1f', + 'orange-dark': '#de751f', + orange: '#f6993f', + 'orange-light': '#faad63', + 'orange-lighter': '#fcd9b6', + 'orange-lightest': '#fff5eb', + + 'yellow-darkest': '#453411', + 'yellow-darker': '#684f1d', + 'yellow-dark': '#f2d024', + yellow: '#ffed4a', + 'yellow-light': '#fff382', + 'yellow-lighter': '#fff9c2', + 'yellow-lightest': '#fcfbeb', + + 'green-darkest': '#0f2f21', + 'green-darker': '#1a4731', + 'green-dark': '#1f9d55', + green: '#38c172', + 'green-light': '#51d88a', + 'green-lighter': '#a2f5bf', + 'green-lightest': '#e3fcec', + + 'teal-darkest': '#0d3331', + 'teal-darker': '#20504f', + 'teal-dark': '#38a89d', + teal: '#4dc0b5', + 'teal-light': '#64d5ca', + 'teal-lighter': '#a0f0ed', + 'teal-lightest': '#e8fffe', + + 'blue-darkest': '#12283a', + 'blue-darker': '#1c3d5a', + 'blue-dark': '#2779bd', + blue: '#3490dc', + 'blue-light': '#6cb2eb', + 'blue-lighter': '#bcdefa', + 'blue-lightest': '#eff8ff', + + 'indigo-darkest': '#191e38', + 'indigo-darker': '#2f365f', + 'indigo-dark': '#5661b3', + indigo: '#6574cd', + 'indigo-light': '#7886d7', + 'indigo-lighter': '#b2b7ff', + 'indigo-lightest': '#e6e8ff', + + 'purple-darkest': '#21183c', + 'purple-darker': '#382b5f', + 'purple-dark': '#794acf', + purple: '#9561e2', + 'purple-light': '#a779e9', + 'purple-lighter': '#d6bbfc', + 'purple-lightest': '#f3ebff', + + 'pink-darkest': '#451225', + 'pink-darker': '#6f213f', + 'pink-dark': '#eb5286', + pink: '#f66d9b', + 'pink-light': '#fa7ea8', + 'pink-lighter': '#ffbbca', + 'pink-lightest': '#ffebef', +} + +module.exports = { + prefix: '', + important: false, + separator: ':', + screens: { + sm: '576px', + md: '768px', + lg: '992px', + xl: '1200px', + }, + plugins: [ + require('./plugins/container')({ + // center: true, + // padding: '1rem', + }), + ], + + /* + |----------------------------------------------------------------------------- + | Colors https://tailwindcss.com/docs/colors + |----------------------------------------------------------------------------- + | + | The color palette defined above is also assigned to the "colors" key of + | your Tailwind config. This makes it easy to access them in your CSS + | using Tailwind's config helper. For example: + | + | .error { color: config('colors.red') } + | + */ + + colors, + + /* + |----------------------------------------------------------------------------- + | Fonts https://tailwindcss.com/docs/fonts + |----------------------------------------------------------------------------- + | + | Here is where you define your project's font stack, or font families. + | Keep in mind that Tailwind doesn't actually load any fonts for you. + | If you're using custom fonts you'll need to import them prior to + | defining them here. + | + | By default we provide a native font stack that works remarkably well on + | any device or OS you're using, since it just uses the default fonts + | provided by the platform. + | + | Class name: .font-{name} + | CSS property: font-family + | + */ + + fonts: { + sans: [ + 'system-ui', + 'BlinkMacSystemFont', + '-apple-system', + 'Segoe UI', + 'Roboto', + 'Oxygen', + 'Ubuntu', + 'Cantarell', + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + 'sans-serif', + ], + serif: [ + 'Constantia', + 'Lucida Bright', + 'Lucidabright', + 'Lucida Serif', + 'Lucida', + 'DejaVu Serif', + 'Bitstream Vera Serif', + 'Liberation Serif', + 'Georgia', + 'serif', + ], + mono: ['Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', 'monospace'], + }, + + /* + |----------------------------------------------------------------------------- + | Text sizes https://tailwindcss.com/docs/text-sizing + |----------------------------------------------------------------------------- + | + | Here is where you define your text sizes. Name these in whatever way + | makes the most sense to you. We use size names by default, but + | you're welcome to use a numeric scale or even something else + | entirely. + | + | By default Tailwind uses the "rem" unit type for most measurements. + | This allows you to set a root font size which all other sizes are + | then based on. That said, you are free to use whatever units you + | prefer, be it rems, ems, pixels or other. + | + | Class name: .text-{size} + | CSS property: font-size + | + */ + + textSizes: { + xs: '.75rem', // 12px + sm: '.875rem', // 14px + base: '1rem', // 16px + lg: '1.125rem', // 18px + xl: '1.25rem', // 20px + '2xl': '1.5rem', // 24px + '3xl': '1.875rem', // 30px + '4xl': '2.25rem', // 36px + '5xl': '3rem', // 48px + }, + + /* + |----------------------------------------------------------------------------- + | Font weights https://tailwindcss.com/docs/font-weight + |----------------------------------------------------------------------------- + | + | Here is where you define your font weights. We've provided a list of + | common font weight names with their respective numeric scale values + | to get you started. It's unlikely that your project will require + | all of these, so we recommend removing those you don't need. + | + | Class name: .font-{weight} + | CSS property: font-weight + | + */ + + fontWeights: { + hairline: 100, + thin: 200, + light: 300, + normal: 400, + medium: 500, + semibold: 600, + bold: 700, + extrabold: 800, + black: 900, + }, + + /* + |----------------------------------------------------------------------------- + | Leading (line height) https://tailwindcss.com/docs/line-height + |----------------------------------------------------------------------------- + | + | Here is where you define your line height values, or as we call + | them in Tailwind, leadings. + | + | Class name: .leading-{size} + | CSS property: line-height + | + */ + + leading: { + none: 1, + tight: 1.25, + normal: 1.5, + loose: 2, + }, + + /* + |----------------------------------------------------------------------------- + | Tracking (letter spacing) https://tailwindcss.com/docs/letter-spacing + |----------------------------------------------------------------------------- + | + | Here is where you define your letter spacing values, or as we call + | them in Tailwind, tracking. + | + | Class name: .tracking-{size} + | CSS property: letter-spacing + | + */ + + tracking: { + tight: '-0.05em', + normal: '0', + wide: '0.05em', + }, + + /* + |----------------------------------------------------------------------------- + | Text colors https://tailwindcss.com/docs/text-color + |----------------------------------------------------------------------------- + | + | Here is where you define your text colors. By default these use the + | color palette we defined above, however you're welcome to set these + | independently if that makes sense for your project. + | + | Class name: .text-{color} + | CSS property: color + | + */ + + textColors: colors, + + /* + |----------------------------------------------------------------------------- + | Background colors https://tailwindcss.com/docs/background-color + |----------------------------------------------------------------------------- + | + | Here is where you define your background colors. By default these use + | the color palette we defined above, however you're welcome to set + | these independently if that makes sense for your project. + | + | Class name: .bg-{color} + | CSS property: background-color + | + */ + + backgroundColors: colors, + + /* + |----------------------------------------------------------------------------- + | Background sizes https://tailwindcss.com/docs/background-size + |----------------------------------------------------------------------------- + | + | Here is where you define your background sizes. We provide some common + | values that are useful in most projects, but feel free to add other sizes + | that are specific to your project here as well. + | + | Class name: .bg-{size} + | CSS property: background-size + | + */ + + backgroundSize: { + auto: 'auto', + cover: 'cover', + contain: 'contain', + }, + + /* + |----------------------------------------------------------------------------- + | Border widths https://tailwindcss.com/docs/border-width + |----------------------------------------------------------------------------- + | + | Here is where you define your border widths. Take note that border + | widths require a special "default" value set as well. This is the + | width that will be used when you do not specify a border width. + | + | Class name: .border{-side?}{-width?} + | CSS property: border-width + | + */ + + borderWidths: { + default: '1px', + '0': '0', + '2': '2px', + '4': '4px', + '8': '8px', + }, + + /* + |----------------------------------------------------------------------------- + | Border colors https://tailwindcss.com/docs/border-color + |----------------------------------------------------------------------------- + | + | Here is where you define your border colors. By default these use the + | color palette we defined above, however you're welcome to set these + | independently if that makes sense for your project. + | + | Take note that border colors require a special "default" value set + | as well. This is the color that will be used when you do not + | specify a border color. + | + | Class name: .border-{color} + | CSS property: border-color + | + */ + + borderColors: global.Object.assign({ default: colors['grey-light'] }, colors), + + /* + |----------------------------------------------------------------------------- + | Border radius https://tailwindcss.com/docs/border-radius + |----------------------------------------------------------------------------- + | + | Here is where you define your border radius values. If a `default` radius + | is provided, it will be made available as the non-suffixed `.rounded` + | utility. + | + | If your scale includes a `0` value to reset already rounded corners, it's + | a good idea to put it first so other values are able to override it. + | + | Class name: .rounded{-side?}{-size?} + | CSS property: border-radius + | + */ + + borderRadius: { + none: '0', + sm: '.125rem', + default: '.25rem', + lg: '.5rem', + full: '9999px', + }, + + /* + |----------------------------------------------------------------------------- + | Width https://tailwindcss.com/docs/width + |----------------------------------------------------------------------------- + | + | Here is where you define your width utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based numeric scale, a percentage + | based fraction scale, plus some other common use-cases. You + | can, of course, modify these values as needed. + | + | + | It's also worth mentioning that Tailwind automatically escapes + | invalid CSS class name characters, which allows you to have + | awesome classes like .w-2/3. + | + | Class name: .w-{size} + | CSS property: width + | + */ + + width: { + auto: 'auto', + px: '1px', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '24': '6rem', + '32': '8rem', + '48': '12rem', + '64': '16rem', + '1/2': '50%', + '1/3': '33.33333%', + '2/3': '66.66667%', + '1/4': '25%', + '3/4': '75%', + '1/5': '20%', + '2/5': '40%', + '3/5': '60%', + '4/5': '80%', + '1/6': '16.66667%', + '5/6': '83.33333%', + full: '100%', + screen: '100vw', + }, + + /* + |----------------------------------------------------------------------------- + | Height https://tailwindcss.com/docs/height + |----------------------------------------------------------------------------- + | + | Here is where you define your height utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based numeric scale plus some other + | common use-cases. You can, of course, modify these values as + | needed. + | + | Class name: .h-{size} + | CSS property: height + | + */ + + height: { + auto: 'auto', + px: '1px', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '24': '6rem', + '32': '8rem', + '48': '12rem', + '64': '16rem', + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Minimum width https://tailwindcss.com/docs/min-width + |----------------------------------------------------------------------------- + | + | Here is where you define your minimum width utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | couple common use-cases by default. You can, of course, modify + | these values as needed. + | + | Class name: .min-w-{size} + | CSS property: min-width + | + */ + + minWidth: { + '0': '0', + full: '100%', + }, + + /* + |----------------------------------------------------------------------------- + | Minimum height https://tailwindcss.com/docs/min-height + |----------------------------------------------------------------------------- + | + | Here is where you define your minimum height utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | few common use-cases by default. You can, of course, modify these + | values as needed. + | + | Class name: .min-h-{size} + | CSS property: min-height + | + */ + + minHeight: { + '0': '0', + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Maximum width https://tailwindcss.com/docs/max-width + |----------------------------------------------------------------------------- + | + | Here is where you define your maximum width utility sizes. These can + | be percentage based, pixels, rems, or any other units. By default + | we provide a sensible rem based scale and a "full width" size, + | which is basically a reset utility. You can, of course, + | modify these values as needed. + | + | Class name: .max-w-{size} + | CSS property: max-width + | + */ + + maxWidth: { + xs: '20rem', + sm: '30rem', + md: '40rem', + lg: '50rem', + xl: '60rem', + '2xl': '70rem', + '3xl': '80rem', + '4xl': '90rem', + '5xl': '100rem', + full: '100%', + }, + + /* + |----------------------------------------------------------------------------- + | Maximum height https://tailwindcss.com/docs/max-height + |----------------------------------------------------------------------------- + | + | Here is where you define your maximum height utility sizes. These can + | be percentage based, pixels, rems, or any other units. We provide a + | couple common use-cases by default. You can, of course, modify + | these values as needed. + | + | Class name: .max-h-{size} + | CSS property: max-height + | + */ + + maxHeight: { + full: '100%', + screen: '100vh', + }, + + /* + |----------------------------------------------------------------------------- + | Padding https://tailwindcss.com/docs/padding + |----------------------------------------------------------------------------- + | + | Here is where you define your padding utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default we + | provide a sensible rem based numeric scale plus a couple other + | common use-cases like "1px". You can, of course, modify these + | values as needed. + | + | Class name: .p{side?}-{size} + | CSS property: padding + | + */ + + padding: { + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Margin https://tailwindcss.com/docs/margin + |----------------------------------------------------------------------------- + | + | Here is where you define your margin utility sizes. These can be + | percentage based, pixels, rems, or any other units. By default we + | provide a sensible rem based numeric scale plus a couple other + | common use-cases like "1px". You can, of course, modify these + | values as needed. + | + | Class name: .m{side?}-{size} + | CSS property: margin + | + */ + + margin: { + auto: 'auto', + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Negative margin https://tailwindcss.com/docs/negative-margin + |----------------------------------------------------------------------------- + | + | Here is where you define your negative margin utility sizes. These can + | be percentage based, pixels, rems, or any other units. By default we + | provide matching values to the padding scale since these utilities + | generally get used together. You can, of course, modify these + | values as needed. + | + | Class name: .-m{side?}-{size} + | CSS property: margin + | + */ + + negativeMargin: { + px: '1px', + '0': '0', + '1': '0.25rem', + '2': '0.5rem', + '3': '0.75rem', + '4': '1rem', + '5': '1.25rem', + '6': '1.5rem', + '8': '2rem', + '10': '2.5rem', + '12': '3rem', + '16': '4rem', + '20': '5rem', + '24': '6rem', + '32': '8rem', + }, + + /* + |----------------------------------------------------------------------------- + | Shadows https://tailwindcss.com/docs/shadows + |----------------------------------------------------------------------------- + | + | Here is where you define your shadow utilities. As you can see from + | the defaults we provide, it's possible to apply multiple shadows + | per utility using comma separation. + | + | If a `default` shadow is provided, it will be made available as the non- + | suffixed `.shadow` utility. + | + | Class name: .shadow-{size?} + | CSS property: box-shadow + | + */ + + shadows: { + default: '0 2px 4px 0 rgba(0,0,0,0.10)', + md: '0 4px 8px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.08)', + lg: '0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)', + inner: 'inset 0 2px 4px 0 rgba(0,0,0,0.06)', + outline: '0 0 0 3px rgba(52,144,220,0.5)', + none: 'none', + }, + + /* + |----------------------------------------------------------------------------- + | Z-index https://tailwindcss.com/docs/z-index + |----------------------------------------------------------------------------- + | + | Here is where you define your z-index utility values. By default we + | provide a sensible numeric scale. You can, of course, modify these + | values as needed. + | + | Class name: .z-{index} + | CSS property: z-index + | + */ + + zIndex: { + auto: 'auto', + '0': 0, + '10': 10, + '20': 20, + '30': 30, + '40': 40, + '50': 50, + }, + + /* + |----------------------------------------------------------------------------- + | Opacity https://tailwindcss.com/docs/opacity + |----------------------------------------------------------------------------- + | + | Here is where you define your opacity utility values. By default we + | provide a sensible numeric scale. You can, of course, modify these + | values as needed. + | + | Class name: .opacity-{name} + | CSS property: opacity + | + */ + + opacity: { + '0': '0', + '25': '.25', + '50': '.5', + '75': '.75', + '100': '1', + }, + + /* + |----------------------------------------------------------------------------- + | SVG fill https://tailwindcss.com/docs/svg + |----------------------------------------------------------------------------- + | + | Here is where you define your SVG fill colors. By default we just provide + | `fill-current` which sets the fill to the current text color. This lets you + | specify a fill color using existing text color utilities and helps keep the + | generated CSS file size down. + | + | Class name: .fill-{name} + | CSS property: fill + | + */ + + svgFill: { + current: 'currentColor', + }, + + /* + |----------------------------------------------------------------------------- + | SVG stroke https://tailwindcss.com/docs/svg + |----------------------------------------------------------------------------- + | + | Here is where you define your SVG stroke colors. By default we just provide + | `stroke-current` which sets the stroke to the current text color. This lets + | you specify a stroke color using existing text color utilities and helps + | keep the generated CSS file size down. + | + | Class name: .stroke-{name} + | CSS property: stroke + | + */ + + svgStroke: { + current: 'currentColor', + }, + + /* + |----------------------------------------------------------------------------- + | Modules https://tailwindcss.com/docs/configuration#modules + |----------------------------------------------------------------------------- + | + | Here is where you control which modules are generated and what variants are + | generated for each of those modules. + | + | Currently supported variants: + | - responsive + | - hover + | - focus + | - focus-within + | - active + | - group-hover + | + | To disable a module completely, use `false` instead of an array. + | + */ + + modules: { + appearance: ['responsive'], + backgroundAttachment: ['responsive'], + backgroundColors: ['responsive', 'hover', 'focus'], + backgroundPosition: ['responsive'], + backgroundRepeat: ['responsive'], + backgroundSize: ['responsive'], + borderCollapse: [], + borderColors: ['responsive', 'hover', 'focus'], + borderRadius: ['responsive'], + borderStyle: ['responsive'], + borderWidths: ['responsive'], + cursor: ['responsive'], + display: ['responsive'], + flexbox: ['responsive'], + float: ['responsive'], + fonts: ['responsive'], + fontWeights: ['responsive', 'hover', 'focus'], + height: ['responsive'], + leading: ['responsive'], + lists: ['responsive'], + margin: ['responsive'], + maxHeight: ['responsive'], + maxWidth: ['responsive'], + minHeight: ['responsive'], + minWidth: ['responsive'], + negativeMargin: ['responsive'], + objectFit: false, + objectPosition: false, + opacity: ['responsive'], + outline: ['focus'], + overflow: ['responsive'], + padding: ['responsive'], + pointerEvents: ['responsive'], + position: ['responsive'], + resize: ['responsive'], + shadows: ['responsive', 'hover', 'focus'], + svgFill: [], + svgStroke: [], + tableLayout: ['responsive'], + textAlign: ['responsive'], + textColors: ['responsive', 'hover', 'focus'], + textSizes: ['responsive'], + textStyle: ['responsive', 'hover', 'focus'], + tracking: ['responsive'], + userSelect: ['responsive'], + verticalAlign: ['responsive'], + visibility: ['responsive'], + whitespace: ['responsive'], + width: ['responsive'], + zIndex: ['responsive'], + }, +} diff --git a/plugins/appearance.js b/plugins/appearance.js new file mode 100644 index 000000000..af7e14762 --- /dev/null +++ b/plugins/appearance.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/appearance').default diff --git a/plugins/backgroundAttachment.js b/plugins/backgroundAttachment.js new file mode 100644 index 000000000..a10ff5260 --- /dev/null +++ b/plugins/backgroundAttachment.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/backgroundAttachment').default diff --git a/plugins/backgroundColors.js b/plugins/backgroundColors.js new file mode 100644 index 000000000..c3928bee8 --- /dev/null +++ b/plugins/backgroundColors.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/backgroundColors').default diff --git a/plugins/backgroundPosition.js b/plugins/backgroundPosition.js new file mode 100644 index 000000000..ae2285da5 --- /dev/null +++ b/plugins/backgroundPosition.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/backgroundPosition').default diff --git a/plugins/backgroundRepeat.js b/plugins/backgroundRepeat.js new file mode 100644 index 000000000..bb42476b1 --- /dev/null +++ b/plugins/backgroundRepeat.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/backgroundRepeat').default diff --git a/plugins/backgroundSize.js b/plugins/backgroundSize.js new file mode 100644 index 000000000..1a44e1765 --- /dev/null +++ b/plugins/backgroundSize.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/backgroundSize').default diff --git a/plugins/borderCollapse.js b/plugins/borderCollapse.js new file mode 100644 index 000000000..5189893eb --- /dev/null +++ b/plugins/borderCollapse.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/borderCollapse').default diff --git a/plugins/borderColors.js b/plugins/borderColors.js new file mode 100644 index 000000000..77bb95775 --- /dev/null +++ b/plugins/borderColors.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/borderColors').default diff --git a/plugins/borderRadius.js b/plugins/borderRadius.js new file mode 100644 index 000000000..3b9bf465c --- /dev/null +++ b/plugins/borderRadius.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/borderRadius').default diff --git a/plugins/borderStyle.js b/plugins/borderStyle.js new file mode 100644 index 000000000..1ef66229b --- /dev/null +++ b/plugins/borderStyle.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/borderStyle').default diff --git a/plugins/borderWidths.js b/plugins/borderWidths.js new file mode 100644 index 000000000..e61fea17f --- /dev/null +++ b/plugins/borderWidths.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/borderWidths').default diff --git a/plugins/cursor.js b/plugins/cursor.js new file mode 100644 index 000000000..cbafcaa8e --- /dev/null +++ b/plugins/cursor.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/cursor').default diff --git a/plugins/display.js b/plugins/display.js new file mode 100644 index 000000000..a30458328 --- /dev/null +++ b/plugins/display.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/display').default diff --git a/plugins/flexbox.js b/plugins/flexbox.js new file mode 100644 index 000000000..9717d5354 --- /dev/null +++ b/plugins/flexbox.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/flexbox').default diff --git a/plugins/float.js b/plugins/float.js new file mode 100644 index 000000000..70559faa1 --- /dev/null +++ b/plugins/float.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/float').default diff --git a/plugins/fontWeights.js b/plugins/fontWeights.js new file mode 100644 index 000000000..c6e1592a4 --- /dev/null +++ b/plugins/fontWeights.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/fontWeights').default diff --git a/plugins/fonts.js b/plugins/fonts.js new file mode 100644 index 000000000..cc2b7b5d6 --- /dev/null +++ b/plugins/fonts.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/fonts').default diff --git a/plugins/height.js b/plugins/height.js new file mode 100644 index 000000000..06af569a0 --- /dev/null +++ b/plugins/height.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/height').default diff --git a/plugins/hitespace.js b/plugins/hitespace.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/idth.js b/plugins/idth.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/leading.js b/plugins/leading.js new file mode 100644 index 000000000..231aeb9ed --- /dev/null +++ b/plugins/leading.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/leading').default diff --git a/plugins/lists.js b/plugins/lists.js new file mode 100644 index 000000000..3037be21b --- /dev/null +++ b/plugins/lists.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/lists').default diff --git a/plugins/margin.js b/plugins/margin.js new file mode 100644 index 000000000..9bea685eb --- /dev/null +++ b/plugins/margin.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/margin').default diff --git a/plugins/maxHeight.js b/plugins/maxHeight.js new file mode 100644 index 000000000..2e6f6c577 --- /dev/null +++ b/plugins/maxHeight.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/maxHeight').default diff --git a/plugins/maxWidth.js b/plugins/maxWidth.js new file mode 100644 index 000000000..56970257a --- /dev/null +++ b/plugins/maxWidth.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/maxWidth').default diff --git a/plugins/minHeight.js b/plugins/minHeight.js new file mode 100644 index 000000000..15ff3e149 --- /dev/null +++ b/plugins/minHeight.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/minHeight').default diff --git a/plugins/minWidth.js b/plugins/minWidth.js new file mode 100644 index 000000000..98689ff7a --- /dev/null +++ b/plugins/minWidth.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/minWidth').default diff --git a/plugins/negativeMargin.js b/plugins/negativeMargin.js new file mode 100644 index 000000000..714aa400c --- /dev/null +++ b/plugins/negativeMargin.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/negativeMargin').default diff --git a/plugins/objectFit.js b/plugins/objectFit.js new file mode 100644 index 000000000..5d67e4ec9 --- /dev/null +++ b/plugins/objectFit.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/objectFit').default diff --git a/plugins/objectPosition.js b/plugins/objectPosition.js new file mode 100644 index 000000000..d92b1e555 --- /dev/null +++ b/plugins/objectPosition.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/objectPosition').default diff --git a/plugins/opacity.js b/plugins/opacity.js new file mode 100644 index 000000000..81a172b20 --- /dev/null +++ b/plugins/opacity.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/opacity').default diff --git a/plugins/outline.js b/plugins/outline.js new file mode 100644 index 000000000..9854cfc4f --- /dev/null +++ b/plugins/outline.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/outline').default diff --git a/plugins/overflow.js b/plugins/overflow.js new file mode 100644 index 000000000..9979bf7f2 --- /dev/null +++ b/plugins/overflow.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/overflow').default diff --git a/plugins/padding.js b/plugins/padding.js new file mode 100644 index 000000000..f1021640e --- /dev/null +++ b/plugins/padding.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/padding').default diff --git a/plugins/pointerEvents.js b/plugins/pointerEvents.js new file mode 100644 index 000000000..f879be8c1 --- /dev/null +++ b/plugins/pointerEvents.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/pointerEvents').default diff --git a/plugins/position.js b/plugins/position.js new file mode 100644 index 000000000..d4a8264a2 --- /dev/null +++ b/plugins/position.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/position').default diff --git a/plugins/resize.js b/plugins/resize.js new file mode 100644 index 000000000..5ced66fbe --- /dev/null +++ b/plugins/resize.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/resize').default diff --git a/plugins/shadows.js b/plugins/shadows.js new file mode 100644 index 000000000..553a4c2ee --- /dev/null +++ b/plugins/shadows.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/shadows').default diff --git a/plugins/svgFill.js b/plugins/svgFill.js new file mode 100644 index 000000000..af6efaf7c --- /dev/null +++ b/plugins/svgFill.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/svgFill').default diff --git a/plugins/svgStroke.js b/plugins/svgStroke.js new file mode 100644 index 000000000..24d667496 --- /dev/null +++ b/plugins/svgStroke.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/svgStroke').default diff --git a/plugins/tableLayout.js b/plugins/tableLayout.js new file mode 100644 index 000000000..7358477c8 --- /dev/null +++ b/plugins/tableLayout.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/tableLayout').default diff --git a/plugins/textAlign.js b/plugins/textAlign.js new file mode 100644 index 000000000..a771b459a --- /dev/null +++ b/plugins/textAlign.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/textAlign').default diff --git a/plugins/textColors.js b/plugins/textColors.js new file mode 100644 index 000000000..83a71ac99 --- /dev/null +++ b/plugins/textColors.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/textColors').default diff --git a/plugins/textSizes.js b/plugins/textSizes.js new file mode 100644 index 000000000..98c963892 --- /dev/null +++ b/plugins/textSizes.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/textSizes').default diff --git a/plugins/textStyle.js b/plugins/textStyle.js new file mode 100644 index 000000000..b6c28b6cf --- /dev/null +++ b/plugins/textStyle.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/textStyle').default diff --git a/plugins/tracking.js b/plugins/tracking.js new file mode 100644 index 000000000..1e44f581c --- /dev/null +++ b/plugins/tracking.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/tracking').default diff --git a/plugins/userSelect.js b/plugins/userSelect.js new file mode 100644 index 000000000..da2925d70 --- /dev/null +++ b/plugins/userSelect.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/userSelect').default diff --git a/plugins/verticalAlign.js b/plugins/verticalAlign.js new file mode 100644 index 000000000..c55b37801 --- /dev/null +++ b/plugins/verticalAlign.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/verticalAlign').default diff --git a/plugins/visibility.js b/plugins/visibility.js new file mode 100644 index 000000000..9b636c5ef --- /dev/null +++ b/plugins/visibility.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/visibility').default diff --git a/plugins/whitespace.js b/plugins/whitespace.js new file mode 100644 index 000000000..9cfb81c6d --- /dev/null +++ b/plugins/whitespace.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/whitespace').default diff --git a/plugins/width.js b/plugins/width.js new file mode 100644 index 000000000..dce40547d --- /dev/null +++ b/plugins/width.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/width').default diff --git a/plugins/zIndex.js b/plugins/zIndex.js new file mode 100644 index 000000000..1ac386645 --- /dev/null +++ b/plugins/zIndex.js @@ -0,0 +1 @@ +module.exports = require('../lib/plugins/zIndex').default diff --git a/src/plugins/appearance.js b/src/plugins/appearance.js index a1cd31b9b..74bbd600d 100644 --- a/src/plugins/appearance.js +++ b/src/plugins/appearance.js @@ -1,10 +1,10 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.appearance-none': { appearance: 'none' }, }, - config('modules.appearance') + variants ) } } diff --git a/src/plugins/backgroundAttachment.js b/src/plugins/backgroundAttachment.js index 75fc3f4c4..9b9371b75 100644 --- a/src/plugins/backgroundAttachment.js +++ b/src/plugins/backgroundAttachment.js @@ -1,12 +1,12 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.bg-fixed': { 'background-attachment': 'fixed' }, '.bg-local': { 'background-attachment': 'local' }, '.bg-scroll': { 'background-attachment': 'scroll' }, }, - config('modules.backgroundAttachment') + variants ) } } diff --git a/src/plugins/backgroundColors.js b/src/plugins/backgroundColors.js index 0d7d47d25..b77413f02 100644 --- a/src/plugins/backgroundColors.js +++ b/src/plugins/backgroundColors.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('backgroundColors'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`bg-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.backgroundColors')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/backgroundPosition.js b/src/plugins/backgroundPosition.js index 3a5144b45..c8f6e6508 100644 --- a/src/plugins/backgroundPosition.js +++ b/src/plugins/backgroundPosition.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.bg-bottom': { 'background-position': 'bottom' }, @@ -12,7 +12,7 @@ export default function() { '.bg-right-top': { 'background-position': 'right top' }, '.bg-top': { 'background-position': 'top' }, }, - config('modules.backgroundPosition') + variants ) } } diff --git a/src/plugins/backgroundRepeat.js b/src/plugins/backgroundRepeat.js index d7f9aac55..9cde18f42 100644 --- a/src/plugins/backgroundRepeat.js +++ b/src/plugins/backgroundRepeat.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.bg-repeat': { 'background-repeat': 'repeat' }, @@ -7,7 +7,7 @@ export default function() { '.bg-repeat-x': { 'background-repeat': 'repeat-x' }, '.bg-repeat-y': { 'background-repeat': 'repeat-y' }, }, - config('modules.backgroundRepeat') + variants ) } } diff --git a/src/plugins/backgroundSize.js b/src/plugins/backgroundSize.js index 80bd9eec4..3c2a00285 100644 --- a/src/plugins/backgroundSize.js +++ b/src/plugins/backgroundSize.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('backgroundSize'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`bg-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.opacity')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/borderCollapse.js b/src/plugins/borderCollapse.js index b3e39ca93..3a48f9712 100644 --- a/src/plugins/borderCollapse.js +++ b/src/plugins/borderCollapse.js @@ -1,11 +1,11 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.border-collapse': { 'border-collapse': 'collapse' }, '.border-separate': { 'border-collapse': 'separate' }, }, - config('modules.borderCollapse') + variants ) } } diff --git a/src/plugins/borderColors.js b/src/plugins/borderColors.js index 251c92963..8b0c08b5b 100644 --- a/src/plugins/borderColors.js +++ b/src/plugins/borderColors.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(_.omit(config('borderColors'), 'default'), (value, modifier) => { + _.map(_.omit(values, 'default'), (value, modifier) => { return [ `.${e(`border-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.borderColors')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/borderRadius.js b/src/plugins/borderRadius.js index 05f748465..26a85d0c5 100644 --- a/src/plugins/borderRadius.js +++ b/src/plugins/borderRadius.js @@ -1,7 +1,7 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const generators = [ (value, modifier) => ({ [`.${e(`rounded${modifier}`)}`]: { borderRadius: `${value}` }, @@ -33,11 +33,11 @@ export default function() { ] const utilities = _.flatMap(generators, generator => { - return _.flatMap(config('borderRadius'), (value, modifier) => { + return _.flatMap(values, (value, modifier) => { return generator(value, modifier === 'default' ? '' : `-${modifier}`) }) }) - addUtilities(utilities, config('modules.borderRadius')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/borderStyle.js b/src/plugins/borderStyle.js index 120033aec..336123890 100644 --- a/src/plugins/borderStyle.js +++ b/src/plugins/borderStyle.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.border-solid': { @@ -15,7 +15,7 @@ export default function() { 'border-style': 'none', }, }, - config('modules.borderStyle') + variants ) } } diff --git a/src/plugins/borderWidths.js b/src/plugins/borderWidths.js index 29960705b..07e3e1734 100644 --- a/src/plugins/borderWidths.js +++ b/src/plugins/borderWidths.js @@ -1,7 +1,7 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const generators = [ (value, modifier) => ({ [`.${e(`border${modifier}`)}`]: { borderWidth: `${value}` }, @@ -15,11 +15,11 @@ export default function() { ] const utilities = _.flatMap(generators, generator => { - return _.flatMap(config('borderWidths'), (value, modifier) => { + return _.flatMap(values, (value, modifier) => { return generator(value, modifier === 'default' ? '' : `-${modifier}`) }) }) - addUtilities(utilities, config('modules.borderWidths')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/cursor.js b/src/plugins/cursor.js index aae914fb1..1de7683b8 100644 --- a/src/plugins/cursor.js +++ b/src/plugins/cursor.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.cursor-auto': { cursor: 'auto' }, @@ -9,7 +9,7 @@ export default function() { '.cursor-move': { cursor: 'move' }, '.cursor-not-allowed': { cursor: 'not-allowed' }, }, - config('modules.cursor') + variants ) } } diff --git a/src/plugins/display.js b/src/plugins/display.js index 3208ca3c8..98c190e3b 100644 --- a/src/plugins/display.js +++ b/src/plugins/display.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.block': { @@ -24,7 +24,7 @@ export default function() { display: 'none', }, }, - config('modules.display') + variants ) } } diff --git a/src/plugins/flexbox.js b/src/plugins/flexbox.js index ef38e2234..924a6fdf3 100644 --- a/src/plugins/flexbox.js +++ b/src/plugins/flexbox.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.flex': { @@ -114,7 +114,7 @@ export default function() { 'flex-shrink': '0', }, }, - config('modules.flexbox') + variants ) } } diff --git a/src/plugins/float.js b/src/plugins/float.js index 6ae4eb86e..c39a4fbcf 100644 --- a/src/plugins/float.js +++ b/src/plugins/float.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.float-right': { float: 'right' }, @@ -11,7 +11,7 @@ export default function() { clear: 'both', }, }, - config('modules.float') + variants ) } } diff --git a/src/plugins/fontWeights.js b/src/plugins/fontWeights.js index 659956cd2..ebc19d7db 100644 --- a/src/plugins/fontWeights.js +++ b/src/plugins/fontWeights.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('fontWeights'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`font-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.fontWeights')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/fonts.js b/src/plugins/fonts.js index 1cd374d88..03b3a8de1 100644 --- a/src/plugins/fonts.js +++ b/src/plugins/fonts.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('fonts'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`font-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.fonts')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/height.js b/src/plugins/height.js index 17d3b6a69..f3aed0399 100644 --- a/src/plugins/height.js +++ b/src/plugins/height.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('height'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`h-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.height')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/leading.js b/src/plugins/leading.js index b1b5c5216..882b62220 100644 --- a/src/plugins/leading.js +++ b/src/plugins/leading.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('leading'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`leading-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.leading')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/lists.js b/src/plugins/lists.js index 13cb1c786..9d2782854 100644 --- a/src/plugins/lists.js +++ b/src/plugins/lists.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.list-reset': { @@ -7,7 +7,7 @@ export default function() { padding: '0', }, }, - config('modules.lists') + variants ) } } diff --git a/src/plugins/margin.js b/src/plugins/margin.js index b7c748876..f5c2937c8 100644 --- a/src/plugins/margin.js +++ b/src/plugins/margin.js @@ -1,7 +1,7 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const generators = [ (size, modifier) => ({ [`.${e(`m-${modifier}`)}`]: { margin: `${size}` }, @@ -19,9 +19,9 @@ export default function() { ] const utilities = _.flatMap(generators, generator => { - return _.flatMap(config('margin'), generator) + return _.flatMap(values, generator) }) - addUtilities(utilities, config('modules.margin')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/maxHeight.js b/src/plugins/maxHeight.js index ba1784db6..b7a103f24 100644 --- a/src/plugins/maxHeight.js +++ b/src/plugins/maxHeight.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('maxHeight'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`max-h-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.maxHeight')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/maxWidth.js b/src/plugins/maxWidth.js index ba3798e45..2aa3720bc 100644 --- a/src/plugins/maxWidth.js +++ b/src/plugins/maxWidth.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('maxWidth'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`max-w-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.maxWidth')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/minHeight.js b/src/plugins/minHeight.js index 6f2966e90..651d3d19f 100644 --- a/src/plugins/minHeight.js +++ b/src/plugins/minHeight.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('minHeight'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`min-h-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.minHeight')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/minWidth.js b/src/plugins/minWidth.js index bd56df4f3..dff0e7b20 100644 --- a/src/plugins/minWidth.js +++ b/src/plugins/minWidth.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('minWidth'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`min-w-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.minWidth')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/negativeMargin.js b/src/plugins/negativeMargin.js index e3796f9e9..9ef20dfa4 100644 --- a/src/plugins/negativeMargin.js +++ b/src/plugins/negativeMargin.js @@ -1,7 +1,7 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const generators = [ (size, modifier) => ({ [`.${e(`-m-${modifier}`)}`]: { margin: `${size}` }, @@ -19,11 +19,11 @@ export default function() { ] const utilities = _.flatMap(generators, generator => { - return _.flatMap(config('negativeMargin'), (size, modifier) => { + return _.flatMap(values, (size, modifier) => { return generator(`${size}` === '0' ? `${size}` : `-${size}`, modifier) }) }) - addUtilities(utilities, config('modules.negativeMargin')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/objectFit.js b/src/plugins/objectFit.js index cd0487915..bfbcb42a4 100644 --- a/src/plugins/objectFit.js +++ b/src/plugins/objectFit.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.object-contain': { 'object-fit': 'contain' }, @@ -8,7 +8,7 @@ export default function() { '.object-none': { 'object-fit': 'none' }, '.object-scale-down': { 'object-fit': 'scale-down' }, }, - config('modules.objectFit') + variants ) } } diff --git a/src/plugins/objectPosition.js b/src/plugins/objectPosition.js index 54af2a1ef..8f72408cf 100644 --- a/src/plugins/objectPosition.js +++ b/src/plugins/objectPosition.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.object-bottom': { 'object-position': 'bottom' }, @@ -12,7 +12,7 @@ export default function() { '.object-right-top': { 'object-position': 'right top' }, '.object-top': { 'object-position': 'top' }, }, - config('modules.objectPosition') + variants ) } } diff --git a/src/plugins/opacity.js b/src/plugins/opacity.js index 68dd37dbb..350d62e76 100644 --- a/src/plugins/opacity.js +++ b/src/plugins/opacity.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('opacity'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`opacity-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.opacity')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/outline.js b/src/plugins/outline.js index 552f7e511..352d979e6 100644 --- a/src/plugins/outline.js +++ b/src/plugins/outline.js @@ -1,10 +1,10 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.outline-none': { outline: '0' }, }, - config('modules.outline') + variants ) } } diff --git a/src/plugins/overflow.js b/src/plugins/overflow.js index c4faedd66..d13969db2 100644 --- a/src/plugins/overflow.js +++ b/src/plugins/overflow.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.overflow-auto': { overflow: 'auto' }, @@ -17,7 +17,7 @@ export default function() { '.scrolling-touch': { '-webkit-overflow-scrolling': 'touch' }, '.scrolling-auto': { '-webkit-overflow-scrolling': 'auto' }, }, - config('modules.overflow') + variants ) } } diff --git a/src/plugins/padding.js b/src/plugins/padding.js index 519604576..35462b28a 100644 --- a/src/plugins/padding.js +++ b/src/plugins/padding.js @@ -1,7 +1,7 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const generators = [ (size, modifier) => ({ [`.${e(`p-${modifier}`)}`]: { padding: `${size}` }, @@ -19,9 +19,9 @@ export default function() { ] const utilities = _.flatMap(generators, generator => { - return _.flatMap(config('padding'), generator) + return _.flatMap(values, generator) }) - addUtilities(utilities, config('modules.padding')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/pointerEvents.js b/src/plugins/pointerEvents.js index 31ee1f8c2..b9d6826bf 100644 --- a/src/plugins/pointerEvents.js +++ b/src/plugins/pointerEvents.js @@ -1,11 +1,11 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.pointer-events-none': { 'pointer-events': 'none' }, '.pointer-events-auto': { 'pointer-events': 'auto' }, }, - config('modules.pointerEvents') + variants ) } } diff --git a/src/plugins/position.js b/src/plugins/position.js index 595235700..4c831aacb 100644 --- a/src/plugins/position.js +++ b/src/plugins/position.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.static': { position: 'static' }, @@ -26,7 +26,7 @@ export default function() { '.pin-b': { bottom: 0 }, '.pin-l': { left: 0 }, }, - config('modules.position') + variants ) } } diff --git a/src/plugins/resize.js b/src/plugins/resize.js index 362686c05..d77a8fbe9 100644 --- a/src/plugins/resize.js +++ b/src/plugins/resize.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.resize-none': { resize: 'none' }, @@ -7,7 +7,7 @@ export default function() { '.resize-x': { resize: 'horizontal' }, '.resize': { resize: 'both' }, }, - config('modules.resize') + variants ) } } diff --git a/src/plugins/shadows.js b/src/plugins/shadows.js index b19054ed4..e2ec6705f 100644 --- a/src/plugins/shadows.js +++ b/src/plugins/shadows.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('shadows'), (value, modifier) => { + _.map(values, (value, modifier) => { const className = modifier === 'default' ? 'shadow' : `shadow-${modifier}` return [ `.${e(className)}`, @@ -14,6 +14,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.shadows')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/svgFill.js b/src/plugins/svgFill.js index f4ccba344..95d051651 100644 --- a/src/plugins/svgFill.js +++ b/src/plugins/svgFill.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('svgFill'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`fill-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.svgFill')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/svgStroke.js b/src/plugins/svgStroke.js index 9937cc01f..f8e0513c8 100644 --- a/src/plugins/svgStroke.js +++ b/src/plugins/svgStroke.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('svgStroke'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`stroke-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.svgStroke')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/tableLayout.js b/src/plugins/tableLayout.js index 98b090cdd..b890a2370 100644 --- a/src/plugins/tableLayout.js +++ b/src/plugins/tableLayout.js @@ -1,11 +1,11 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.table-auto': { 'table-layout': 'auto' }, '.table-fixed': { 'table-layout': 'fixed' }, }, - config('modules.tableLayout') + variants ) } } diff --git a/src/plugins/textAlign.js b/src/plugins/textAlign.js index 80ce95c39..9cd80df08 100644 --- a/src/plugins/textAlign.js +++ b/src/plugins/textAlign.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.text-left': { 'text-align': 'left' }, @@ -7,7 +7,7 @@ export default function() { '.text-right': { 'text-align': 'right' }, '.text-justify': { 'text-align': 'justify' }, }, - config('modules.textAlign') + variants ) } } diff --git a/src/plugins/textColors.js b/src/plugins/textColors.js index 9652313da..910110608 100644 --- a/src/plugins/textColors.js +++ b/src/plugins/textColors.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('textColors'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`text-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.textColors')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/textSizes.js b/src/plugins/textSizes.js index c2f896b90..05cc4fdd8 100644 --- a/src/plugins/textSizes.js +++ b/src/plugins/textSizes.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('textSizes'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`text-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.textSizes')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/textStyle.js b/src/plugins/textStyle.js index 7a0c03bd7..a632d9145 100644 --- a/src/plugins/textStyle.js +++ b/src/plugins/textStyle.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.italic': { 'font-style': 'italic' }, @@ -23,7 +23,7 @@ export default function() { '-moz-osx-font-smoothing': 'auto', }, }, - config('modules.textStyle') + variants ) } } diff --git a/src/plugins/tracking.js b/src/plugins/tracking.js index 1fd6f185c..3fb1683f4 100644 --- a/src/plugins/tracking.js +++ b/src/plugins/tracking.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config }) { +export default function({ values, variants }) { + return function({ addUtilities }) { const utilities = _.fromPairs( - _.map(config('tracking'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.tracking-${modifier}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.tracking')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/userSelect.js b/src/plugins/userSelect.js index 5fc759c15..2e60869bf 100644 --- a/src/plugins/userSelect.js +++ b/src/plugins/userSelect.js @@ -1,11 +1,11 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.select-none': { 'user-select': 'none' }, '.select-text': { 'user-select': 'text' }, }, - config('modules.userSelect') + variants ) } } diff --git a/src/plugins/verticalAlign.js b/src/plugins/verticalAlign.js index 374a9da91..3adae6a08 100644 --- a/src/plugins/verticalAlign.js +++ b/src/plugins/verticalAlign.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.align-baseline': { 'vertical-align': 'baseline' }, @@ -9,7 +9,7 @@ export default function() { '.align-text-top': { 'vertical-align': 'text-top' }, '.align-text-bottom': { 'vertical-align': 'text-bottom' }, }, - config('modules.verticalAlign') + variants ) } } diff --git a/src/plugins/visibility.js b/src/plugins/visibility.js index 9c5061d6e..528b81a74 100644 --- a/src/plugins/visibility.js +++ b/src/plugins/visibility.js @@ -1,11 +1,11 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.visible': { visibility: 'visible' }, '.invisible': { visibility: 'hidden' }, }, - config('modules.visibility') + variants ) } } diff --git a/src/plugins/whitespace.js b/src/plugins/whitespace.js index 4f3b2bee4..d76e6eb8e 100644 --- a/src/plugins/whitespace.js +++ b/src/plugins/whitespace.js @@ -1,5 +1,5 @@ -export default function() { - return function({ addUtilities, config }) { +export default function({ variants }) { + return function({ addUtilities }) { addUtilities( { '.whitespace-normal': { 'white-space': 'normal' }, @@ -17,7 +17,7 @@ export default function() { 'white-space': 'nowrap', }, }, - config('modules.whitespace') + variants ) } } diff --git a/src/plugins/width.js b/src/plugins/width.js index a83ed16e6..2d5e962ff 100644 --- a/src/plugins/width.js +++ b/src/plugins/width.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config, e }) { +export default function({ values, variants }) { + return function({ addUtilities, e }) { const utilities = _.fromPairs( - _.map(config('width'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.${e(`w-${modifier}`)}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.width')) + addUtilities(utilities, variants) } } diff --git a/src/plugins/zIndex.js b/src/plugins/zIndex.js index 31f224b58..9125aff25 100644 --- a/src/plugins/zIndex.js +++ b/src/plugins/zIndex.js @@ -1,9 +1,9 @@ import _ from 'lodash' -export default function() { - return function({ addUtilities, config }) { +export default function({ values, variants }) { + return function({ addUtilities }) { const utilities = _.fromPairs( - _.map(config('zIndex'), (value, modifier) => { + _.map(values, (value, modifier) => { return [ `.z-${modifier}`, { @@ -13,6 +13,6 @@ export default function() { }) ) - addUtilities(utilities, config('modules.zIndex')) + addUtilities(utilities, variants) } } diff --git a/src/processTailwindFeatures.js b/src/processTailwindFeatures.js index 34b4299cf..956d10573 100644 --- a/src/processTailwindFeatures.js +++ b/src/processTailwindFeatures.js @@ -9,12 +9,11 @@ import substituteScreenAtRules from './lib/substituteScreenAtRules' import substituteClassApplyAtRules from './lib/substituteClassApplyAtRules' import processPlugins from './util/processPlugins' -import defaultPlugins from './defaultPlugins' export default function(getConfig) { return function(css) { const config = getConfig() - const processedPlugins = processPlugins([...defaultPlugins(config), ...config.plugins], config) + const processedPlugins = processPlugins(config.plugins, config) return postcss([ substituteTailwindAtRules(config, processedPlugins),