From 688357fddec744c7d236932ddd0e4f4e8b184aa7 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Sep 2021 15:22:50 +0200 Subject: [PATCH] Inline plugins (#5455) * filter out `..Variant` plugins for the core-plugin-list * inline all corePlugins * move preflight css to `./src/css` * remove individual plugins * convert export default object to named exports Note: Normally I would use export function ..., but since we also have some export let xx = createUtilityPlugin in this file, it means that all the `export function` declarations would be hoisted and therefore won't have the correct order anymore. To fix this, I used `export let xx = () => {}` instead of the usual `export function xx() {}` * drop unused `variants()` function This was required for AOT mode. * make a few plugins shorter --- scripts/create-plugin-list.js | 4 +- src/corePlugins.js | 2501 ++++++++++++++++++++--- src/{plugins => }/css/LICENSE | 0 src/{plugins => }/css/preflight.css | 0 src/lib/setupContextUtils.js | 2 +- src/plugins/accentColor.js | 19 - src/plugins/accessibility.js | 30 - src/plugins/alignContent.js | 27 - src/plugins/alignItems.js | 24 - src/plugins/alignSelf.js | 27 - src/plugins/animation.js | 45 - src/plugins/appearance.js | 10 - src/plugins/aspectRatio.js | 5 - src/plugins/backdropBlur.js | 20 - src/plugins/backdropBrightness.js | 20 - src/plugins/backdropContrast.js | 20 - src/plugins/backdropFilter.js | 38 - src/plugins/backdropGrayscale.js | 20 - src/plugins/backdropHueRotate.js | 20 - src/plugins/backdropInvert.js | 20 - src/plugins/backdropOpacity.js | 20 - src/plugins/backdropSaturate.js | 20 - src/plugins/backdropSepia.js | 20 - src/plugins/backgroundAttachment.js | 12 - src/plugins/backgroundBlendMode.js | 25 - src/plugins/backgroundClip.js | 13 - src/plugins/backgroundColor.js | 29 - src/plugins/backgroundImage.js | 8 - src/plugins/backgroundOpacity.js | 5 - src/plugins/backgroundOrigin.js | 12 - src/plugins/backgroundPosition.js | 8 - src/plugins/backgroundRepeat.js | 15 - src/plugins/backgroundSize.js | 8 - src/plugins/blur.js | 20 - src/plugins/borderCollapse.js | 11 - src/plugins/borderColor.js | 107 - src/plugins/borderOpacity.js | 5 - src/plugins/borderRadius.js | 19 - src/plugins/borderStyle.js | 24 - src/plugins/borderWidth.js | 18 - src/plugins/boxDecorationBreak.js | 15 - src/plugins/boxShadow.js | 39 - src/plugins/boxSizing.js | 11 - src/plugins/brightness.js | 20 - src/plugins/caretColor.js | 19 - src/plugins/clear.js | 13 - src/plugins/container.js | 108 - src/plugins/content.js | 5 - src/plugins/contrast.js | 16 - src/plugins/cursor.js | 5 - src/plugins/display.js | 72 - src/plugins/divideColor.js | 33 - src/plugins/divideOpacity.js | 20 - src/plugins/divideStyle.js | 24 - src/plugins/divideWidth.js | 51 - src/plugins/dropShadow.js | 22 - src/plugins/fill.js | 19 - src/plugins/filter.js | 35 - src/plugins/flex.js | 5 - src/plugins/flexDirection.js | 21 - src/plugins/flexGrow.js | 5 - src/plugins/flexShrink.js | 5 - src/plugins/flexWrap.js | 18 - src/plugins/float.js | 12 - src/plugins/fontFamily.js | 8 - src/plugins/fontSize.js | 27 - src/plugins/fontSmoothing.js | 17 - src/plugins/fontStyle.js | 11 - src/plugins/fontVariantNumeric.js | 46 - src/plugins/fontWeight.js | 8 - src/plugins/gap.js | 11 - src/plugins/gradientColorStops.js | 54 - src/plugins/grayscale.js | 20 - src/plugins/gridAutoColumns.js | 5 - src/plugins/gridAutoFlow.js | 13 - src/plugins/gridAutoRows.js | 5 - src/plugins/gridColumn.js | 5 - src/plugins/gridColumnEnd.js | 5 - src/plugins/gridColumnStart.js | 5 - src/plugins/gridRow.js | 5 - src/plugins/gridRowEnd.js | 5 - src/plugins/gridRowStart.js | 5 - src/plugins/gridTemplateColumns.js | 8 - src/plugins/gridTemplateRows.js | 8 - src/plugins/height.js | 5 - src/plugins/hueRotate.js | 20 - src/plugins/index.js | 171 -- src/plugins/inset.js | 48 - src/plugins/invert.js | 20 - src/plugins/isolation.js | 15 - src/plugins/justifyContent.js | 27 - src/plugins/justifyItems.js | 21 - src/plugins/justifySelf.js | 24 - src/plugins/letterSpacing.js | 5 - src/plugins/lineHeight.js | 5 - src/plugins/listStylePosition.js | 11 - src/plugins/listStyleType.js | 5 - src/plugins/margin.js | 17 - src/plugins/maxHeight.js | 5 - src/plugins/maxWidth.js | 5 - src/plugins/minHeight.js | 5 - src/plugins/minWidth.js | 5 - src/plugins/mixBlendMode.js | 25 - src/plugins/objectFit.js | 14 - src/plugins/objectPosition.js | 8 - src/plugins/opacity.js | 5 - src/plugins/order.js | 5 - src/plugins/outline.js | 14 - src/plugins/overflow.js | 21 - src/plugins/overscrollBehavior.js | 18 - src/plugins/padding.js | 17 - src/plugins/placeContent.js | 30 - src/plugins/placeItems.js | 21 - src/plugins/placeSelf.js | 24 - src/plugins/placeholderColor.js | 33 - src/plugins/placeholderOpacity.js | 16 - src/plugins/pointerEvents.js | 11 - src/plugins/position.js | 16 - src/plugins/preflight.js | 16 - src/plugins/resize.js | 13 - src/plugins/ringColor.js | 27 - src/plugins/ringOffsetColor.js | 21 - src/plugins/ringOffsetWidth.js | 8 - src/plugins/ringOpacity.js | 7 - src/plugins/ringWidth.js | 56 - src/plugins/rotate.js | 7 - src/plugins/saturate.js | 20 - src/plugins/scale.js | 25 - src/plugins/sepia.js | 16 - src/plugins/skew.js | 16 - src/plugins/space.js | 47 - src/plugins/stroke.js | 21 - src/plugins/strokeWidth.js | 8 - src/plugins/tableLayout.js | 11 - src/plugins/textAlign.js | 13 - src/plugins/textColor.js | 27 - src/plugins/textDecoration.js | 12 - src/plugins/textIndent.js | 5 - src/plugins/textOpacity.js | 5 - src/plugins/textOverflow.js | 16 - src/plugins/textTransform.js | 13 - src/plugins/transform.js | 55 - src/plugins/transformOrigin.js | 5 - src/plugins/transitionDelay.js | 5 - src/plugins/transitionDuration.js | 7 - src/plugins/transitionProperty.js | 27 - src/plugins/transitionTimingFunction.js | 7 - src/plugins/translate.js | 16 - src/plugins/userSelect.js | 13 - src/plugins/verticalAlign.js | 15 - src/plugins/visibility.js | 11 - src/plugins/whitespace.js | 14 - src/plugins/width.js | 5 - src/plugins/willChange.js | 5 - src/plugins/wordBreak.js | 17 - src/plugins/zIndex.js | 5 - 156 files changed, 2185 insertions(+), 3239 deletions(-) rename src/{plugins => }/css/LICENSE (100%) rename src/{plugins => }/css/preflight.css (100%) delete mode 100644 src/plugins/accentColor.js delete mode 100644 src/plugins/accessibility.js delete mode 100644 src/plugins/alignContent.js delete mode 100644 src/plugins/alignItems.js delete mode 100644 src/plugins/alignSelf.js delete mode 100644 src/plugins/animation.js delete mode 100644 src/plugins/appearance.js delete mode 100644 src/plugins/aspectRatio.js delete mode 100644 src/plugins/backdropBlur.js delete mode 100644 src/plugins/backdropBrightness.js delete mode 100644 src/plugins/backdropContrast.js delete mode 100644 src/plugins/backdropFilter.js delete mode 100644 src/plugins/backdropGrayscale.js delete mode 100644 src/plugins/backdropHueRotate.js delete mode 100644 src/plugins/backdropInvert.js delete mode 100644 src/plugins/backdropOpacity.js delete mode 100644 src/plugins/backdropSaturate.js delete mode 100644 src/plugins/backdropSepia.js delete mode 100644 src/plugins/backgroundAttachment.js delete mode 100644 src/plugins/backgroundBlendMode.js delete mode 100644 src/plugins/backgroundClip.js delete mode 100644 src/plugins/backgroundColor.js delete mode 100644 src/plugins/backgroundImage.js delete mode 100644 src/plugins/backgroundOpacity.js delete mode 100644 src/plugins/backgroundOrigin.js delete mode 100644 src/plugins/backgroundPosition.js delete mode 100644 src/plugins/backgroundRepeat.js delete mode 100644 src/plugins/backgroundSize.js delete mode 100644 src/plugins/blur.js delete mode 100644 src/plugins/borderCollapse.js delete mode 100644 src/plugins/borderColor.js delete mode 100644 src/plugins/borderOpacity.js delete mode 100644 src/plugins/borderRadius.js delete mode 100644 src/plugins/borderStyle.js delete mode 100644 src/plugins/borderWidth.js delete mode 100644 src/plugins/boxDecorationBreak.js delete mode 100644 src/plugins/boxShadow.js delete mode 100644 src/plugins/boxSizing.js delete mode 100644 src/plugins/brightness.js delete mode 100644 src/plugins/caretColor.js delete mode 100644 src/plugins/clear.js delete mode 100644 src/plugins/container.js delete mode 100644 src/plugins/content.js delete mode 100644 src/plugins/contrast.js delete mode 100644 src/plugins/cursor.js delete mode 100644 src/plugins/display.js delete mode 100644 src/plugins/divideColor.js delete mode 100644 src/plugins/divideOpacity.js delete mode 100644 src/plugins/divideStyle.js delete mode 100644 src/plugins/divideWidth.js delete mode 100644 src/plugins/dropShadow.js delete mode 100644 src/plugins/fill.js delete mode 100644 src/plugins/filter.js delete mode 100644 src/plugins/flex.js delete mode 100644 src/plugins/flexDirection.js delete mode 100644 src/plugins/flexGrow.js delete mode 100644 src/plugins/flexShrink.js delete mode 100644 src/plugins/flexWrap.js delete mode 100644 src/plugins/float.js delete mode 100644 src/plugins/fontFamily.js delete mode 100644 src/plugins/fontSize.js delete mode 100644 src/plugins/fontSmoothing.js delete mode 100644 src/plugins/fontStyle.js delete mode 100644 src/plugins/fontVariantNumeric.js delete mode 100644 src/plugins/fontWeight.js delete mode 100644 src/plugins/gap.js delete mode 100644 src/plugins/gradientColorStops.js delete mode 100644 src/plugins/grayscale.js delete mode 100644 src/plugins/gridAutoColumns.js delete mode 100644 src/plugins/gridAutoFlow.js delete mode 100644 src/plugins/gridAutoRows.js delete mode 100644 src/plugins/gridColumn.js delete mode 100644 src/plugins/gridColumnEnd.js delete mode 100644 src/plugins/gridColumnStart.js delete mode 100644 src/plugins/gridRow.js delete mode 100644 src/plugins/gridRowEnd.js delete mode 100644 src/plugins/gridRowStart.js delete mode 100644 src/plugins/gridTemplateColumns.js delete mode 100644 src/plugins/gridTemplateRows.js delete mode 100644 src/plugins/height.js delete mode 100644 src/plugins/hueRotate.js delete mode 100644 src/plugins/index.js delete mode 100644 src/plugins/inset.js delete mode 100644 src/plugins/invert.js delete mode 100644 src/plugins/isolation.js delete mode 100644 src/plugins/justifyContent.js delete mode 100644 src/plugins/justifyItems.js delete mode 100644 src/plugins/justifySelf.js delete mode 100644 src/plugins/letterSpacing.js delete mode 100644 src/plugins/lineHeight.js delete mode 100644 src/plugins/listStylePosition.js delete mode 100644 src/plugins/listStyleType.js delete mode 100644 src/plugins/margin.js delete mode 100644 src/plugins/maxHeight.js delete mode 100644 src/plugins/maxWidth.js delete mode 100644 src/plugins/minHeight.js delete mode 100644 src/plugins/minWidth.js delete mode 100644 src/plugins/mixBlendMode.js delete mode 100644 src/plugins/objectFit.js delete mode 100644 src/plugins/objectPosition.js delete mode 100644 src/plugins/opacity.js delete mode 100644 src/plugins/order.js delete mode 100644 src/plugins/outline.js delete mode 100644 src/plugins/overflow.js delete mode 100644 src/plugins/overscrollBehavior.js delete mode 100644 src/plugins/padding.js delete mode 100644 src/plugins/placeContent.js delete mode 100644 src/plugins/placeItems.js delete mode 100644 src/plugins/placeSelf.js delete mode 100644 src/plugins/placeholderColor.js delete mode 100644 src/plugins/placeholderOpacity.js delete mode 100644 src/plugins/pointerEvents.js delete mode 100644 src/plugins/position.js delete mode 100644 src/plugins/preflight.js delete mode 100644 src/plugins/resize.js delete mode 100644 src/plugins/ringColor.js delete mode 100644 src/plugins/ringOffsetColor.js delete mode 100644 src/plugins/ringOffsetWidth.js delete mode 100644 src/plugins/ringOpacity.js delete mode 100644 src/plugins/ringWidth.js delete mode 100644 src/plugins/rotate.js delete mode 100644 src/plugins/saturate.js delete mode 100644 src/plugins/scale.js delete mode 100644 src/plugins/sepia.js delete mode 100644 src/plugins/skew.js delete mode 100644 src/plugins/space.js delete mode 100644 src/plugins/stroke.js delete mode 100644 src/plugins/strokeWidth.js delete mode 100644 src/plugins/tableLayout.js delete mode 100644 src/plugins/textAlign.js delete mode 100644 src/plugins/textColor.js delete mode 100644 src/plugins/textDecoration.js delete mode 100644 src/plugins/textIndent.js delete mode 100644 src/plugins/textOpacity.js delete mode 100644 src/plugins/textOverflow.js delete mode 100644 src/plugins/textTransform.js delete mode 100644 src/plugins/transform.js delete mode 100644 src/plugins/transformOrigin.js delete mode 100644 src/plugins/transitionDelay.js delete mode 100644 src/plugins/transitionDuration.js delete mode 100644 src/plugins/transitionProperty.js delete mode 100644 src/plugins/transitionTimingFunction.js delete mode 100644 src/plugins/translate.js delete mode 100644 src/plugins/userSelect.js delete mode 100644 src/plugins/verticalAlign.js delete mode 100644 src/plugins/visibility.js delete mode 100644 src/plugins/whitespace.js delete mode 100644 src/plugins/width.js delete mode 100644 src/plugins/willChange.js delete mode 100644 src/plugins/wordBreak.js delete mode 100644 src/plugins/zIndex.js diff --git a/scripts/create-plugin-list.js b/scripts/create-plugin-list.js index 6ffef67f5..f57d7f9ab 100644 --- a/scripts/create-plugin-list.js +++ b/scripts/create-plugin-list.js @@ -1,8 +1,8 @@ -import * as corePlugins from '../src/plugins' +import * as corePlugins from '../src/corePlugins' import fs from 'fs' import path from 'path' -const corePluginList = Object.keys(corePlugins) +let corePluginList = Object.keys(corePlugins).filter((plugin) => !plugin.includes('Variants')) fs.writeFileSync( path.join(process.cwd(), 'src', 'corePluginList.js'), diff --git a/src/corePlugins.js b/src/corePlugins.js index 997a44dba..566d75468 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -1,7 +1,15 @@ +import fs from 'fs' import postcss from 'postcss' -import * as corePlugins from './plugins' +import createUtilityPlugin from './util/createUtilityPlugin' import buildMediaQuery from './util/buildMediaQuery' import prefixSelector from './util/prefixSelector' +import parseAnimationValue from './util/parseAnimationValue' +import flattenColorPalette from './util/flattenColorPalette' +import withAlphaVariable, { withAlphaValue } from './util/withAlphaVariable' +import toColorValue from './util/toColorValue' +import isPlainObject from './util/isPlainObject' +import transformThemeValue from './util/transformThemeValue' +import nameClass from './util/nameClass' import { applyPseudoToMarker, updateLastClasses, @@ -9,327 +17,2182 @@ import { transformAllSelectors, transformAllClasses, transformLastClasses, + asList, + asLength, + asLookupValue, } from './util/pluginUtils' +import packageJson from '../package.json' import log from './util/log' -export default { - pseudoElementVariants: function ({ config, addVariant }) { - addVariant( - 'first-letter', - transformAllSelectors((selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter') - }) +// Variant plugins +export let pseudoElementVariants = ({ config, addVariant }) => { + addVariant( + 'first-letter', + transformAllSelectors((selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`first-letter${config('separator')}${className}`, '::first-letter') }) - ) - - addVariant( - 'first-line', - transformAllSelectors((selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`first-line${config('separator')}${className}`, '::first-line') - }) - }) - ) - - addVariant('marker', [ - transformAllSelectors((selector) => { - let variantSelector = updateAllClasses(selector, (className) => { - return `marker${config('separator')}${className}` - }) - - return `${variantSelector} *::marker` - }), - transformAllSelectors((selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`marker${config('separator')}${className}`, '::marker') - }) - }), - ]) - - addVariant('selection', [ - transformAllSelectors((selector) => { - let variantSelector = updateAllClasses(selector, (className) => { - return `selection${config('separator')}${className}` - }) - - return `${variantSelector} *::selection` - }), - transformAllSelectors((selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`selection${config('separator')}${className}`, '::selection') - }) - }), - ]) - - addVariant( - 'before', - transformAllSelectors( - (selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`before${config('separator')}${className}`, '::before') - }) - }, - { - withRule: (rule) => { - let foundContent = false - rule.walkDecls('content', () => { - foundContent = true - }) - if (!foundContent) { - rule.prepend(postcss.decl({ prop: 'content', value: '""' })) - } - }, - } - ) - ) - - addVariant( - 'after', - transformAllSelectors( - (selector) => { - return updateAllClasses(selector, (className, { withPseudo }) => { - return withPseudo(`after${config('separator')}${className}`, '::after') - }) - }, - { - withRule: (rule) => { - let foundContent = false - rule.walkDecls('content', () => { - foundContent = true - }) - if (!foundContent) { - rule.prepend(postcss.decl({ prop: 'content', value: '""' })) - } - }, - } - ) - ) - }, - pseudoClassVariants: function ({ config, addVariant }) { - let pseudoVariants = [ - // Positional - ['first', 'first-child'], - ['last', 'last-child'], - ['only', 'only-child'], - ['odd', 'nth-child(odd)'], - ['even', 'nth-child(even)'], - 'first-of-type', - 'last-of-type', - 'only-of-type', - - // State - 'visited', - 'target', - - // Forms - 'default', - 'checked', - 'indeterminate', - 'placeholder-shown', - 'autofill', - 'required', - 'valid', - 'invalid', - 'in-range', - 'out-of-range', - 'read-only', - - // Content - 'empty', - - // Interactive - 'focus-within', - 'hover', - 'focus', - 'focus-visible', - 'active', - 'disabled', - ] - - for (let variant of pseudoVariants) { - let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] - - addVariant( - variantName, - transformAllClasses((className, { withPseudo }) => { - return withPseudo(`${variantName}${config('separator')}${className}`, `:${state}`) - }) - ) - } - - let groupMarker = prefixSelector(config('prefix'), '.group') - for (let variant of pseudoVariants) { - let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] - let groupVariantName = `group-${variantName}` - - addVariant( - groupVariantName, - transformAllSelectors((selector) => { - let variantSelector = updateAllClasses(selector, (className) => { - if (`.${className}` === groupMarker) return className - return `${groupVariantName}${config('separator')}${className}` - }) - - if (variantSelector === selector) { - return null - } - - return applyPseudoToMarker( - variantSelector, - groupMarker, - state, - (marker, selector) => `${marker} ${selector}` - ) - }) - ) - } - - let peerMarker = prefixSelector(config('prefix'), '.peer') - for (let variant of pseudoVariants) { - let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] - let peerVariantName = `peer-${variantName}` - - addVariant( - peerVariantName, - transformAllSelectors((selector) => { - let variantSelector = updateAllClasses(selector, (className) => { - if (`.${className}` === peerMarker) return className - return `${peerVariantName}${config('separator')}${className}` - }) - - if (variantSelector === selector) { - return null - } - - return applyPseudoToMarker(variantSelector, peerMarker, state, (marker, selector) => - selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}` - ) - }) - ) - } - }, - directionVariants: function ({ config, addVariant }) { - addVariant( - 'ltr', - transformAllSelectors( - (selector) => - `[dir="ltr"] ${updateAllClasses( - selector, - (className) => `ltr${config('separator')}${className}` - )}` - ) - ) - - addVariant( - 'rtl', - transformAllSelectors( - (selector) => - `[dir="rtl"] ${updateAllClasses( - selector, - (className) => `rtl${config('separator')}${className}` - )}` - ) - ) - }, - reducedMotionVariants: function ({ config, addVariant }) { - addVariant( - 'motion-safe', - transformLastClasses( - (className) => { - return `motion-safe${config('separator')}${className}` - }, - { - wrap: () => - postcss.atRule({ - name: 'media', - params: '(prefers-reduced-motion: no-preference)', - }), - } - ) - ) - - addVariant( - 'motion-reduce', - transformLastClasses( - (className) => { - return `motion-reduce${config('separator')}${className}` - }, - { - wrap: () => - postcss.atRule({ - name: 'media', - params: '(prefers-reduced-motion: reduce)', - }), - } - ) - ) - }, - darkVariants: function ({ config, addVariant }) { - let mode = config('darkMode', 'media') - if (mode === false) { - mode = 'media' - log.warn([ - '`darkMode` is set to `false` in your config.', - 'This will behave just like the `media` value.', - ]) - } - - if (mode === 'class') { - addVariant( - 'dark', - transformAllSelectors((selector) => { - let variantSelector = updateLastClasses(selector, (className) => { - return `dark${config('separator')}${className}` - }) - - if (variantSelector === selector) { - return null - } - - let darkSelector = prefixSelector(config('prefix'), `.dark`) - - return `${darkSelector} ${variantSelector}` - }) - ) - } else if (mode === 'media') { - addVariant( - 'dark', - transformLastClasses( - (className) => { - return `dark${config('separator')}${className}` - }, - { - wrap: () => - postcss.atRule({ - name: 'media', - params: '(prefers-color-scheme: dark)', - }), - } - ) - ) - } - }, - screenVariants: function ({ config, theme, addVariant }) { - for (let screen in theme('screens')) { - let size = theme('screens')[screen] - let query = buildMediaQuery(size) - - addVariant( - screen, - transformLastClasses( - (className) => { - return `${screen}${config('separator')}${className}` - }, - { wrap: () => postcss.atRule({ name: 'media', params: query }) } - ) - ) - } - }, - - ...Object.fromEntries( - Object.entries(corePlugins).map(([pluginName, plugin]) => { - return [pluginName, plugin()] }) - ), + ) + + addVariant( + 'first-line', + transformAllSelectors((selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`first-line${config('separator')}${className}`, '::first-line') + }) + }) + ) + + addVariant('marker', [ + transformAllSelectors((selector) => { + let variantSelector = updateAllClasses(selector, (className) => { + return `marker${config('separator')}${className}` + }) + + return `${variantSelector} *::marker` + }), + transformAllSelectors((selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`marker${config('separator')}${className}`, '::marker') + }) + }), + ]) + + addVariant('selection', [ + transformAllSelectors((selector) => { + let variantSelector = updateAllClasses(selector, (className) => { + return `selection${config('separator')}${className}` + }) + + return `${variantSelector} *::selection` + }), + transformAllSelectors((selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`selection${config('separator')}${className}`, '::selection') + }) + }), + ]) + + addVariant( + 'before', + transformAllSelectors( + (selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`before${config('separator')}${className}`, '::before') + }) + }, + { + withRule: (rule) => { + let foundContent = false + rule.walkDecls('content', () => { + foundContent = true + }) + if (!foundContent) { + rule.prepend(postcss.decl({ prop: 'content', value: '""' })) + } + }, + } + ) + ) + + addVariant( + 'after', + transformAllSelectors( + (selector) => { + return updateAllClasses(selector, (className, { withPseudo }) => { + return withPseudo(`after${config('separator')}${className}`, '::after') + }) + }, + { + withRule: (rule) => { + let foundContent = false + rule.walkDecls('content', () => { + foundContent = true + }) + if (!foundContent) { + rule.prepend(postcss.decl({ prop: 'content', value: '""' })) + } + }, + } + ) + ) } + +export let pseudoClassVariants = ({ config, addVariant }) => { + let pseudoVariants = [ + // Positional + ['first', 'first-child'], + ['last', 'last-child'], + ['only', 'only-child'], + ['odd', 'nth-child(odd)'], + ['even', 'nth-child(even)'], + 'first-of-type', + 'last-of-type', + 'only-of-type', + + // State + 'visited', + 'target', + + // Forms + 'default', + 'checked', + 'indeterminate', + 'placeholder-shown', + 'autofill', + 'required', + 'valid', + 'invalid', + 'in-range', + 'out-of-range', + 'read-only', + + // Content + 'empty', + + // Interactive + 'focus-within', + 'hover', + 'focus', + 'focus-visible', + 'active', + 'disabled', + ] + + for (let variant of pseudoVariants) { + let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] + + addVariant( + variantName, + transformAllClasses((className, { withPseudo }) => { + return withPseudo(`${variantName}${config('separator')}${className}`, `:${state}`) + }) + ) + } + + let groupMarker = prefixSelector(config('prefix'), '.group') + for (let variant of pseudoVariants) { + let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] + let groupVariantName = `group-${variantName}` + + addVariant( + groupVariantName, + transformAllSelectors((selector) => { + let variantSelector = updateAllClasses(selector, (className) => { + if (`.${className}` === groupMarker) return className + return `${groupVariantName}${config('separator')}${className}` + }) + + if (variantSelector === selector) { + return null + } + + return applyPseudoToMarker( + variantSelector, + groupMarker, + state, + (marker, selector) => `${marker} ${selector}` + ) + }) + ) + } + + let peerMarker = prefixSelector(config('prefix'), '.peer') + for (let variant of pseudoVariants) { + let [variantName, state] = Array.isArray(variant) ? variant : [variant, variant] + let peerVariantName = `peer-${variantName}` + + addVariant( + peerVariantName, + transformAllSelectors((selector) => { + let variantSelector = updateAllClasses(selector, (className) => { + if (`.${className}` === peerMarker) return className + return `${peerVariantName}${config('separator')}${className}` + }) + + if (variantSelector === selector) { + return null + } + + return applyPseudoToMarker(variantSelector, peerMarker, state, (marker, selector) => + selector.trim().startsWith('~') ? `${marker}${selector}` : `${marker} ~ ${selector}` + ) + }) + ) + } +} + +export let directionVariants = ({ config, addVariant }) => { + addVariant( + 'ltr', + transformAllSelectors( + (selector) => + `[dir="ltr"] ${updateAllClasses( + selector, + (className) => `ltr${config('separator')}${className}` + )}` + ) + ) + + addVariant( + 'rtl', + transformAllSelectors( + (selector) => + `[dir="rtl"] ${updateAllClasses( + selector, + (className) => `rtl${config('separator')}${className}` + )}` + ) + ) +} + +export let reducedMotionVariants = ({ config, addVariant }) => { + addVariant( + 'motion-safe', + transformLastClasses( + (className) => { + return `motion-safe${config('separator')}${className}` + }, + { + wrap: () => + postcss.atRule({ + name: 'media', + params: '(prefers-reduced-motion: no-preference)', + }), + } + ) + ) + + addVariant( + 'motion-reduce', + transformLastClasses( + (className) => { + return `motion-reduce${config('separator')}${className}` + }, + { + wrap: () => + postcss.atRule({ + name: 'media', + params: '(prefers-reduced-motion: reduce)', + }), + } + ) + ) +} + +export let darkVariants = ({ config, addVariant }) => { + let mode = config('darkMode', 'media') + if (mode === false) { + mode = 'media' + log.warn([ + '`darkMode` is set to `false` in your config.', + 'This will behave just like the `media` value.', + ]) + } + + if (mode === 'class') { + addVariant( + 'dark', + transformAllSelectors((selector) => { + let variantSelector = updateLastClasses(selector, (className) => { + return `dark${config('separator')}${className}` + }) + + if (variantSelector === selector) { + return null + } + + let darkSelector = prefixSelector(config('prefix'), `.dark`) + + return `${darkSelector} ${variantSelector}` + }) + ) + } else if (mode === 'media') { + addVariant( + 'dark', + transformLastClasses( + (className) => { + return `dark${config('separator')}${className}` + }, + { + wrap: () => + postcss.atRule({ + name: 'media', + params: '(prefers-color-scheme: dark)', + }), + } + ) + ) + } +} + +export let screenVariants = ({ config, theme, addVariant }) => { + for (let screen in theme('screens')) { + let size = theme('screens')[screen] + let query = buildMediaQuery(size) + + addVariant( + screen, + transformLastClasses( + (className) => { + return `${screen}${config('separator')}${className}` + }, + { wrap: () => postcss.atRule({ name: 'media', params: query }) } + ) + ) + } +} + +// Actual plugins +export let preflight = ({ addBase }) => { + let preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8')) + + addBase([ + postcss.comment({ + text: `! tailwindcss v${packageJson.version} | MIT License | https://tailwindcss.com`, + }), + ...preflightStyles.nodes, + ]) +} + +export let container = (() => { + function extractMinWidths(breakpoints) { + return Object.values(breakpoints ?? {}).flatMap((breakpoints) => { + if (typeof breakpoints === 'string') { + breakpoints = { min: breakpoints } + } + + if (!Array.isArray(breakpoints)) { + breakpoints = [breakpoints] + } + + return breakpoints + .filter((breakpoint) => { + return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width') + }) + .map((breakpoint) => { + return breakpoint['min-width'] ?? breakpoint.min + }) + }) + } + + function mapMinWidthsToPadding(minWidths, screens, paddings) { + if (typeof paddings === 'undefined') { + return [] + } + + if (!(typeof paddings === 'object' && paddings !== null)) { + return [ + { + screen: 'DEFAULT', + minWidth: 0, + padding: paddings, + }, + ] + } + + let mapping = [] + + if (paddings.DEFAULT) { + mapping.push({ + screen: 'DEFAULT', + minWidth: 0, + padding: paddings.DEFAULT, + }) + } + + for (let minWidth of minWidths) { + for (let [screen, value] of Object.entries(screens)) { + let screenMinWidth = + typeof value === 'object' && value !== null ? value.min || value['min-width'] : value + + if (`${screenMinWidth}` === `${minWidth}`) { + mapping.push({ + screen, + minWidth, + padding: paddings[screen], + }) + } + } + } + + return mapping + } + + return function ({ addComponents, theme }) { + let screens = theme('container.screens', theme('screens')) + let minWidths = extractMinWidths(screens) + let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding')) + + let generatePaddingFor = (minWidth) => { + let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`) + + if (!paddingConfig) { + return {} + } + + return { + paddingRight: paddingConfig.padding, + paddingLeft: paddingConfig.padding, + } + } + + let atRules = Array.from( + new Set(minWidths.slice().sort((a, z) => parseInt(a) - parseInt(z))) + ).map((minWidth) => ({ + [`@media (min-width: ${minWidth})`]: { + '.container': { + 'max-width': minWidth, + ...generatePaddingFor(minWidth), + }, + }, + })) + + addComponents([ + { + '.container': Object.assign( + { width: '100%' }, + theme('container.center', false) ? { marginRight: 'auto', marginLeft: 'auto' } : {}, + generatePaddingFor(0) + ), + }, + ...atRules, + ]) + } +})() + +export let accessibility = ({ addUtilities }) => { + addUtilities({ + '.sr-only': { + position: 'absolute', + width: '1px', + height: '1px', + padding: '0', + margin: '-1px', + overflow: 'hidden', + clip: 'rect(0, 0, 0, 0)', + whiteSpace: 'nowrap', + borderWidth: '0', + }, + '.not-sr-only': { + position: 'static', + width: 'auto', + height: 'auto', + padding: '0', + margin: '0', + overflow: 'visible', + clip: 'auto', + whiteSpace: 'normal', + }, + }) +} + +export let pointerEvents = ({ addUtilities }) => { + addUtilities({ + '.pointer-events-none': { 'pointer-events': 'none' }, + '.pointer-events-auto': { 'pointer-events': 'auto' }, + }) +} + +export let visibility = ({ addUtilities }) => { + addUtilities({ + '.visible': { visibility: 'visible' }, + '.invisible': { visibility: 'hidden' }, + }) +} + +export let position = ({ addUtilities }) => { + addUtilities({ + '.static': { position: 'static' }, + '.fixed': { position: 'fixed' }, + '.absolute': { position: 'absolute' }, + '.relative': { position: 'relative' }, + '.sticky': { position: 'sticky' }, + }) +} + +export let inset = ({ matchUtilities, theme }) => { + let options = { + values: theme('inset'), + type: 'any', + } + + matchUtilities( + { inset: (value) => ({ top: value, right: value, bottom: value, left: value }) }, + options + ) + + matchUtilities( + { + 'inset-x': (value) => ({ left: value, right: value }), + 'inset-y': (value) => ({ top: value, bottom: value }), + }, + options + ) + + matchUtilities( + { + top: (top) => ({ top }), + right: (right) => ({ right }), + bottom: (bottom) => ({ bottom }), + left: (left) => ({ left }), + }, + options + ) +} + +export let isolation = ({ addUtilities }) => { + addUtilities({ + '.isolate': { isolation: 'isolate' }, + '.isolation-auto': { isolation: 'auto' }, + }) +} + +export let zIndex = createUtilityPlugin('zIndex', [['z', ['zIndex']]]) +export let order = createUtilityPlugin('order') +export let gridColumn = createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]) +export let gridColumnStart = createUtilityPlugin('gridColumnStart', [ + ['col-start', ['gridColumnStart']], +]) +export let gridColumnEnd = createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]) +export let gridRow = createUtilityPlugin('gridRow', [['row', ['gridRow']]]) +export let gridRowStart = createUtilityPlugin('gridRowStart', [['row-start', ['gridRowStart']]]) +export let gridRowEnd = createUtilityPlugin('gridRowEnd', [['row-end', ['gridRowEnd']]]) + +export let float = ({ addUtilities }) => { + addUtilities({ + '.float-right': { float: 'right' }, + '.float-left': { float: 'left' }, + '.float-none': { float: 'none' }, + }) +} + +export let clear = ({ addUtilities }) => { + addUtilities({ + '.clear-left': { clear: 'left' }, + '.clear-right': { clear: 'right' }, + '.clear-both': { clear: 'both' }, + '.clear-none': { clear: 'none' }, + }) +} + +export let margin = createUtilityPlugin('margin', [ + ['m', ['margin']], + [ + ['mx', ['margin-left', 'margin-right']], + ['my', ['margin-top', 'margin-bottom']], + ], + [ + ['mt', ['margin-top']], + ['mr', ['margin-right']], + ['mb', ['margin-bottom']], + ['ml', ['margin-left']], + ], +]) + +export let boxSizing = ({ addUtilities }) => { + addUtilities({ + '.box-border': { 'box-sizing': 'border-box' }, + '.box-content': { 'box-sizing': 'content-box' }, + }) +} + +export let display = ({ addUtilities }) => { + addUtilities({ + '.block': { display: 'block' }, + '.inline-block': { display: 'inline-block' }, + '.inline': { display: 'inline' }, + '.flex': { display: 'flex' }, + '.inline-flex': { display: 'inline-flex' }, + '.table': { display: 'table' }, + '.inline-table': { display: 'inline-table' }, + '.table-caption': { display: 'table-caption' }, + '.table-cell': { display: 'table-cell' }, + '.table-column': { display: 'table-column' }, + '.table-column-group': { display: 'table-column-group' }, + '.table-footer-group': { display: 'table-footer-group' }, + '.table-header-group': { display: 'table-header-group' }, + '.table-row-group': { display: 'table-row-group' }, + '.table-row': { display: 'table-row' }, + '.flow-root': { display: 'flow-root' }, + '.grid': { display: 'grid' }, + '.inline-grid': { display: 'inline-grid' }, + '.contents': { display: 'contents' }, + '.list-item': { display: 'list-item' }, + '.hidden': { display: 'none' }, + }) +} + +export let aspectRatio = createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]]) +export let height = createUtilityPlugin('height', [['h', ['height']]]) +export let maxHeight = createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]]) +export let minHeight = createUtilityPlugin('minHeight', [['min-h', ['minHeight']]]) +export let width = createUtilityPlugin('width', [['w', ['width']]]) +export let minWidth = createUtilityPlugin('minWidth', [['min-w', ['minWidth']]]) +export let maxWidth = createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]) +export let flex = createUtilityPlugin('flex') +export let flexShrink = createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]]) +export let flexGrow = createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]]) + +export let tableLayout = ({ addUtilities }) => { + addUtilities({ + '.table-auto': { 'table-layout': 'auto' }, + '.table-fixed': { 'table-layout': 'fixed' }, + }) +} + +export let borderCollapse = ({ addUtilities }) => { + addUtilities({ + '.border-collapse': { 'border-collapse': 'collapse' }, + '.border-separate': { 'border-collapse': 'separate' }, + }) +} + +export let transformOrigin = createUtilityPlugin('transformOrigin', [ + ['origin', ['transformOrigin']], +]) +export let translate = createUtilityPlugin('translate', [ + [ + [ + 'translate-x', + [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']], + ], + [ + 'translate-y', + [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']], + ], + ], +]) +export let rotate = createUtilityPlugin('rotate', [ + ['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']]], +]) +export let skew = createUtilityPlugin('skew', [ + [ + ['skew-x', [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']]], + ['skew-y', [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']]], + ], +]) +export let scale = createUtilityPlugin('scale', [ + [ + 'scale', + [ + ['@defaults transform', {}], + '--tw-scale-x', + '--tw-scale-y', + ['transform', 'var(--tw-transform)'], + ], + ], + [ + [ + 'scale-x', + [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']], + ], + [ + 'scale-y', + [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']], + ], + ], +]) + +export let transform = ({ addBase, addUtilities }) => { + addBase({ + '@defaults transform': { + '--tw-translate-x': '0', + '--tw-translate-y': '0', + '--tw-rotate': '0', + '--tw-skew-x': '0', + '--tw-skew-y': '0', + '--tw-scale-x': '1', + '--tw-scale-y': '1', + '--tw-transform': [ + 'translateX(var(--tw-translate-x))', + 'translateY(var(--tw-translate-y))', + 'rotate(var(--tw-rotate))', + 'skewX(var(--tw-skew-x))', + 'skewY(var(--tw-skew-y))', + 'scaleX(var(--tw-scale-x))', + 'scaleY(var(--tw-scale-y))', + ].join(' '), + }, + }) + addUtilities({ + '.transform': { '@defaults transform': {}, transform: 'var(--tw-transform)' }, + '.transform-cpu': { + '--tw-transform': [ + 'translateX(var(--tw-translate-x))', + 'translateY(var(--tw-translate-y))', + 'rotate(var(--tw-rotate))', + 'skewX(var(--tw-skew-x))', + 'skewY(var(--tw-skew-y))', + 'scaleX(var(--tw-scale-x))', + 'scaleY(var(--tw-scale-y))', + ].join(' '), + }, + '.transform-gpu': { + '--tw-transform': [ + 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)', + 'rotate(var(--tw-rotate))', + 'skewX(var(--tw-skew-x))', + 'skewY(var(--tw-skew-y))', + 'scaleX(var(--tw-scale-x))', + 'scaleY(var(--tw-scale-y))', + ].join(' '), + }, + '.transform-none': { transform: 'none' }, + }) +} + +export let animation = ({ matchUtilities, theme, prefix }) => { + let prefixName = (name) => prefix(`.${name}`).slice(1) + let keyframes = Object.fromEntries( + Object.entries(theme('keyframes') ?? {}).map(([key, value]) => { + return [key, [{ [`@keyframes ${prefixName(key)}`]: value }]] + }) + ) + + matchUtilities( + { + animate: (value, { includeRules }) => { + let animations = parseAnimationValue(value) + + for (let { name } of animations) { + if (keyframes[name] !== undefined) { + includeRules(keyframes[name], { respectImportant: false }) + } + } + + return { + animation: animations + .map(({ name, value }) => { + if (name === undefined || keyframes[name] === undefined) { + return value + } + return value.replace(name, prefixName(name)) + }) + .join(', '), + } + }, + }, + { values: theme('animation') } + ) +} + +export let cursor = createUtilityPlugin('cursor') + +export let userSelect = ({ addUtilities }) => { + addUtilities({ + '.select-none': { 'user-select': 'none' }, + '.select-text': { 'user-select': 'text' }, + '.select-all': { 'user-select': 'all' }, + '.select-auto': { 'user-select': 'auto' }, + }) +} + +export let resize = ({ addUtilities }) => { + addUtilities({ + '.resize-none': { resize: 'none' }, + '.resize-y': { resize: 'vertical' }, + '.resize-x': { resize: 'horizontal' }, + '.resize': { resize: 'both' }, + }) +} + +export let listStylePosition = ({ addUtilities }) => { + addUtilities({ + '.list-inside': { 'list-style-position': 'inside' }, + '.list-outside': { 'list-style-position': 'outside' }, + }) +} + +export let listStyleType = createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]) + +export let appearance = ({ addUtilities }) => { + addUtilities({ + '.appearance-none': { appearance: 'none' }, + }) +} + +export let gridAutoColumns = createUtilityPlugin('gridAutoColumns', [ + ['auto-cols', ['gridAutoColumns']], +]) + +export let gridAutoFlow = ({ addUtilities }) => { + addUtilities({ + '.grid-flow-row': { gridAutoFlow: 'row' }, + '.grid-flow-col': { gridAutoFlow: 'column' }, + '.grid-flow-row-dense': { gridAutoFlow: 'row dense' }, + '.grid-flow-col-dense': { gridAutoFlow: 'column dense' }, + }) +} + +export let gridAutoRows = createUtilityPlugin('gridAutoRows', [['auto-rows', ['gridAutoRows']]]) +export let gridTemplateColumns = createUtilityPlugin( + 'gridTemplateColumns', + [['grid-cols', ['gridTemplateColumns']]], + { resolveArbitraryValue: asList } +) +export let gridTemplateRows = createUtilityPlugin( + 'gridTemplateRows', + [['grid-rows', ['gridTemplateRows']]], + { resolveArbitraryValue: asList } +) + +export let flexDirection = ({ addUtilities }) => { + addUtilities({ + '.flex-row': { 'flex-direction': 'row' }, + '.flex-row-reverse': { 'flex-direction': 'row-reverse' }, + '.flex-col': { 'flex-direction': 'column' }, + '.flex-col-reverse': { 'flex-direction': 'column-reverse' }, + }) +} + +export let flexWrap = ({ addUtilities }) => { + addUtilities({ + '.flex-wrap': { 'flex-wrap': 'wrap' }, + '.flex-wrap-reverse': { 'flex-wrap': 'wrap-reverse' }, + '.flex-nowrap': { 'flex-wrap': 'nowrap' }, + }) +} + +export let placeContent = ({ addUtilities }) => { + addUtilities({ + '.place-content-center': { 'place-content': 'center' }, + '.place-content-start': { 'place-content': 'start' }, + '.place-content-end': { 'place-content': 'end' }, + '.place-content-between': { 'place-content': 'space-between' }, + '.place-content-around': { 'place-content': 'space-around' }, + '.place-content-evenly': { 'place-content': 'space-evenly' }, + '.place-content-stretch': { 'place-content': 'stretch' }, + }) +} + +export let placeItems = ({ addUtilities }) => { + addUtilities({ + '.place-items-start': { 'place-items': 'start' }, + '.place-items-end': { 'place-items': 'end' }, + '.place-items-center': { 'place-items': 'center' }, + '.place-items-stretch': { 'place-items': 'stretch' }, + }) +} + +export let alignContent = ({ addUtilities }) => { + addUtilities({ + '.content-center': { 'align-content': 'center' }, + '.content-start': { 'align-content': 'flex-start' }, + '.content-end': { 'align-content': 'flex-end' }, + '.content-between': { 'align-content': 'space-between' }, + '.content-around': { 'align-content': 'space-around' }, + '.content-evenly': { 'align-content': 'space-evenly' }, + }) +} + +export let alignItems = ({ addUtilities }) => { + addUtilities({ + '.items-start': { 'align-items': 'flex-start' }, + '.items-end': { 'align-items': 'flex-end' }, + '.items-center': { 'align-items': 'center' }, + '.items-baseline': { 'align-items': 'baseline' }, + '.items-stretch': { 'align-items': 'stretch' }, + }) +} + +export let justifyContent = ({ addUtilities }) => { + addUtilities({ + '.justify-start': { 'justify-content': 'flex-start' }, + '.justify-end': { 'justify-content': 'flex-end' }, + '.justify-center': { 'justify-content': 'center' }, + '.justify-between': { 'justify-content': 'space-between' }, + '.justify-around': { 'justify-content': 'space-around' }, + '.justify-evenly': { 'justify-content': 'space-evenly' }, + }) +} + +export let justifyItems = ({ addUtilities }) => { + addUtilities({ + '.justify-items-start': { 'justify-items': 'start' }, + '.justify-items-end': { 'justify-items': 'end' }, + '.justify-items-center': { 'justify-items': 'center' }, + '.justify-items-stretch': { 'justify-items': 'stretch' }, + }) +} + +export let gap = createUtilityPlugin('gap', [ + ['gap', ['gap']], + [ + ['gap-x', ['columnGap']], + ['gap-y', ['rowGap']], + ], +]) + +export let space = ({ matchUtilities, addUtilities, theme }) => { + matchUtilities( + { + 'space-x': (value) => { + value = value === '0' ? '0px' : value + + return { + '& > :not([hidden]) ~ :not([hidden])': { + '--tw-space-x-reverse': '0', + 'margin-right': `calc(${value} * var(--tw-space-x-reverse))`, + 'margin-left': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`, + }, + } + }, + 'space-y': (value) => { + value = value === '0' ? '0px' : value + + return { + '& > :not([hidden]) ~ :not([hidden])': { + '--tw-space-y-reverse': '0', + 'margin-top': `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`, + 'margin-bottom': `calc(${value} * var(--tw-space-y-reverse))`, + }, + } + }, + }, + { values: theme('space'), type: 'any' } + ) + + addUtilities({ + '.space-y-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-y-reverse': '1' }, + '.space-x-reverse > :not([hidden]) ~ :not([hidden])': { '--tw-space-x-reverse': '1' }, + }) +} + +export let divideWidth = ({ matchUtilities, addUtilities, theme }) => { + matchUtilities( + { + 'divide-x': (value) => { + value = value === '0' ? '0px' : value + + return { + '& > :not([hidden]) ~ :not([hidden])': { + '@defaults border-width': {}, + '--tw-divide-x-reverse': '0', + 'border-right-width': `calc(${value} * var(--tw-divide-x-reverse))`, + 'border-left-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`, + }, + } + }, + 'divide-y': (value) => { + value = value === '0' ? '0px' : value + + return { + '& > :not([hidden]) ~ :not([hidden])': { + '@defaults border-width': {}, + '--tw-divide-y-reverse': '0', + 'border-top-width': `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`, + 'border-bottom-width': `calc(${value} * var(--tw-divide-y-reverse))`, + }, + } + }, + }, + { values: theme('divideWidth'), type: 'length' } + ) + + addUtilities({ + '.divide-y-reverse > :not([hidden]) ~ :not([hidden])': { + '@defaults border-width': {}, + '--tw-divide-y-reverse': '1', + }, + '.divide-x-reverse > :not([hidden]) ~ :not([hidden])': { + '@defaults border-width': {}, + '--tw-divide-x-reverse': '1', + }, + }) +} + +export let divideStyle = ({ addUtilities }) => { + addUtilities({ + '.divide-solid > :not([hidden]) ~ :not([hidden])': { 'border-style': 'solid' }, + '.divide-dashed > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dashed' }, + '.divide-dotted > :not([hidden]) ~ :not([hidden])': { 'border-style': 'dotted' }, + '.divide-double > :not([hidden]) ~ :not([hidden])': { 'border-style': 'double' }, + '.divide-none > :not([hidden]) ~ :not([hidden])': { 'border-style': 'none' }, + }) +} + +export let divideColor = ({ matchUtilities, theme, corePlugins }) => { + matchUtilities( + { + divide: (value) => { + if (!corePlugins('divideOpacity')) { + return { ['& > :not([hidden]) ~ :not([hidden])']: { 'border-color': value } } + } + + return { + ['& > :not([hidden]) ~ :not([hidden])']: withAlphaVariable({ + color: value, + property: 'border-color', + variable: '--tw-divide-opacity', + }), + } + }, + }, + { + values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))), + type: 'color', + } + ) +} + +export let divideOpacity = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'divide-opacity': (value) => { + return { [`& > :not([hidden]) ~ :not([hidden])`]: { '--tw-divide-opacity': value } } + }, + }, + { values: theme('divideOpacity'), type: 'any' } + ) +} + +export let placeSelf = ({ addUtilities }) => { + addUtilities({ + '.place-self-auto': { 'place-self': 'auto' }, + '.place-self-start': { 'place-self': 'start' }, + '.place-self-end': { 'place-self': 'end' }, + '.place-self-center': { 'place-self': 'center' }, + '.place-self-stretch': { 'place-self': 'stretch' }, + }) +} + +export let alignSelf = ({ addUtilities }) => { + addUtilities({ + '.self-auto': { 'align-self': 'auto' }, + '.self-start': { 'align-self': 'flex-start' }, + '.self-end': { 'align-self': 'flex-end' }, + '.self-center': { 'align-self': 'center' }, + '.self-stretch': { 'align-self': 'stretch' }, + '.self-baseline': { 'align-self': 'baseline' }, + }) +} + +export let justifySelf = ({ addUtilities }) => { + addUtilities({ + '.justify-self-auto': { 'justify-self': 'auto' }, + '.justify-self-start': { 'justify-self': 'start' }, + '.justify-self-end': { 'justify-self': 'end' }, + '.justify-self-center': { 'justify-self': 'center' }, + '.justify-self-stretch': { 'justify-self': 'stretch' }, + }) +} + +export let overflow = ({ addUtilities }) => { + addUtilities({ + '.overflow-auto': { overflow: 'auto' }, + '.overflow-hidden': { overflow: 'hidden' }, + '.overflow-visible': { overflow: 'visible' }, + '.overflow-scroll': { overflow: 'scroll' }, + '.overflow-x-auto': { 'overflow-x': 'auto' }, + '.overflow-y-auto': { 'overflow-y': 'auto' }, + '.overflow-x-hidden': { 'overflow-x': 'hidden' }, + '.overflow-y-hidden': { 'overflow-y': 'hidden' }, + '.overflow-x-visible': { 'overflow-x': 'visible' }, + '.overflow-y-visible': { 'overflow-y': 'visible' }, + '.overflow-x-scroll': { 'overflow-x': 'scroll' }, + '.overflow-y-scroll': { 'overflow-y': 'scroll' }, + }) +} + +export let overscrollBehavior = ({ addUtilities }) => { + addUtilities({ + '.overscroll-auto': { 'overscroll-behavior': 'auto' }, + '.overscroll-contain': { 'overscroll-behavior': 'contain' }, + '.overscroll-none': { 'overscroll-behavior': 'none' }, + '.overscroll-y-auto': { 'overscroll-behavior-y': 'auto' }, + '.overscroll-y-contain': { 'overscroll-behavior-y': 'contain' }, + '.overscroll-y-none': { 'overscroll-behavior-y': 'none' }, + '.overscroll-x-auto': { 'overscroll-behavior-x': 'auto' }, + '.overscroll-x-contain': { 'overscroll-behavior-x': 'contain' }, + '.overscroll-x-none': { 'overscroll-behavior-x': 'none' }, + }) +} + +export let textOverflow = ({ addUtilities }) => { + addUtilities({ + '.truncate': { overflow: 'hidden', 'text-overflow': 'ellipsis', 'white-space': 'nowrap' }, + '.overflow-ellipsis': { 'text-overflow': 'ellipsis' }, + '.overflow-clip': { 'text-overflow': 'clip' }, + }) +} + +export let whitespace = ({ addUtilities }) => { + addUtilities({ + '.whitespace-normal': { 'white-space': 'normal' }, + '.whitespace-nowrap': { 'white-space': 'nowrap' }, + '.whitespace-pre': { 'white-space': 'pre' }, + '.whitespace-pre-line': { 'white-space': 'pre-line' }, + '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' }, + }) +} + +export let wordBreak = ({ addUtilities }) => { + addUtilities({ + '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' }, + '.break-words': { 'overflow-wrap': 'break-word' }, + '.break-all': { 'word-break': 'break-all' }, + }) +} + +export let borderRadius = createUtilityPlugin('borderRadius', [ + ['rounded', ['border-radius']], + [ + ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']], + ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']], + ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']], + ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']], + ], + [ + ['rounded-tl', ['border-top-left-radius']], + ['rounded-tr', ['border-top-right-radius']], + ['rounded-br', ['border-bottom-right-radius']], + ['rounded-bl', ['border-bottom-left-radius']], + ], +]) + +export let borderWidth = createUtilityPlugin( + 'borderWidth', + [ + ['border', [['@defaults border-width', {}], 'border-width']], + [ + ['border-t', [['@defaults border-width', {}], 'border-top-width']], + ['border-r', [['@defaults border-width', {}], 'border-right-width']], + ['border-b', [['@defaults border-width', {}], 'border-bottom-width']], + ['border-l', [['@defaults border-width', {}], 'border-left-width']], + ], + ], + { resolveArbitraryValue: asLength } +) + +export let borderStyle = ({ addUtilities }) => { + addUtilities({ + '.border-solid': { 'border-style': 'solid' }, + '.border-dashed': { 'border-style': 'dashed' }, + '.border-dotted': { 'border-style': 'dotted' }, + '.border-double': { 'border-style': 'double' }, + '.border-none': { 'border-style': 'none' }, + }) +} + +export let borderColor = ({ addBase, matchUtilities, theme, corePlugins }) => { + if (!corePlugins('borderOpacity')) { + addBase({ + '@defaults border-width': { + 'border-color': theme('borderColor.DEFAULT', 'currentColor'), + }, + }) + } else { + addBase({ + '@defaults border-width': withAlphaVariable({ + color: theme('borderColor.DEFAULT', 'currentColor'), + property: 'border-color', + variable: '--tw-border-opacity', + }), + }) + } + + matchUtilities( + { + border: (value) => { + if (!corePlugins('borderOpacity')) { + return { 'border-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'border-color', + variable: '--tw-border-opacity', + }) + }, + }, + { + values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))), + type: 'color', + } + ) + + matchUtilities( + { + 'border-t': (value) => { + if (!corePlugins('borderOpacity')) { + return { 'border-top-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'border-top-color', + variable: '--tw-border-opacity', + }) + }, + 'border-r': (value) => { + if (!corePlugins('borderOpacity')) { + return { 'border-right-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'border-right-color', + variable: '--tw-border-opacity', + }) + }, + 'border-b': (value) => { + if (!corePlugins('borderOpacity')) { + return { 'border-bottom-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'border-bottom-color', + variable: '--tw-border-opacity', + }) + }, + 'border-l': (value) => { + if (!corePlugins('borderOpacity')) { + return { 'border-left-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'border-left-color', + variable: '--tw-border-opacity', + }) + }, + }, + { + values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))), + type: 'color', + } + ) +} + +export let borderOpacity = createUtilityPlugin('borderOpacity', [ + ['border-opacity', ['--tw-border-opacity']], +]) + +export let backgroundColor = ({ matchUtilities, theme, corePlugins }) => { + matchUtilities( + { + bg: (value) => { + if (!corePlugins('backgroundOpacity')) { + return { 'background-color': value } + } + + return withAlphaVariable({ + color: value, + property: 'background-color', + variable: '--tw-bg-opacity', + }) + }, + }, + { values: flattenColorPalette(theme('backgroundColor')), type: 'color' } + ) +} + +export let backgroundOpacity = createUtilityPlugin('backgroundOpacity', [ + ['bg-opacity', ['--tw-bg-opacity']], +]) +export let backgroundImage = createUtilityPlugin( + 'backgroundImage', + [['bg', ['background-image']]], + { resolveArbitraryValue: asLookupValue } +) +export let gradientColorStops = (() => { + function transparentTo(value) { + return withAlphaValue(value, 0, 'rgba(255, 255, 255, 0)') + } + + return function ({ matchUtilities, theme }) { + let options = { + values: flattenColorPalette(theme('gradientColorStops')), + type: ['color', 'any'], + } + + matchUtilities( + { + from: (value) => { + let transparentToValue = transparentTo(value) + + return { + '--tw-gradient-from': toColorValue(value, 'from'), + '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`, + } + }, + }, + options + ) + matchUtilities( + { + via: (value) => { + let transparentToValue = transparentTo(value) + + return { + '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue( + value, + 'via' + )}, var(--tw-gradient-to, ${transparentToValue})`, + } + }, + }, + options + ) + matchUtilities({ to: (value) => ({ '--tw-gradient-to': toColorValue(value, 'to') }) }, options) + } +})() + +export let boxDecorationBreak = ({ addUtilities }) => { + addUtilities({ + '.decoration-slice': { 'box-decoration-break': 'slice' }, + '.decoration-clone': { 'box-decoration-break': 'clone' }, + }) +} + +export let backgroundSize = createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], { + resolveArbitraryValue: asLookupValue, +}) + +export let backgroundAttachment = ({ addUtilities }) => { + addUtilities({ + '.bg-fixed': { 'background-attachment': 'fixed' }, + '.bg-local': { 'background-attachment': 'local' }, + '.bg-scroll': { 'background-attachment': 'scroll' }, + }) +} + +export let backgroundClip = ({ addUtilities }) => { + addUtilities({ + '.bg-clip-border': { 'background-clip': 'border-box' }, + '.bg-clip-padding': { 'background-clip': 'padding-box' }, + '.bg-clip-content': { 'background-clip': 'content-box' }, + '.bg-clip-text': { 'background-clip': 'text' }, + }) +} + +export let backgroundPosition = createUtilityPlugin( + 'backgroundPosition', + [['bg', ['background-position']]], + { resolveArbitraryValue: asLookupValue } +) + +export let backgroundRepeat = ({ addUtilities }) => { + addUtilities({ + '.bg-repeat': { 'background-repeat': 'repeat' }, + '.bg-no-repeat': { 'background-repeat': 'no-repeat' }, + '.bg-repeat-x': { 'background-repeat': 'repeat-x' }, + '.bg-repeat-y': { 'background-repeat': 'repeat-y' }, + '.bg-repeat-round': { 'background-repeat': 'round' }, + '.bg-repeat-space': { 'background-repeat': 'space' }, + }) +} + +export let backgroundOrigin = ({ addUtilities }) => { + addUtilities({ + '.bg-origin-border': { 'background-origin': 'border-box' }, + '.bg-origin-padding': { 'background-origin': 'padding-box' }, + '.bg-origin-content': { 'background-origin': 'content-box' }, + }) +} + +export let fill = ({ matchUtilities, theme }) => { + matchUtilities( + { + fill: (value) => { + return { fill: toColorValue(value) } + }, + }, + { values: flattenColorPalette(theme('fill')), type: ['color', 'any'] } + ) +} + +export let stroke = ({ matchUtilities, theme }) => { + matchUtilities( + { + stroke: (value) => { + return { stroke: toColorValue(value) } + }, + }, + { values: flattenColorPalette(theme('stroke')), type: 'color' } + ) +} + +export let strokeWidth = createUtilityPlugin('strokeWidth', [['stroke', ['stroke-width']]], { + resolveArbitraryValue: asLength, +}) + +export let objectFit = ({ addUtilities }) => { + addUtilities({ + '.object-contain': { 'object-fit': 'contain' }, + '.object-cover': { 'object-fit': 'cover' }, + '.object-fill': { 'object-fit': 'fill' }, + '.object-none': { 'object-fit': 'none' }, + '.object-scale-down': { 'object-fit': 'scale-down' }, + }) +} + +export let objectPosition = createUtilityPlugin( + 'objectPosition', + [['object', ['object-position']]], + { resolveArbitraryValue: asList } +) +export let padding = createUtilityPlugin('padding', [ + ['p', ['padding']], + [ + ['px', ['padding-left', 'padding-right']], + ['py', ['padding-top', 'padding-bottom']], + ], + [ + ['pt', ['padding-top']], + ['pr', ['padding-right']], + ['pb', ['padding-bottom']], + ['pl', ['padding-left']], + ], +]) + +export let textAlign = ({ addUtilities }) => { + addUtilities({ + '.text-left': { 'text-align': 'left' }, + '.text-center': { 'text-align': 'center' }, + '.text-right': { 'text-align': 'right' }, + '.text-justify': { 'text-align': 'justify' }, + }) +} + +export let textIndent = createUtilityPlugin('textIndent', [['indent', ['text-indent']]]) + +export let verticalAlign = ({ addUtilities }) => { + addUtilities({ + '.align-baseline': { 'vertical-align': 'baseline' }, + '.align-top': { 'vertical-align': 'top' }, + '.align-middle': { 'vertical-align': 'middle' }, + '.align-bottom': { 'vertical-align': 'bottom' }, + '.align-text-top': { 'vertical-align': 'text-top' }, + '.align-text-bottom': { 'vertical-align': 'text-bottom' }, + }) +} + +export let fontFamily = createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], { + resolveArbitraryValue: asLookupValue, +}) + +export let fontSize = ({ matchUtilities, theme }) => { + matchUtilities( + { + text: (value) => { + let [fontSize, options] = Array.isArray(value) ? value : [value] + let { lineHeight, letterSpacing } = isPlainObject(options) + ? options + : { lineHeight: options } + + return { + 'font-size': fontSize, + ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }), + ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }), + } + }, + }, + { values: theme('fontSize'), type: 'length' } + ) +} + +export let fontWeight = createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], { + resolveArbitraryValue: asLookupValue, +}) + +export let textTransform = ({ addUtilities }) => { + addUtilities({ + '.uppercase': { 'text-transform': 'uppercase' }, + '.lowercase': { 'text-transform': 'lowercase' }, + '.capitalize': { 'text-transform': 'capitalize' }, + '.normal-case': { 'text-transform': 'none' }, + }) +} + +export let fontStyle = ({ addUtilities }) => { + addUtilities({ + '.italic': { 'font-style': 'italic' }, + '.not-italic': { 'font-style': 'normal' }, + }) +} + +export let fontVariantNumeric = ({ addUtilities }) => { + addUtilities({ + '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions': + { + '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)', + 'font-variant-numeric': + 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)', + }, + '.normal-nums': { 'font-variant-numeric': 'normal' }, + '.ordinal': { '--tw-ordinal': 'ordinal' }, + '.slashed-zero': { '--tw-slashed-zero': 'slashed-zero' }, + '.lining-nums': { '--tw-numeric-figure': 'lining-nums' }, + '.oldstyle-nums': { '--tw-numeric-figure': 'oldstyle-nums' }, + '.proportional-nums': { '--tw-numeric-spacing': 'proportional-nums' }, + '.tabular-nums': { '--tw-numeric-spacing': 'tabular-nums' }, + '.diagonal-fractions': { '--tw-numeric-fraction': 'diagonal-fractions' }, + '.stacked-fractions': { '--tw-numeric-fraction': 'stacked-fractions' }, + }) +} + +export let lineHeight = createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]) +export let letterSpacing = createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]]) + +export let textColor = ({ matchUtilities, theme, corePlugins }) => { + matchUtilities( + { + text: (value) => { + if (!corePlugins('textOpacity')) { + return { color: value } + } + + return withAlphaVariable({ + color: value, + property: 'color', + variable: '--tw-text-opacity', + }) + }, + }, + { values: flattenColorPalette(theme('textColor')), type: 'color' } + ) +} + +export let textOpacity = createUtilityPlugin('textOpacity', [ + ['text-opacity', ['--tw-text-opacity']], +]) + +export let textDecoration = ({ addUtilities }) => { + addUtilities({ + '.underline': { 'text-decoration': 'underline' }, + '.line-through': { 'text-decoration': 'line-through' }, + '.no-underline': { 'text-decoration': 'none' }, + }) +} + +export let fontSmoothing = ({ addUtilities }) => { + addUtilities({ + '.antialiased': { + '-webkit-font-smoothing': 'antialiased', + '-moz-osx-font-smoothing': 'grayscale', + }, + '.subpixel-antialiased': { + '-webkit-font-smoothing': 'auto', + '-moz-osx-font-smoothing': 'auto', + }, + }) +} + +export let placeholderColor = ({ matchUtilities, theme, corePlugins }) => { + matchUtilities( + { + placeholder: (value) => { + if (!corePlugins('placeholderOpacity')) { + return { '&::placeholder': { color: value } } + } + + return { + '&::placeholder': withAlphaVariable({ + color: value, + property: 'color', + variable: '--tw-placeholder-opacity', + }), + } + }, + }, + { values: flattenColorPalette(theme('placeholderColor')), type: ['color', 'any'] } + ) +} + +export let placeholderOpacity = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'placeholder-opacity': (value) => { + return { ['&::placeholder']: { '--tw-placeholder-opacity': value } } + }, + }, + { values: theme('placeholderOpacity'), type: 'any' } + ) +} + +export let caretColor = ({ matchUtilities, theme }) => { + matchUtilities( + { + caret: (value) => { + return { 'caret-color': toColorValue(value) } + }, + }, + { values: flattenColorPalette(theme('caretColor')), type: ['color', 'any'] } + ) +} + +export let accentColor = ({ matchUtilities, theme }) => { + matchUtilities( + { + accent: (value) => { + return { 'accent-color': toColorValue(value) } + }, + }, + { values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] } + ) +} + +export let opacity = createUtilityPlugin('opacity', [['opacity', ['opacity']]]) + +export let backgroundBlendMode = ({ addUtilities }) => { + addUtilities({ + '.bg-blend-normal': { 'background-blend-mode': 'normal' }, + '.bg-blend-multiply': { 'background-blend-mode': 'multiply' }, + '.bg-blend-screen': { 'background-blend-mode': 'screen' }, + '.bg-blend-overlay': { 'background-blend-mode': 'overlay' }, + '.bg-blend-darken': { 'background-blend-mode': 'darken' }, + '.bg-blend-lighten': { 'background-blend-mode': 'lighten' }, + '.bg-blend-color-dodge': { 'background-blend-mode': 'color-dodge' }, + '.bg-blend-color-burn': { 'background-blend-mode': 'color-burn' }, + '.bg-blend-hard-light': { 'background-blend-mode': 'hard-light' }, + '.bg-blend-soft-light': { 'background-blend-mode': 'soft-light' }, + '.bg-blend-difference': { 'background-blend-mode': 'difference' }, + '.bg-blend-exclusion': { 'background-blend-mode': 'exclusion' }, + '.bg-blend-hue': { 'background-blend-mode': 'hue' }, + '.bg-blend-saturation': { 'background-blend-mode': 'saturation' }, + '.bg-blend-color': { 'background-blend-mode': 'color' }, + '.bg-blend-luminosity': { 'background-blend-mode': 'luminosity' }, + }) +} + +export let mixBlendMode = ({ addUtilities }) => { + addUtilities({ + '.mix-blend-normal': { 'mix-blend-mode': 'normal' }, + '.mix-blend-multiply': { 'mix-blend-mode': 'multiply' }, + '.mix-blend-screen': { 'mix-blend-mode': 'screen' }, + '.mix-blend-overlay': { 'mix-blend-mode': 'overlay' }, + '.mix-blend-darken': { 'mix-blend-mode': 'darken' }, + '.mix-blend-lighten': { 'mix-blend-mode': 'lighten' }, + '.mix-blend-color-dodge': { 'mix-blend-mode': 'color-dodge' }, + '.mix-blend-color-burn': { 'mix-blend-mode': 'color-burn' }, + '.mix-blend-hard-light': { 'mix-blend-mode': 'hard-light' }, + '.mix-blend-soft-light': { 'mix-blend-mode': 'soft-light' }, + '.mix-blend-difference': { 'mix-blend-mode': 'difference' }, + '.mix-blend-exclusion': { 'mix-blend-mode': 'exclusion' }, + '.mix-blend-hue': { 'mix-blend-mode': 'hue' }, + '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' }, + '.mix-blend-color': { 'mix-blend-mode': 'color' }, + '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' }, + }) +} + +export let boxShadow = (() => { + let transformValue = transformThemeValue('boxShadow') + let defaultBoxShadow = [ + `var(--tw-ring-offset-shadow, 0 0 #0000)`, + `var(--tw-ring-shadow, 0 0 #0000)`, + `var(--tw-shadow)`, + ].join(', ') + + return function ({ matchUtilities, addBase, theme }) { + addBase({ + '@defaults box-shadow': { + '--tw-ring-offset-shadow': '0 0 #0000', + '--tw-ring-shadow': '0 0 #0000', + '--tw-shadow': '0 0 #0000', + }, + }) + + matchUtilities( + { + shadow: (value) => { + value = transformValue(value) + + return { + '@defaults box-shadow': {}, + '--tw-shadow': value === 'none' ? '0 0 #0000' : value, + 'box-shadow': defaultBoxShadow, + } + }, + }, + { values: theme('boxShadow'), type: 'lookup' } + ) + } +})() + +export let outline = ({ matchUtilities, theme }) => { + matchUtilities( + { + outline: (value) => { + let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [value] + + return { outline, 'outline-offset': outlineOffset } + }, + }, + { values: theme('outline'), type: 'any' } + ) +} + +export let ringWidth = ({ matchUtilities, addBase, addUtilities, theme }) => { + let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5') + let ringColorDefault = withAlphaValue( + theme('ringColor.DEFAULT'), + ringOpacityDefault, + `rgba(147, 197, 253, ${ringOpacityDefault})` + ) + + addBase({ + '@defaults ring-width': { + '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'), + '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'), + '--tw-ring-color': ringColorDefault, + '--tw-ring-offset-shadow': '0 0 #0000', + '--tw-ring-shadow': '0 0 #0000', + '--tw-shadow': '0 0 #0000', + }, + }) + + matchUtilities( + { + ring: (value) => { + return { + '@defaults ring-width': {}, + '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, + '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, + 'box-shadow': [ + `var(--tw-ring-offset-shadow)`, + `var(--tw-ring-shadow)`, + `var(--tw-shadow, 0 0 #0000)`, + ].join(', '), + } + }, + }, + { values: theme('ringWidth'), type: 'length' } + ) + + addUtilities({ + '.ring-inset': { '@defaults ring-width': {}, '--tw-ring-inset': 'inset' }, + }) +} + +export let ringColor = ({ matchUtilities, theme }) => { + matchUtilities( + { + ring: (value) => { + return withAlphaVariable({ + color: value, + property: '--tw-ring-color', + variable: '--tw-ring-opacity', + }) + }, + }, + { + values: Object.fromEntries( + Object.entries(flattenColorPalette(theme('ringColor'))).filter( + ([modifier]) => modifier !== 'DEFAULT' + ) + ), + type: 'color', + } + ) +} + +export let ringOpacity = createUtilityPlugin( + 'ringOpacity', + [['ring-opacity', ['--tw-ring-opacity']]], + { filterDefault: true } +) +export let ringOffsetWidth = createUtilityPlugin( + 'ringOffsetWidth', + [['ring-offset', ['--tw-ring-offset-width']]], + { resolveArbitraryValue: asLength } +) + +export let ringOffsetColor = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'ring-offset': (value) => { + return { + '--tw-ring-offset-color': toColorValue(value), + } + }, + }, + { values: flattenColorPalette(theme('ringOffsetColor')), type: 'color' } + ) +} + +export let blur = ({ matchUtilities, theme }) => { + matchUtilities( + { + blur: (value) => { + return { + '--tw-blur': `blur(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('blur'), type: 'any' } + ) +} + +export let brightness = ({ matchUtilities, theme }) => { + matchUtilities( + { + brightness: (value) => { + return { + '--tw-brightness': `brightness(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('brightness'), type: 'any' } + ) +} + +export let contrast = ({ matchUtilities, theme }) => { + matchUtilities( + { + contrast: (value) => { + return { + '--tw-contrast': `contrast(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('contrast'), type: 'any' } + ) +} + +export let dropShadow = ({ addUtilities, theme }) => { + let utilities = Object.fromEntries( + Object.entries(theme('dropShadow') ?? {}).map(([modifier, value]) => { + return [ + nameClass('drop-shadow', modifier), + { + '--tw-drop-shadow': Array.isArray(value) + ? value.map((v) => `drop-shadow(${v})`).join(' ') + : `drop-shadow(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + }, + ] + }) + ) + + addUtilities(utilities) +} + +export let grayscale = ({ matchUtilities, theme }) => { + matchUtilities( + { + grayscale: (value) => { + return { + '--tw-grayscale': `grayscale(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('grayscale'), type: 'any' } + ) +} + +export let hueRotate = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'hue-rotate': (value) => { + return { + '--tw-hue-rotate': `hue-rotate(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('hueRotate'), type: 'any' } + ) +} + +export let invert = ({ matchUtilities, theme }) => { + matchUtilities( + { + invert: (value) => { + return { + '--tw-invert': `invert(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('invert'), type: 'any' } + ) +} + +export let saturate = ({ matchUtilities, theme }) => { + matchUtilities( + { + saturate: (value) => { + return { + '--tw-saturate': `saturate(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('saturate'), type: 'any' } + ) +} + +export let sepia = ({ matchUtilities, theme }) => { + matchUtilities( + { + sepia: (value) => { + return { + '--tw-sepia': `sepia(${value})`, + '@defaults filter': {}, + filter: 'var(--tw-filter)', + } + }, + }, + { values: theme('sepia'), type: 'any' } + ) +} + +export let filter = ({ addBase, addUtilities }) => { + addBase({ + '@defaults filter': { + '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-filter': [ + 'var(--tw-blur)', + 'var(--tw-brightness)', + 'var(--tw-contrast)', + 'var(--tw-grayscale)', + 'var(--tw-hue-rotate)', + 'var(--tw-invert)', + 'var(--tw-saturate)', + 'var(--tw-sepia)', + 'var(--tw-drop-shadow)', + ].join(' '), + }, + }) + addUtilities({ + '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' }, + '.filter-none': { filter: 'none' }, + }) +} + +export let backdropBlur = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-blur': (value) => { + return { + '--tw-backdrop-blur': `blur(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropBlur'), type: 'any' } + ) +} + +export let backdropBrightness = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-brightness': (value) => { + return { + '--tw-backdrop-brightness': `brightness(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropBrightness'), type: 'any' } + ) +} + +export let backdropContrast = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-contrast': (value) => { + return { + '--tw-backdrop-contrast': `contrast(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropContrast'), type: 'any' } + ) +} + +export let backdropGrayscale = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-grayscale': (value) => { + return { + '--tw-backdrop-grayscale': `grayscale(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropGrayscale'), type: 'any' } + ) +} + +export let backdropHueRotate = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-hue-rotate': (value) => { + return { + '--tw-backdrop-hue-rotate': `hue-rotate(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropHueRotate'), type: 'any' } + ) +} + +export let backdropInvert = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-invert': (value) => { + return { + '--tw-backdrop-invert': `invert(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropInvert'), type: 'any' } + ) +} + +export let backdropOpacity = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-opacity': (value) => { + return { + '--tw-backdrop-opacity': `opacity(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropOpacity'), type: 'any' } + ) +} + +export let backdropSaturate = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-saturate': (value) => { + return { + '--tw-backdrop-saturate': `saturate(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropSaturate'), type: 'any' } + ) +} + +export let backdropSepia = ({ matchUtilities, theme }) => { + matchUtilities( + { + 'backdrop-sepia': (value) => { + return { + '--tw-backdrop-sepia': `sepia(${value})`, + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + } + }, + }, + { values: theme('backdropSepia'), type: 'any' } + ) +} + +export let backdropFilter = ({ addBase, addUtilities }) => { + addBase({ + '@defaults backdrop-filter': { + '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)', + '--tw-backdrop-filter': [ + 'var(--tw-backdrop-blur)', + 'var(--tw-backdrop-brightness)', + 'var(--tw-backdrop-contrast)', + 'var(--tw-backdrop-grayscale)', + 'var(--tw-backdrop-hue-rotate)', + 'var(--tw-backdrop-invert)', + 'var(--tw-backdrop-opacity)', + 'var(--tw-backdrop-saturate)', + 'var(--tw-backdrop-sepia)', + ].join(' '), + }, + }) + addUtilities({ + '.backdrop-filter': { + '@defaults backdrop-filter': {}, + 'backdrop-filter': 'var(--tw-backdrop-filter)', + }, + '.backdrop-filter-none': { 'backdrop-filter': 'none' }, + }) +} + +export let transitionProperty = ({ matchUtilities, theme }) => { + let defaultTimingFunction = theme('transitionTimingFunction.DEFAULT') + let defaultDuration = theme('transitionDuration.DEFAULT') + + matchUtilities( + { + transition: (value) => { + return { + 'transition-property': value, + ...(value === 'none' + ? {} + : { + 'transition-timing-function': defaultTimingFunction, + 'transition-duration': defaultDuration, + }), + } + }, + }, + { values: theme('transitionProperty'), type: 'lookup' } + ) +} + +export let transitionDelay = createUtilityPlugin('transitionDelay', [ + ['delay', ['transitionDelay']], +]) +export let transitionDuration = createUtilityPlugin( + 'transitionDuration', + [['duration', ['transitionDuration']]], + { filterDefault: true } +) +export let transitionTimingFunction = createUtilityPlugin( + 'transitionTimingFunction', + [['ease', ['transitionTimingFunction']]], + { filterDefault: true } +) +export let willChange = createUtilityPlugin('willChange', [['will-change', ['will-change']]]) +export let content = createUtilityPlugin('content') diff --git a/src/plugins/css/LICENSE b/src/css/LICENSE similarity index 100% rename from src/plugins/css/LICENSE rename to src/css/LICENSE diff --git a/src/plugins/css/preflight.css b/src/css/preflight.css similarity index 100% rename from src/plugins/css/preflight.css rename to src/css/preflight.css diff --git a/src/lib/setupContextUtils.js b/src/lib/setupContextUtils.js index 9c37f968f..2762ce033 100644 --- a/src/lib/setupContextUtils.js +++ b/src/lib/setupContextUtils.js @@ -12,7 +12,7 @@ import escapeClassName from '../util/escapeClassName' import nameClass from '../util/nameClass' import { coerceValue } from '../util/pluginUtils' import bigSign from '../util/bigSign' -import corePlugins from '../corePlugins' +import * as corePlugins from '../corePlugins' import * as sharedState from './sharedState' import { env } from './sharedState' import { toPath } from '../util/toPath' diff --git a/src/plugins/accentColor.js b/src/plugins/accentColor.js deleted file mode 100644 index 5bb0b800d..000000000 --- a/src/plugins/accentColor.js +++ /dev/null @@ -1,19 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - accent: (value) => { - return { 'accent-color': toColorValue(value) } - }, - }, - { - values: flattenColorPalette(theme('accentColor')), - variants: variants('accentColor'), - type: ['color', 'any'], - } - ) - } -} diff --git a/src/plugins/accessibility.js b/src/plugins/accessibility.js deleted file mode 100644 index 59fe60d22..000000000 --- a/src/plugins/accessibility.js +++ /dev/null @@ -1,30 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.sr-only': { - position: 'absolute', - width: '1px', - height: '1px', - padding: '0', - margin: '-1px', - overflow: 'hidden', - clip: 'rect(0, 0, 0, 0)', - whiteSpace: 'nowrap', - borderWidth: '0', - }, - '.not-sr-only': { - position: 'static', - width: 'auto', - height: 'auto', - padding: '0', - margin: '0', - overflow: 'visible', - clip: 'auto', - whiteSpace: 'normal', - }, - }, - variants('accessibility') - ) - } -} diff --git a/src/plugins/alignContent.js b/src/plugins/alignContent.js deleted file mode 100644 index 1385fb461..000000000 --- a/src/plugins/alignContent.js +++ /dev/null @@ -1,27 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.content-center': { - 'align-content': 'center', - }, - '.content-start': { - 'align-content': 'flex-start', - }, - '.content-end': { - 'align-content': 'flex-end', - }, - '.content-between': { - 'align-content': 'space-between', - }, - '.content-around': { - 'align-content': 'space-around', - }, - '.content-evenly': { - 'align-content': 'space-evenly', - }, - }, - variants('alignContent') - ) - } -} diff --git a/src/plugins/alignItems.js b/src/plugins/alignItems.js deleted file mode 100644 index efac021aa..000000000 --- a/src/plugins/alignItems.js +++ /dev/null @@ -1,24 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.items-start': { - 'align-items': 'flex-start', - }, - '.items-end': { - 'align-items': 'flex-end', - }, - '.items-center': { - 'align-items': 'center', - }, - '.items-baseline': { - 'align-items': 'baseline', - }, - '.items-stretch': { - 'align-items': 'stretch', - }, - }, - variants('alignItems') - ) - } -} diff --git a/src/plugins/alignSelf.js b/src/plugins/alignSelf.js deleted file mode 100644 index 1ff0696aa..000000000 --- a/src/plugins/alignSelf.js +++ /dev/null @@ -1,27 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.self-auto': { - 'align-self': 'auto', - }, - '.self-start': { - 'align-self': 'flex-start', - }, - '.self-end': { - 'align-self': 'flex-end', - }, - '.self-center': { - 'align-self': 'center', - }, - '.self-stretch': { - 'align-self': 'stretch', - }, - '.self-baseline': { - 'align-self': 'baseline', - }, - }, - variants('alignSelf') - ) - } -} diff --git a/src/plugins/animation.js b/src/plugins/animation.js deleted file mode 100644 index 6241affd7..000000000 --- a/src/plugins/animation.js +++ /dev/null @@ -1,45 +0,0 @@ -import parseAnimationValue from '../util/parseAnimationValue' - -export default function () { - return function ({ matchUtilities, theme, variants, prefix }) { - let prefixName = (name) => prefix(`.${name}`).slice(1) - let keyframes = Object.fromEntries( - Object.entries(theme('keyframes') ?? {}).map(([key, value]) => { - return [ - key, - [ - { - [`@keyframes ${prefixName(key)}`]: value, - }, - ], - ] - }) - ) - - matchUtilities( - { - animate: (value, { includeRules }) => { - let animations = parseAnimationValue(value) - - for (let { name } of animations) { - if (keyframes[name] !== undefined) { - includeRules(keyframes[name], { respectImportant: false }) - } - } - - return { - animation: animations - .map(({ name, value }) => { - if (name === undefined || keyframes[name] === undefined) { - return value - } - return value.replace(name, prefixName(name)) - }) - .join(', '), - } - }, - }, - { values: theme('animation'), variants: variants('animation') } - ) - } -} diff --git a/src/plugins/appearance.js b/src/plugins/appearance.js deleted file mode 100644 index 40b054398..000000000 --- a/src/plugins/appearance.js +++ /dev/null @@ -1,10 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.appearance-none': { appearance: 'none' }, - }, - variants('appearance') - ) - } -} diff --git a/src/plugins/aspectRatio.js b/src/plugins/aspectRatio.js deleted file mode 100644 index 15310b045..000000000 --- a/src/plugins/aspectRatio.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]]) -} diff --git a/src/plugins/backdropBlur.js b/src/plugins/backdropBlur.js deleted file mode 100644 index 026ba0f26..000000000 --- a/src/plugins/backdropBlur.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-blur': (value) => { - return { - '--tw-backdrop-blur': `blur(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropBlur'), - variants: variants('backdropBlur'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropBrightness.js b/src/plugins/backdropBrightness.js deleted file mode 100644 index eae3e31bc..000000000 --- a/src/plugins/backdropBrightness.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-brightness': (value) => { - return { - '--tw-backdrop-brightness': `brightness(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropBrightness'), - variants: variants('backdropBrightness'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropContrast.js b/src/plugins/backdropContrast.js deleted file mode 100644 index 5d55dfe5d..000000000 --- a/src/plugins/backdropContrast.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-contrast': (value) => { - return { - '--tw-backdrop-contrast': `contrast(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropContrast'), - variants: variants('backdropContrast'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropFilter.js b/src/plugins/backdropFilter.js deleted file mode 100644 index 1aea43a48..000000000 --- a/src/plugins/backdropFilter.js +++ /dev/null @@ -1,38 +0,0 @@ -export default function () { - return function ({ addBase, addUtilities, variants }) { - addBase({ - '@defaults backdrop-filter': { - '--tw-backdrop-blur': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-brightness': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-contrast': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-grayscale': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-invert': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-opacity': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-saturate': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-sepia': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-backdrop-filter': [ - 'var(--tw-backdrop-blur)', - 'var(--tw-backdrop-brightness)', - 'var(--tw-backdrop-contrast)', - 'var(--tw-backdrop-grayscale)', - 'var(--tw-backdrop-hue-rotate)', - 'var(--tw-backdrop-invert)', - 'var(--tw-backdrop-opacity)', - 'var(--tw-backdrop-saturate)', - 'var(--tw-backdrop-sepia)', - ].join(' '), - }, - }) - addUtilities( - { - '.backdrop-filter': { - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - }, - '.backdrop-filter-none': { 'backdrop-filter': 'none' }, - }, - variants('backdropFilter') - ) - } -} diff --git a/src/plugins/backdropGrayscale.js b/src/plugins/backdropGrayscale.js deleted file mode 100644 index 6cc950837..000000000 --- a/src/plugins/backdropGrayscale.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-grayscale': (value) => { - return { - '--tw-backdrop-grayscale': `grayscale(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropGrayscale'), - variants: variants('backdropGrayscale'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropHueRotate.js b/src/plugins/backdropHueRotate.js deleted file mode 100644 index 7c5f3d02b..000000000 --- a/src/plugins/backdropHueRotate.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-hue-rotate': (value) => { - return { - '--tw-backdrop-hue-rotate': `hue-rotate(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropHueRotate'), - variants: variants('backdropHueRotate'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropInvert.js b/src/plugins/backdropInvert.js deleted file mode 100644 index c3921c09d..000000000 --- a/src/plugins/backdropInvert.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-invert': (value) => { - return { - '--tw-backdrop-invert': `invert(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropInvert'), - variants: variants('backdropInvert'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropOpacity.js b/src/plugins/backdropOpacity.js deleted file mode 100644 index 42b61dd30..000000000 --- a/src/plugins/backdropOpacity.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-opacity': (value) => { - return { - '--tw-backdrop-opacity': `opacity(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropOpacity'), - variants: variants('backdropOpacity'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropSaturate.js b/src/plugins/backdropSaturate.js deleted file mode 100644 index c6919f0ad..000000000 --- a/src/plugins/backdropSaturate.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-saturate': (value) => { - return { - '--tw-backdrop-saturate': `saturate(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropSaturate'), - variants: variants('backdropSaturate'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backdropSepia.js b/src/plugins/backdropSepia.js deleted file mode 100644 index 2c18872b0..000000000 --- a/src/plugins/backdropSepia.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'backdrop-sepia': (value) => { - return { - '--tw-backdrop-sepia': `sepia(${value})`, - '@defaults backdrop-filter': {}, - 'backdrop-filter': 'var(--tw-backdrop-filter)', - } - }, - }, - { - values: theme('backdropSepia'), - variants: variants('backdropSepia'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/backgroundAttachment.js b/src/plugins/backgroundAttachment.js deleted file mode 100644 index 854eb4ae0..000000000 --- a/src/plugins/backgroundAttachment.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.bg-fixed': { 'background-attachment': 'fixed' }, - '.bg-local': { 'background-attachment': 'local' }, - '.bg-scroll': { 'background-attachment': 'scroll' }, - }, - variants('backgroundAttachment') - ) - } -} diff --git a/src/plugins/backgroundBlendMode.js b/src/plugins/backgroundBlendMode.js deleted file mode 100644 index 351e49615..000000000 --- a/src/plugins/backgroundBlendMode.js +++ /dev/null @@ -1,25 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.bg-blend-normal': { 'background-blend-mode': 'normal' }, - '.bg-blend-multiply': { 'background-blend-mode': 'multiply' }, - '.bg-blend-screen': { 'background-blend-mode': 'screen' }, - '.bg-blend-overlay': { 'background-blend-mode': 'overlay' }, - '.bg-blend-darken': { 'background-blend-mode': 'darken' }, - '.bg-blend-lighten': { 'background-blend-mode': 'lighten' }, - '.bg-blend-color-dodge': { 'background-blend-mode': 'color-dodge' }, - '.bg-blend-color-burn': { 'background-blend-mode': 'color-burn' }, - '.bg-blend-hard-light': { 'background-blend-mode': 'hard-light' }, - '.bg-blend-soft-light': { 'background-blend-mode': 'soft-light' }, - '.bg-blend-difference': { 'background-blend-mode': 'difference' }, - '.bg-blend-exclusion': { 'background-blend-mode': 'exclusion' }, - '.bg-blend-hue': { 'background-blend-mode': 'hue' }, - '.bg-blend-saturation': { 'background-blend-mode': 'saturation' }, - '.bg-blend-color': { 'background-blend-mode': 'color' }, - '.bg-blend-luminosity': { 'background-blend-mode': 'luminosity' }, - }, - variants('backgroundBlendMode') - ) - } -} diff --git a/src/plugins/backgroundClip.js b/src/plugins/backgroundClip.js deleted file mode 100644 index ab937c6a6..000000000 --- a/src/plugins/backgroundClip.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.bg-clip-border': { 'background-clip': 'border-box' }, - '.bg-clip-padding': { 'background-clip': 'padding-box' }, - '.bg-clip-content': { 'background-clip': 'content-box' }, - '.bg-clip-text': { 'background-clip': 'text' }, - }, - variants('backgroundClip') - ) - } -} diff --git a/src/plugins/backgroundColor.js b/src/plugins/backgroundColor.js deleted file mode 100644 index 3ee4ea484..000000000 --- a/src/plugins/backgroundColor.js +++ /dev/null @@ -1,29 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, theme, variants, corePlugins }) { - matchUtilities( - { - bg: (value) => { - if (!corePlugins('backgroundOpacity')) { - return { - 'background-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'background-color', - variable: '--tw-bg-opacity', - }) - }, - }, - { - values: flattenColorPalette(theme('backgroundColor')), - variants: variants('backgroundColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/backgroundImage.js b/src/plugins/backgroundImage.js deleted file mode 100644 index ce1c7f315..000000000 --- a/src/plugins/backgroundImage.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLookupValue } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('backgroundImage', [['bg', ['background-image']]], { - resolveArbitraryValue: asLookupValue, - }) -} diff --git a/src/plugins/backgroundOpacity.js b/src/plugins/backgroundOpacity.js deleted file mode 100644 index f12b987a2..000000000 --- a/src/plugins/backgroundOpacity.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('backgroundOpacity', [['bg-opacity', ['--tw-bg-opacity']]]) -} diff --git a/src/plugins/backgroundOrigin.js b/src/plugins/backgroundOrigin.js deleted file mode 100644 index 226845271..000000000 --- a/src/plugins/backgroundOrigin.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.bg-origin-border': { 'background-origin': 'border-box' }, - '.bg-origin-padding': { 'background-origin': 'padding-box' }, - '.bg-origin-content': { 'background-origin': 'content-box' }, - }, - variants('backgroundOrigin') - ) - } -} diff --git a/src/plugins/backgroundPosition.js b/src/plugins/backgroundPosition.js deleted file mode 100644 index 10a26a3cd..000000000 --- a/src/plugins/backgroundPosition.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLookupValue } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('backgroundPosition', [['bg', ['background-position']]], { - resolveArbitraryValue: asLookupValue, - }) -} diff --git a/src/plugins/backgroundRepeat.js b/src/plugins/backgroundRepeat.js deleted file mode 100644 index ec93bf06f..000000000 --- a/src/plugins/backgroundRepeat.js +++ /dev/null @@ -1,15 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.bg-repeat': { 'background-repeat': 'repeat' }, - '.bg-no-repeat': { 'background-repeat': 'no-repeat' }, - '.bg-repeat-x': { 'background-repeat': 'repeat-x' }, - '.bg-repeat-y': { 'background-repeat': 'repeat-y' }, - '.bg-repeat-round': { 'background-repeat': 'round' }, - '.bg-repeat-space': { 'background-repeat': 'space' }, - }, - variants('backgroundRepeat') - ) - } -} diff --git a/src/plugins/backgroundSize.js b/src/plugins/backgroundSize.js deleted file mode 100644 index 5b9138227..000000000 --- a/src/plugins/backgroundSize.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLookupValue } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('backgroundSize', [['bg', ['background-size']]], { - resolveArbitraryValue: asLookupValue, - }) -} diff --git a/src/plugins/blur.js b/src/plugins/blur.js deleted file mode 100644 index 4ff51c344..000000000 --- a/src/plugins/blur.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - blur: (value) => { - return { - '--tw-blur': `blur(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('blur'), - variants: variants('blur'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/borderCollapse.js b/src/plugins/borderCollapse.js deleted file mode 100644 index bc0895b12..000000000 --- a/src/plugins/borderCollapse.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.border-collapse': { 'border-collapse': 'collapse' }, - '.border-separate': { 'border-collapse': 'separate' }, - }, - variants('borderCollapse') - ) - } -} diff --git a/src/plugins/borderColor.js b/src/plugins/borderColor.js deleted file mode 100644 index b401e1fec..000000000 --- a/src/plugins/borderColor.js +++ /dev/null @@ -1,107 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ addBase, matchUtilities, theme, variants, corePlugins }) { - if (!corePlugins('borderOpacity')) { - addBase({ - '@defaults border-width': { - 'border-color': theme('borderColor.DEFAULT', 'currentColor'), - }, - }) - } else { - addBase({ - '@defaults border-width': withAlphaVariable({ - color: theme('borderColor.DEFAULT', 'currentColor'), - property: 'border-color', - variable: '--tw-border-opacity', - }), - }) - } - - matchUtilities( - { - border: (value) => { - if (!corePlugins('borderOpacity')) { - return { - 'border-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'border-color', - variable: '--tw-border-opacity', - }) - }, - }, - { - values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))), - variants: variants('borderColor'), - type: 'color', - } - ) - - matchUtilities( - { - 'border-t': (value) => { - if (!corePlugins('borderOpacity')) { - return { - 'border-top-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'border-top-color', - variable: '--tw-border-opacity', - }) - }, - 'border-r': (value) => { - if (!corePlugins('borderOpacity')) { - return { - 'border-right-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'border-right-color', - variable: '--tw-border-opacity', - }) - }, - 'border-b': (value) => { - if (!corePlugins('borderOpacity')) { - return { - 'border-bottom-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'border-bottom-color', - variable: '--tw-border-opacity', - }) - }, - 'border-l': (value) => { - if (!corePlugins('borderOpacity')) { - return { - 'border-left-color': value, - } - } - - return withAlphaVariable({ - color: value, - property: 'border-left-color', - variable: '--tw-border-opacity', - }) - }, - }, - { - values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('borderColor'))), - variants: variants('borderColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/borderOpacity.js b/src/plugins/borderOpacity.js deleted file mode 100644 index 6ac425d8d..000000000 --- a/src/plugins/borderOpacity.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('borderOpacity', [['border-opacity', ['--tw-border-opacity']]]) -} diff --git a/src/plugins/borderRadius.js b/src/plugins/borderRadius.js deleted file mode 100644 index e52aeec31..000000000 --- a/src/plugins/borderRadius.js +++ /dev/null @@ -1,19 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('borderRadius', [ - ['rounded', ['border-radius']], - [ - ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']], - ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']], - ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']], - ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']], - ], - [ - ['rounded-tl', ['border-top-left-radius']], - ['rounded-tr', ['border-top-right-radius']], - ['rounded-br', ['border-bottom-right-radius']], - ['rounded-bl', ['border-bottom-left-radius']], - ], - ]) -} diff --git a/src/plugins/borderStyle.js b/src/plugins/borderStyle.js deleted file mode 100644 index 080c2dd87..000000000 --- a/src/plugins/borderStyle.js +++ /dev/null @@ -1,24 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.border-solid': { - 'border-style': 'solid', - }, - '.border-dashed': { - 'border-style': 'dashed', - }, - '.border-dotted': { - 'border-style': 'dotted', - }, - '.border-double': { - 'border-style': 'double', - }, - '.border-none': { - 'border-style': 'none', - }, - }, - variants('borderStyle') - ) - } -} diff --git a/src/plugins/borderWidth.js b/src/plugins/borderWidth.js deleted file mode 100644 index 91cb6fdb1..000000000 --- a/src/plugins/borderWidth.js +++ /dev/null @@ -1,18 +0,0 @@ -import { asLength } from '../util/pluginUtils' -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin( - 'borderWidth', - [ - ['border', [['@defaults border-width', {}], 'border-width']], - [ - ['border-t', [['@defaults border-width', {}], 'border-top-width']], - ['border-r', [['@defaults border-width', {}], 'border-right-width']], - ['border-b', [['@defaults border-width', {}], 'border-bottom-width']], - ['border-l', [['@defaults border-width', {}], 'border-left-width']], - ], - ], - { resolveArbitraryValue: asLength } - ) -} diff --git a/src/plugins/boxDecorationBreak.js b/src/plugins/boxDecorationBreak.js deleted file mode 100644 index a250b9e36..000000000 --- a/src/plugins/boxDecorationBreak.js +++ /dev/null @@ -1,15 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.decoration-slice': { - 'box-decoration-break': 'slice', - }, - '.decoration-clone': { - 'box-decoration-break': 'clone', - }, - }, - variants('boxDecorationBreak') - ) - } -} diff --git a/src/plugins/boxShadow.js b/src/plugins/boxShadow.js deleted file mode 100644 index 85cd3491c..000000000 --- a/src/plugins/boxShadow.js +++ /dev/null @@ -1,39 +0,0 @@ -import transformThemeValue from '../util/transformThemeValue' - -let transformValue = transformThemeValue('boxShadow') -let defaultBoxShadow = [ - `var(--tw-ring-offset-shadow, 0 0 #0000)`, - `var(--tw-ring-shadow, 0 0 #0000)`, - `var(--tw-shadow)`, -].join(', ') - -export default function () { - return function ({ matchUtilities, addBase, theme, variants }) { - addBase({ - '@defaults box-shadow': { - '--tw-ring-offset-shadow': '0 0 #0000', - '--tw-ring-shadow': '0 0 #0000', - '--tw-shadow': '0 0 #0000', - }, - }) - - matchUtilities( - { - shadow: (value) => { - value = transformValue(value) - - return { - '@defaults box-shadow': {}, - '--tw-shadow': value === 'none' ? '0 0 #0000' : value, - 'box-shadow': defaultBoxShadow, - } - }, - }, - { - values: theme('boxShadow'), - variants: variants('boxShadow'), - type: 'lookup', - } - ) - } -} diff --git a/src/plugins/boxSizing.js b/src/plugins/boxSizing.js deleted file mode 100644 index 64762c178..000000000 --- a/src/plugins/boxSizing.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.box-border': { 'box-sizing': 'border-box' }, - '.box-content': { 'box-sizing': 'content-box' }, - }, - variants('boxSizing') - ) - } -} diff --git a/src/plugins/brightness.js b/src/plugins/brightness.js deleted file mode 100644 index 4888f22e3..000000000 --- a/src/plugins/brightness.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - brightness: (value) => { - return { - '--tw-brightness': `brightness(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('brightness'), - variants: variants('brightness'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/caretColor.js b/src/plugins/caretColor.js deleted file mode 100644 index 3cd9d0ffc..000000000 --- a/src/plugins/caretColor.js +++ /dev/null @@ -1,19 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - caret: (value) => { - return { 'caret-color': toColorValue(value) } - }, - }, - { - values: flattenColorPalette(theme('caretColor')), - variants: variants('caretColor'), - type: ['color', 'any'], - } - ) - } -} diff --git a/src/plugins/clear.js b/src/plugins/clear.js deleted file mode 100644 index 06cbeec12..000000000 --- a/src/plugins/clear.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.clear-left': { clear: 'left' }, - '.clear-right': { clear: 'right' }, - '.clear-both': { clear: 'both' }, - '.clear-none': { clear: 'none' }, - }, - variants('clear') - ) - } -} diff --git a/src/plugins/container.js b/src/plugins/container.js deleted file mode 100644 index 4093750ff..000000000 --- a/src/plugins/container.js +++ /dev/null @@ -1,108 +0,0 @@ -function extractMinWidths(breakpoints) { - return Object.values(breakpoints ?? {}).flatMap((breakpoints) => { - if (typeof breakpoints === 'string') { - breakpoints = { min: breakpoints } - } - - if (!Array.isArray(breakpoints)) { - breakpoints = [breakpoints] - } - - return breakpoints - .filter((breakpoint) => { - return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width') - }) - .map((breakpoint) => { - return breakpoint['min-width'] ?? breakpoint.min - }) - }) -} - -function mapMinWidthsToPadding(minWidths, screens, paddings) { - if (typeof paddings === 'undefined') { - return [] - } - - if (!(typeof paddings === 'object' && paddings !== null)) { - return [ - { - screen: 'DEFAULT', - minWidth: 0, - padding: paddings, - }, - ] - } - - let mapping = [] - - if (paddings.DEFAULT) { - mapping.push({ - screen: 'DEFAULT', - minWidth: 0, - padding: paddings.DEFAULT, - }) - } - - for (let minWidth of minWidths) { - for (let [screen, value] of Object.entries(screens)) { - let screenMinWidth = - typeof value === 'object' && value !== null ? value.min || value['min-width'] : value - - if (`${screenMinWidth}` === `${minWidth}`) { - mapping.push({ - screen, - minWidth, - padding: paddings[screen], - }) - } - } - } - - return mapping -} - -module.exports = function () { - return function ({ addComponents, theme, variants }) { - let screens = theme('container.screens', theme('screens')) - let minWidths = extractMinWidths(screens) - let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding')) - - let generatePaddingFor = (minWidth) => { - let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`) - - if (!paddingConfig) { - return {} - } - - return { - paddingRight: paddingConfig.padding, - paddingLeft: paddingConfig.padding, - } - } - - let atRules = Array.from( - new Set(minWidths.slice().sort((a, z) => parseInt(a) - parseInt(z))) - ).map((minWidth) => ({ - [`@media (min-width: ${minWidth})`]: { - '.container': { - 'max-width': minWidth, - ...generatePaddingFor(minWidth), - }, - }, - })) - - addComponents( - [ - { - '.container': Object.assign( - { width: '100%' }, - theme('container.center', false) ? { marginRight: 'auto', marginLeft: 'auto' } : {}, - generatePaddingFor(0) - ), - }, - ...atRules, - ], - variants('container') - ) - } -} diff --git a/src/plugins/content.js b/src/plugins/content.js deleted file mode 100644 index cc55ee6ff..000000000 --- a/src/plugins/content.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('content') -} diff --git a/src/plugins/contrast.js b/src/plugins/contrast.js deleted file mode 100644 index 3f01b103e..000000000 --- a/src/plugins/contrast.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - contrast: (value) => { - return { - '--tw-contrast': `contrast(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { values: theme('contrast'), variants: variants('contrast'), type: 'any' } - ) - } -} diff --git a/src/plugins/cursor.js b/src/plugins/cursor.js deleted file mode 100644 index 42096c659..000000000 --- a/src/plugins/cursor.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('cursor') -} diff --git a/src/plugins/display.js b/src/plugins/display.js deleted file mode 100644 index 4dc286d7d..000000000 --- a/src/plugins/display.js +++ /dev/null @@ -1,72 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.block': { - display: 'block', - }, - '.inline-block': { - display: 'inline-block', - }, - '.inline': { - display: 'inline', - }, - '.flex': { - display: 'flex', - }, - '.inline-flex': { - display: 'inline-flex', - }, - '.table': { - display: 'table', - }, - '.inline-table': { - display: 'inline-table', - }, - '.table-caption': { - display: 'table-caption', - }, - '.table-cell': { - display: 'table-cell', - }, - '.table-column': { - display: 'table-column', - }, - '.table-column-group': { - display: 'table-column-group', - }, - '.table-footer-group': { - display: 'table-footer-group', - }, - '.table-header-group': { - display: 'table-header-group', - }, - '.table-row-group': { - display: 'table-row-group', - }, - '.table-row': { - display: 'table-row', - }, - '.flow-root': { - display: 'flow-root', - }, - '.grid': { - display: 'grid', - }, - '.inline-grid': { - display: 'inline-grid', - }, - '.contents': { - display: 'contents', - }, - '.list-item': { - display: 'list-item', - }, - '.hidden': { - display: 'none', - }, - }, - variants('display') - ) - } -} diff --git a/src/plugins/divideColor.js b/src/plugins/divideColor.js deleted file mode 100644 index 07f20f016..000000000 --- a/src/plugins/divideColor.js +++ /dev/null @@ -1,33 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, theme, variants, corePlugins }) { - matchUtilities( - { - divide: (value) => { - if (!corePlugins('divideOpacity')) { - return { - ['& > :not([hidden]) ~ :not([hidden])']: { - 'border-color': value, - }, - } - } - - return { - ['& > :not([hidden]) ~ :not([hidden])']: withAlphaVariable({ - color: value, - property: 'border-color', - variable: '--tw-divide-opacity', - }), - } - }, - }, - { - values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))), - variants: variants('divideColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/divideOpacity.js b/src/plugins/divideOpacity.js deleted file mode 100644 index 94c41e562..000000000 --- a/src/plugins/divideOpacity.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'divide-opacity': (value) => { - return { - [`& > :not([hidden]) ~ :not([hidden])`]: { - '--tw-divide-opacity': value, - }, - } - }, - }, - { - values: theme('divideOpacity'), - variants: variants('divideOpacity'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/divideStyle.js b/src/plugins/divideStyle.js deleted file mode 100644 index 3c3dae155..000000000 --- a/src/plugins/divideStyle.js +++ /dev/null @@ -1,24 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.divide-solid > :not([hidden]) ~ :not([hidden])': { - 'border-style': 'solid', - }, - '.divide-dashed > :not([hidden]) ~ :not([hidden])': { - 'border-style': 'dashed', - }, - '.divide-dotted > :not([hidden]) ~ :not([hidden])': { - 'border-style': 'dotted', - }, - '.divide-double > :not([hidden]) ~ :not([hidden])': { - 'border-style': 'double', - }, - '.divide-none > :not([hidden]) ~ :not([hidden])': { - 'border-style': 'none', - }, - }, - variants('divideStyle') - ) - } -} diff --git a/src/plugins/divideWidth.js b/src/plugins/divideWidth.js deleted file mode 100644 index ce3059760..000000000 --- a/src/plugins/divideWidth.js +++ /dev/null @@ -1,51 +0,0 @@ -export default function () { - return function ({ matchUtilities, addUtilities, theme, variants }) { - matchUtilities( - { - 'divide-x': (value) => { - value = value === '0' ? '0px' : value - - return { - '& > :not([hidden]) ~ :not([hidden])': { - '@defaults border-width': {}, - '--tw-divide-x-reverse': '0', - 'border-right-width': `calc(${value} * var(--tw-divide-x-reverse))`, - 'border-left-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`, - }, - } - }, - 'divide-y': (value) => { - value = value === '0' ? '0px' : value - - return { - '& > :not([hidden]) ~ :not([hidden])': { - '@defaults border-width': {}, - '--tw-divide-y-reverse': '0', - 'border-top-width': `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`, - 'border-bottom-width': `calc(${value} * var(--tw-divide-y-reverse))`, - }, - } - }, - }, - { - values: theme('divideWidth'), - variants: variants('divideWidth'), - type: 'length', - } - ) - - addUtilities( - { - '.divide-y-reverse > :not([hidden]) ~ :not([hidden])': { - '@defaults border-width': {}, - '--tw-divide-y-reverse': '1', - }, - '.divide-x-reverse > :not([hidden]) ~ :not([hidden])': { - '@defaults border-width': {}, - '--tw-divide-x-reverse': '1', - }, - }, - variants('divideWidth') - ) - } -} diff --git a/src/plugins/dropShadow.js b/src/plugins/dropShadow.js deleted file mode 100644 index 0711dda87..000000000 --- a/src/plugins/dropShadow.js +++ /dev/null @@ -1,22 +0,0 @@ -import nameClass from '../util/nameClass' - -export default function () { - return function ({ addUtilities, theme, variants }) { - let utilities = Object.fromEntries( - Object.entries(theme('dropShadow') ?? {}).map(([modifier, value]) => { - return [ - nameClass('drop-shadow', modifier), - { - '--tw-drop-shadow': Array.isArray(value) - ? value.map((v) => `drop-shadow(${v})`).join(' ') - : `drop-shadow(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - }, - ] - }) - ) - - addUtilities(utilities, variants('dropShadow')) - } -} diff --git a/src/plugins/fill.js b/src/plugins/fill.js deleted file mode 100644 index 7778ece91..000000000 --- a/src/plugins/fill.js +++ /dev/null @@ -1,19 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - fill: (value) => { - return { fill: toColorValue(value) } - }, - }, - { - values: flattenColorPalette(theme('fill')), - variants: variants('fill'), - type: ['color', 'any'], - } - ) - } -} diff --git a/src/plugins/filter.js b/src/plugins/filter.js deleted file mode 100644 index b75e77d44..000000000 --- a/src/plugins/filter.js +++ /dev/null @@ -1,35 +0,0 @@ -export default function () { - return function ({ addBase, addUtilities, variants }) { - addBase({ - '@defaults filter': { - '--tw-blur': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-brightness': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-contrast': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-grayscale': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-hue-rotate': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-invert': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-saturate': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-sepia': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-drop-shadow': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-filter': [ - 'var(--tw-blur)', - 'var(--tw-brightness)', - 'var(--tw-contrast)', - 'var(--tw-grayscale)', - 'var(--tw-hue-rotate)', - 'var(--tw-invert)', - 'var(--tw-saturate)', - 'var(--tw-sepia)', - 'var(--tw-drop-shadow)', - ].join(' '), - }, - }) - addUtilities( - { - '.filter': { '@defaults filter': {}, filter: 'var(--tw-filter)' }, - '.filter-none': { filter: 'none' }, - }, - variants('filter') - ) - } -} diff --git a/src/plugins/flex.js b/src/plugins/flex.js deleted file mode 100644 index f833f5013..000000000 --- a/src/plugins/flex.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('flex') -} diff --git a/src/plugins/flexDirection.js b/src/plugins/flexDirection.js deleted file mode 100644 index 8b2acb31a..000000000 --- a/src/plugins/flexDirection.js +++ /dev/null @@ -1,21 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.flex-row': { - 'flex-direction': 'row', - }, - '.flex-row-reverse': { - 'flex-direction': 'row-reverse', - }, - '.flex-col': { - 'flex-direction': 'column', - }, - '.flex-col-reverse': { - 'flex-direction': 'column-reverse', - }, - }, - variants('flexDirection') - ) - } -} diff --git a/src/plugins/flexGrow.js b/src/plugins/flexGrow.js deleted file mode 100644 index 9c82903a2..000000000 --- a/src/plugins/flexGrow.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]]) -} diff --git a/src/plugins/flexShrink.js b/src/plugins/flexShrink.js deleted file mode 100644 index c9be406ea..000000000 --- a/src/plugins/flexShrink.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]]) -} diff --git a/src/plugins/flexWrap.js b/src/plugins/flexWrap.js deleted file mode 100644 index c0315abb9..000000000 --- a/src/plugins/flexWrap.js +++ /dev/null @@ -1,18 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.flex-wrap': { - 'flex-wrap': 'wrap', - }, - '.flex-wrap-reverse': { - 'flex-wrap': 'wrap-reverse', - }, - '.flex-nowrap': { - 'flex-wrap': 'nowrap', - }, - }, - variants('flexWrap') - ) - } -} diff --git a/src/plugins/float.js b/src/plugins/float.js deleted file mode 100644 index 459243994..000000000 --- a/src/plugins/float.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.float-right': { float: 'right' }, - '.float-left': { float: 'left' }, - '.float-none': { float: 'none' }, - }, - variants('float') - ) - } -} diff --git a/src/plugins/fontFamily.js b/src/plugins/fontFamily.js deleted file mode 100644 index 609af73e8..000000000 --- a/src/plugins/fontFamily.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLookupValue } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], { - resolveArbitraryValue: asLookupValue, - }) -} diff --git a/src/plugins/fontSize.js b/src/plugins/fontSize.js deleted file mode 100644 index 9686d5a9b..000000000 --- a/src/plugins/fontSize.js +++ /dev/null @@ -1,27 +0,0 @@ -import isPlainObject from '../util/isPlainObject' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - text: (value) => { - let [fontSize, options] = Array.isArray(value) ? value : [value] - let { lineHeight, letterSpacing } = isPlainObject(options) - ? options - : { lineHeight: options } - - return { - 'font-size': fontSize, - ...(lineHeight === undefined ? {} : { 'line-height': lineHeight }), - ...(letterSpacing === undefined ? {} : { 'letter-spacing': letterSpacing }), - } - }, - }, - { - values: theme('fontSize'), - variants: variants('fontSize'), - type: 'length', - } - ) - } -} diff --git a/src/plugins/fontSmoothing.js b/src/plugins/fontSmoothing.js deleted file mode 100644 index 112fcd3b8..000000000 --- a/src/plugins/fontSmoothing.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.antialiased': { - '-webkit-font-smoothing': 'antialiased', - '-moz-osx-font-smoothing': 'grayscale', - }, - '.subpixel-antialiased': { - '-webkit-font-smoothing': 'auto', - '-moz-osx-font-smoothing': 'auto', - }, - }, - variants('fontSmoothing') - ) - } -} diff --git a/src/plugins/fontStyle.js b/src/plugins/fontStyle.js deleted file mode 100644 index 695356e56..000000000 --- a/src/plugins/fontStyle.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.italic': { 'font-style': 'italic' }, - '.not-italic': { 'font-style': 'normal' }, - }, - variants('fontStyle') - ) - } -} diff --git a/src/plugins/fontVariantNumeric.js b/src/plugins/fontVariantNumeric.js deleted file mode 100644 index 75f7e2c79..000000000 --- a/src/plugins/fontVariantNumeric.js +++ /dev/null @@ -1,46 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.ordinal, .slashed-zero, .lining-nums, .oldstyle-nums, .proportional-nums, .tabular-nums, .diagonal-fractions, .stacked-fractions': - { - '--tw-ordinal': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-slashed-zero': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-figure': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-spacing': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-numeric-fraction': 'var(--tw-empty,/*!*/ /*!*/)', - 'font-variant-numeric': - 'var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)', - }, - '.normal-nums': { - 'font-variant-numeric': 'normal', - }, - '.ordinal': { - '--tw-ordinal': 'ordinal', - }, - '.slashed-zero': { - '--tw-slashed-zero': 'slashed-zero', - }, - '.lining-nums': { - '--tw-numeric-figure': 'lining-nums', - }, - '.oldstyle-nums': { - '--tw-numeric-figure': 'oldstyle-nums', - }, - '.proportional-nums': { - '--tw-numeric-spacing': 'proportional-nums', - }, - '.tabular-nums': { - '--tw-numeric-spacing': 'tabular-nums', - }, - '.diagonal-fractions': { - '--tw-numeric-fraction': 'diagonal-fractions', - }, - '.stacked-fractions': { - '--tw-numeric-fraction': 'stacked-fractions', - }, - }, - variants('fontVariantNumeric') - ) - } -} diff --git a/src/plugins/fontWeight.js b/src/plugins/fontWeight.js deleted file mode 100644 index 9e65ae58c..000000000 --- a/src/plugins/fontWeight.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLookupValue } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], { - resolveArbitraryValue: asLookupValue, - }) -} diff --git a/src/plugins/gap.js b/src/plugins/gap.js deleted file mode 100644 index 0056faa4c..000000000 --- a/src/plugins/gap.js +++ /dev/null @@ -1,11 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gap', [ - ['gap', ['gap']], - [ - ['gap-x', ['columnGap']], - ['gap-y', ['rowGap']], - ], - ]) -} diff --git a/src/plugins/gradientColorStops.js b/src/plugins/gradientColorStops.js deleted file mode 100644 index e1ebba136..000000000 --- a/src/plugins/gradientColorStops.js +++ /dev/null @@ -1,54 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' -import { withAlphaValue } from '../util/withAlphaVariable' - -function transparentTo(value) { - return withAlphaValue(value, 0, 'rgba(255, 255, 255, 0)') -} - -export default function () { - return function ({ matchUtilities, theme, variants }) { - let options = { - values: flattenColorPalette(theme('gradientColorStops')), - variants: variants('gradientColorStops'), - type: ['color', 'any'], - } - - matchUtilities( - { - from: (value) => { - let transparentToValue = transparentTo(value) - - return { - '--tw-gradient-from': toColorValue(value, 'from'), - '--tw-gradient-stops': `var(--tw-gradient-from), var(--tw-gradient-to, ${transparentToValue})`, - } - }, - }, - options - ) - matchUtilities( - { - via: (value) => { - let transparentToValue = transparentTo(value) - - return { - '--tw-gradient-stops': `var(--tw-gradient-from), ${toColorValue( - value, - 'via' - )}, var(--tw-gradient-to, ${transparentToValue})`, - } - }, - }, - options - ) - matchUtilities( - { - to: (value) => { - return { '--tw-gradient-to': toColorValue(value, 'to') } - }, - }, - options - ) - } -} diff --git a/src/plugins/grayscale.js b/src/plugins/grayscale.js deleted file mode 100644 index 6a0d91a30..000000000 --- a/src/plugins/grayscale.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - grayscale: (value) => { - return { - '--tw-grayscale': `grayscale(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('grayscale'), - variants: variants('grayscale'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/gridAutoColumns.js b/src/plugins/gridAutoColumns.js deleted file mode 100644 index 04cfff9fe..000000000 --- a/src/plugins/gridAutoColumns.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridAutoColumns', [['auto-cols', ['gridAutoColumns']]]) -} diff --git a/src/plugins/gridAutoFlow.js b/src/plugins/gridAutoFlow.js deleted file mode 100644 index ddb599ee0..000000000 --- a/src/plugins/gridAutoFlow.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.grid-flow-row': { gridAutoFlow: 'row' }, - '.grid-flow-col': { gridAutoFlow: 'column' }, - '.grid-flow-row-dense': { gridAutoFlow: 'row dense' }, - '.grid-flow-col-dense': { gridAutoFlow: 'column dense' }, - }, - variants('gridAutoFlow') - ) - } -} diff --git a/src/plugins/gridAutoRows.js b/src/plugins/gridAutoRows.js deleted file mode 100644 index f9740a970..000000000 --- a/src/plugins/gridAutoRows.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridAutoRows', [['auto-rows', ['gridAutoRows']]]) -} diff --git a/src/plugins/gridColumn.js b/src/plugins/gridColumn.js deleted file mode 100644 index 6eda45316..000000000 --- a/src/plugins/gridColumn.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridColumn', [['col', ['gridColumn']]]) -} diff --git a/src/plugins/gridColumnEnd.js b/src/plugins/gridColumnEnd.js deleted file mode 100644 index 18e9b34e7..000000000 --- a/src/plugins/gridColumnEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]]) -} diff --git a/src/plugins/gridColumnStart.js b/src/plugins/gridColumnStart.js deleted file mode 100644 index 6d58eee74..000000000 --- a/src/plugins/gridColumnStart.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]]) -} diff --git a/src/plugins/gridRow.js b/src/plugins/gridRow.js deleted file mode 100644 index a63cdcc72..000000000 --- a/src/plugins/gridRow.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridRow', [['row', ['gridRow']]]) -} diff --git a/src/plugins/gridRowEnd.js b/src/plugins/gridRowEnd.js deleted file mode 100644 index 39d5df4fb..000000000 --- a/src/plugins/gridRowEnd.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridRowEnd', [['row-end', ['gridRowEnd']]]) -} diff --git a/src/plugins/gridRowStart.js b/src/plugins/gridRowStart.js deleted file mode 100644 index b20a98258..000000000 --- a/src/plugins/gridRowStart.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridRowStart', [['row-start', ['gridRowStart']]]) -} diff --git a/src/plugins/gridTemplateColumns.js b/src/plugins/gridTemplateColumns.js deleted file mode 100644 index 032b546c9..000000000 --- a/src/plugins/gridTemplateColumns.js +++ /dev/null @@ -1,8 +0,0 @@ -import { asList } from '../util/pluginUtils' -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridTemplateColumns', [['grid-cols', ['gridTemplateColumns']]], { - resolveArbitraryValue: asList, - }) -} diff --git a/src/plugins/gridTemplateRows.js b/src/plugins/gridTemplateRows.js deleted file mode 100644 index 4c86f68ae..000000000 --- a/src/plugins/gridTemplateRows.js +++ /dev/null @@ -1,8 +0,0 @@ -import { asList } from '../util/pluginUtils' -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('gridTemplateRows', [['grid-rows', ['gridTemplateRows']]], { - resolveArbitraryValue: asList, - }) -} diff --git a/src/plugins/height.js b/src/plugins/height.js deleted file mode 100644 index 1ec325aa3..000000000 --- a/src/plugins/height.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('height', [['h', ['height']]]) -} diff --git a/src/plugins/hueRotate.js b/src/plugins/hueRotate.js deleted file mode 100644 index 7949298c6..000000000 --- a/src/plugins/hueRotate.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'hue-rotate': (value) => { - return { - '--tw-hue-rotate': `hue-rotate(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('hueRotate'), - variants: variants('hueRotate'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/index.js b/src/plugins/index.js deleted file mode 100644 index dcf316ca1..000000000 --- a/src/plugins/index.js +++ /dev/null @@ -1,171 +0,0 @@ -export { default as preflight } from './preflight' - -export { default as container } from './container' - -export { default as accessibility } from './accessibility' -export { default as pointerEvents } from './pointerEvents' -export { default as visibility } from './visibility' -export { default as position } from './position' -export { default as inset } from './inset' -export { default as isolation } from './isolation' -export { default as zIndex } from './zIndex' -export { default as order } from './order' -export { default as gridColumn } from './gridColumn' -export { default as gridColumnStart } from './gridColumnStart' -export { default as gridColumnEnd } from './gridColumnEnd' -export { default as gridRow } from './gridRow' -export { default as gridRowStart } from './gridRowStart' -export { default as gridRowEnd } from './gridRowEnd' -export { default as float } from './float' -export { default as clear } from './clear' -export { default as margin } from './margin' -export { default as boxSizing } from './boxSizing' -export { default as display } from './display' -export { default as aspectRatio } from './aspectRatio' -export { default as height } from './height' -export { default as maxHeight } from './maxHeight' -export { default as minHeight } from './minHeight' -export { default as width } from './width' -export { default as minWidth } from './minWidth' -export { default as maxWidth } from './maxWidth' -export { default as flex } from './flex' -export { default as flexShrink } from './flexShrink' -export { default as flexGrow } from './flexGrow' -export { default as tableLayout } from './tableLayout' -export { default as borderCollapse } from './borderCollapse' - -export { default as transformOrigin } from './transformOrigin' -export { default as translate } from './translate' -export { default as rotate } from './rotate' -export { default as skew } from './skew' -export { default as scale } from './scale' -export { default as transform } from './transform' - -export { default as animation } from './animation' - -export { default as cursor } from './cursor' -export { default as userSelect } from './userSelect' -export { default as resize } from './resize' - -export { default as listStylePosition } from './listStylePosition' -export { default as listStyleType } from './listStyleType' - -export { default as appearance } from './appearance' -export { default as gridAutoColumns } from './gridAutoColumns' -export { default as gridAutoFlow } from './gridAutoFlow' -export { default as gridAutoRows } from './gridAutoRows' -export { default as gridTemplateColumns } from './gridTemplateColumns' -export { default as gridTemplateRows } from './gridTemplateRows' -export { default as flexDirection } from './flexDirection' -export { default as flexWrap } from './flexWrap' -export { default as placeContent } from './placeContent' -export { default as placeItems } from './placeItems' -export { default as alignContent } from './alignContent' -export { default as alignItems } from './alignItems' -export { default as justifyContent } from './justifyContent' -export { default as justifyItems } from './justifyItems' -export { default as gap } from './gap' -export { default as space } from './space' -export { default as divideWidth } from './divideWidth' -export { default as divideStyle } from './divideStyle' -export { default as divideColor } from './divideColor' -export { default as divideOpacity } from './divideOpacity' - -export { default as placeSelf } from './placeSelf' -export { default as alignSelf } from './alignSelf' -export { default as justifySelf } from './justifySelf' - -export { default as overflow } from './overflow' -export { default as overscrollBehavior } from './overscrollBehavior' -export { default as textOverflow } from './textOverflow' -export { default as whitespace } from './whitespace' -export { default as wordBreak } from './wordBreak' - -export { default as borderRadius } from './borderRadius' -export { default as borderWidth } from './borderWidth' -export { default as borderStyle } from './borderStyle' -export { default as borderColor } from './borderColor' -export { default as borderOpacity } from './borderOpacity' - -export { default as backgroundColor } from './backgroundColor' -export { default as backgroundOpacity } from './backgroundOpacity' -export { default as backgroundImage } from './backgroundImage' -export { default as gradientColorStops } from './gradientColorStops' -export { default as boxDecorationBreak } from './boxDecorationBreak' -export { default as backgroundSize } from './backgroundSize' -export { default as backgroundAttachment } from './backgroundAttachment' -export { default as backgroundClip } from './backgroundClip' -export { default as backgroundPosition } from './backgroundPosition' -export { default as backgroundRepeat } from './backgroundRepeat' -export { default as backgroundOrigin } from './backgroundOrigin' - -export { default as fill } from './fill' -export { default as stroke } from './stroke' -export { default as strokeWidth } from './strokeWidth' - -export { default as objectFit } from './objectFit' -export { default as objectPosition } from './objectPosition' - -export { default as padding } from './padding' - -export { default as textAlign } from './textAlign' -export { default as textIndent } from './textIndent' -export { default as verticalAlign } from './verticalAlign' -export { default as fontFamily } from './fontFamily' -export { default as fontSize } from './fontSize' -export { default as fontWeight } from './fontWeight' -export { default as textTransform } from './textTransform' -export { default as fontStyle } from './fontStyle' -export { default as fontVariantNumeric } from './fontVariantNumeric' -export { default as lineHeight } from './lineHeight' -export { default as letterSpacing } from './letterSpacing' -export { default as textColor } from './textColor' -export { default as textOpacity } from './textOpacity' -export { default as textDecoration } from './textDecoration' -export { default as fontSmoothing } from './fontSmoothing' -export { default as placeholderColor } from './placeholderColor' -export { default as placeholderOpacity } from './placeholderOpacity' -export { default as caretColor } from './caretColor' -export { default as accentColor } from './accentColor' - -export { default as opacity } from './opacity' -export { default as backgroundBlendMode } from './backgroundBlendMode' -export { default as mixBlendMode } from './mixBlendMode' -export { default as boxShadow } from './boxShadow' -export { default as outline } from './outline' -export { default as ringWidth } from './ringWidth' -export { default as ringColor } from './ringColor' -export { default as ringOpacity } from './ringOpacity' -export { default as ringOffsetWidth } from './ringOffsetWidth' -export { default as ringOffsetColor } from './ringOffsetColor' - -export { default as blur } from './blur' -export { default as brightness } from './brightness' -export { default as contrast } from './contrast' -export { default as dropShadow } from './dropShadow' -export { default as grayscale } from './grayscale' -export { default as hueRotate } from './hueRotate' -export { default as invert } from './invert' -export { default as saturate } from './saturate' -export { default as sepia } from './sepia' -export { default as filter } from './filter' - -export { default as backdropBlur } from './backdropBlur' -export { default as backdropBrightness } from './backdropBrightness' -export { default as backdropContrast } from './backdropContrast' -export { default as backdropGrayscale } from './backdropGrayscale' -export { default as backdropHueRotate } from './backdropHueRotate' -export { default as backdropInvert } from './backdropInvert' -export { default as backdropOpacity } from './backdropOpacity' -export { default as backdropSaturate } from './backdropSaturate' -export { default as backdropSepia } from './backdropSepia' -export { default as backdropFilter } from './backdropFilter' - -export { default as transitionProperty } from './transitionProperty' -export { default as transitionDelay } from './transitionDelay' -export { default as transitionDuration } from './transitionDuration' -export { default as transitionTimingFunction } from './transitionTimingFunction' - -export { default as willChange } from './willChange' - -export { default as content } from './content' diff --git a/src/plugins/inset.js b/src/plugins/inset.js deleted file mode 100644 index 95cc41aed..000000000 --- a/src/plugins/inset.js +++ /dev/null @@ -1,48 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - let options = { - values: theme('inset'), - variants: variants('inset'), - type: 'any', - } - - matchUtilities( - { - inset: (value) => { - return { top: value, right: value, bottom: value, left: value } - }, - }, - options - ) - - matchUtilities( - { - 'inset-x': (value) => { - return { left: value, right: value } - }, - 'inset-y': (value) => { - return { top: value, bottom: value } - }, - }, - options - ) - - matchUtilities( - { - top: (value) => { - return { top: value } - }, - right: (value) => { - return { right: value } - }, - bottom: (value) => { - return { bottom: value } - }, - left: (value) => { - return { left: value } - }, - }, - options - ) - } -} diff --git a/src/plugins/invert.js b/src/plugins/invert.js deleted file mode 100644 index bd30dd285..000000000 --- a/src/plugins/invert.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - invert: (value) => { - return { - '--tw-invert': `invert(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('invert'), - variants: variants('invert'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/isolation.js b/src/plugins/isolation.js deleted file mode 100644 index 6aaeabdfb..000000000 --- a/src/plugins/isolation.js +++ /dev/null @@ -1,15 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.isolate': { - isolation: 'isolate', - }, - '.isolation-auto': { - isolation: 'auto', - }, - }, - variants('isolation') - ) - } -} diff --git a/src/plugins/justifyContent.js b/src/plugins/justifyContent.js deleted file mode 100644 index 790db3cd6..000000000 --- a/src/plugins/justifyContent.js +++ /dev/null @@ -1,27 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.justify-start': { - 'justify-content': 'flex-start', - }, - '.justify-end': { - 'justify-content': 'flex-end', - }, - '.justify-center': { - 'justify-content': 'center', - }, - '.justify-between': { - 'justify-content': 'space-between', - }, - '.justify-around': { - 'justify-content': 'space-around', - }, - '.justify-evenly': { - 'justify-content': 'space-evenly', - }, - }, - variants('justifyContent') - ) - } -} diff --git a/src/plugins/justifyItems.js b/src/plugins/justifyItems.js deleted file mode 100644 index 3a282fac5..000000000 --- a/src/plugins/justifyItems.js +++ /dev/null @@ -1,21 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.justify-items-start': { - 'justify-items': 'start', - }, - '.justify-items-end': { - 'justify-items': 'end', - }, - '.justify-items-center': { - 'justify-items': 'center', - }, - '.justify-items-stretch': { - 'justify-items': 'stretch', - }, - }, - variants('justifyItems') - ) - } -} diff --git a/src/plugins/justifySelf.js b/src/plugins/justifySelf.js deleted file mode 100644 index bc4687d1e..000000000 --- a/src/plugins/justifySelf.js +++ /dev/null @@ -1,24 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.justify-self-auto': { - 'justify-self': 'auto', - }, - '.justify-self-start': { - 'justify-self': 'start', - }, - '.justify-self-end': { - 'justify-self': 'end', - }, - '.justify-self-center': { - 'justify-self': 'center', - }, - '.justify-self-stretch': { - 'justify-self': 'stretch', - }, - }, - variants('justifySelf') - ) - } -} diff --git a/src/plugins/letterSpacing.js b/src/plugins/letterSpacing.js deleted file mode 100644 index 504fcb422..000000000 --- a/src/plugins/letterSpacing.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]]) -} diff --git a/src/plugins/lineHeight.js b/src/plugins/lineHeight.js deleted file mode 100644 index b7e25f1cf..000000000 --- a/src/plugins/lineHeight.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]]) -} diff --git a/src/plugins/listStylePosition.js b/src/plugins/listStylePosition.js deleted file mode 100644 index 9087f569b..000000000 --- a/src/plugins/listStylePosition.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.list-inside': { 'list-style-position': 'inside' }, - '.list-outside': { 'list-style-position': 'outside' }, - }, - variants('listStylePosition') - ) - } -} diff --git a/src/plugins/listStyleType.js b/src/plugins/listStyleType.js deleted file mode 100644 index c72e8220d..000000000 --- a/src/plugins/listStyleType.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('listStyleType', [['list', ['listStyleType']]]) -} diff --git a/src/plugins/margin.js b/src/plugins/margin.js deleted file mode 100644 index a10b03e61..000000000 --- a/src/plugins/margin.js +++ /dev/null @@ -1,17 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('margin', [ - ['m', ['margin']], - [ - ['mx', ['margin-left', 'margin-right']], - ['my', ['margin-top', 'margin-bottom']], - ], - [ - ['mt', ['margin-top']], - ['mr', ['margin-right']], - ['mb', ['margin-bottom']], - ['ml', ['margin-left']], - ], - ]) -} diff --git a/src/plugins/maxHeight.js b/src/plugins/maxHeight.js deleted file mode 100644 index e34e8a473..000000000 --- a/src/plugins/maxHeight.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]]) -} diff --git a/src/plugins/maxWidth.js b/src/plugins/maxWidth.js deleted file mode 100644 index 64da02555..000000000 --- a/src/plugins/maxWidth.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]]) -} diff --git a/src/plugins/minHeight.js b/src/plugins/minHeight.js deleted file mode 100644 index ba1531783..000000000 --- a/src/plugins/minHeight.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('minHeight', [['min-h', ['minHeight']]]) -} diff --git a/src/plugins/minWidth.js b/src/plugins/minWidth.js deleted file mode 100644 index c654635c1..000000000 --- a/src/plugins/minWidth.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('minWidth', [['min-w', ['minWidth']]]) -} diff --git a/src/plugins/mixBlendMode.js b/src/plugins/mixBlendMode.js deleted file mode 100644 index 652ce0a2a..000000000 --- a/src/plugins/mixBlendMode.js +++ /dev/null @@ -1,25 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.mix-blend-normal': { 'mix-blend-mode': 'normal' }, - '.mix-blend-multiply': { 'mix-blend-mode': 'multiply' }, - '.mix-blend-screen': { 'mix-blend-mode': 'screen' }, - '.mix-blend-overlay': { 'mix-blend-mode': 'overlay' }, - '.mix-blend-darken': { 'mix-blend-mode': 'darken' }, - '.mix-blend-lighten': { 'mix-blend-mode': 'lighten' }, - '.mix-blend-color-dodge': { 'mix-blend-mode': 'color-dodge' }, - '.mix-blend-color-burn': { 'mix-blend-mode': 'color-burn' }, - '.mix-blend-hard-light': { 'mix-blend-mode': 'hard-light' }, - '.mix-blend-soft-light': { 'mix-blend-mode': 'soft-light' }, - '.mix-blend-difference': { 'mix-blend-mode': 'difference' }, - '.mix-blend-exclusion': { 'mix-blend-mode': 'exclusion' }, - '.mix-blend-hue': { 'mix-blend-mode': 'hue' }, - '.mix-blend-saturation': { 'mix-blend-mode': 'saturation' }, - '.mix-blend-color': { 'mix-blend-mode': 'color' }, - '.mix-blend-luminosity': { 'mix-blend-mode': 'luminosity' }, - }, - variants('mixBlendMode') - ) - } -} diff --git a/src/plugins/objectFit.js b/src/plugins/objectFit.js deleted file mode 100644 index c6d328a99..000000000 --- a/src/plugins/objectFit.js +++ /dev/null @@ -1,14 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.object-contain': { 'object-fit': 'contain' }, - '.object-cover': { 'object-fit': 'cover' }, - '.object-fill': { 'object-fit': 'fill' }, - '.object-none': { 'object-fit': 'none' }, - '.object-scale-down': { 'object-fit': 'scale-down' }, - }, - variants('objectFit') - ) - } -} diff --git a/src/plugins/objectPosition.js b/src/plugins/objectPosition.js deleted file mode 100644 index 193bcde48..000000000 --- a/src/plugins/objectPosition.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asList } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('objectPosition', [['object', ['object-position']]], { - resolveArbitraryValue: asList, - }) -} diff --git a/src/plugins/opacity.js b/src/plugins/opacity.js deleted file mode 100644 index d11674023..000000000 --- a/src/plugins/opacity.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('opacity', [['opacity', ['opacity']]]) -} diff --git a/src/plugins/order.js b/src/plugins/order.js deleted file mode 100644 index a75b20dc8..000000000 --- a/src/plugins/order.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('order') -} diff --git a/src/plugins/outline.js b/src/plugins/outline.js deleted file mode 100644 index 86a1ca002..000000000 --- a/src/plugins/outline.js +++ /dev/null @@ -1,14 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - outline: (value) => { - let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [value] - - return { outline, 'outline-offset': outlineOffset } - }, - }, - { values: theme('outline'), variants: variants('outline'), type: 'any' } - ) - } -} diff --git a/src/plugins/overflow.js b/src/plugins/overflow.js deleted file mode 100644 index a28636e2e..000000000 --- a/src/plugins/overflow.js +++ /dev/null @@ -1,21 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.overflow-auto': { overflow: 'auto' }, - '.overflow-hidden': { overflow: 'hidden' }, - '.overflow-visible': { overflow: 'visible' }, - '.overflow-scroll': { overflow: 'scroll' }, - '.overflow-x-auto': { 'overflow-x': 'auto' }, - '.overflow-y-auto': { 'overflow-y': 'auto' }, - '.overflow-x-hidden': { 'overflow-x': 'hidden' }, - '.overflow-y-hidden': { 'overflow-y': 'hidden' }, - '.overflow-x-visible': { 'overflow-x': 'visible' }, - '.overflow-y-visible': { 'overflow-y': 'visible' }, - '.overflow-x-scroll': { 'overflow-x': 'scroll' }, - '.overflow-y-scroll': { 'overflow-y': 'scroll' }, - }, - variants('overflow') - ) - } -} diff --git a/src/plugins/overscrollBehavior.js b/src/plugins/overscrollBehavior.js deleted file mode 100644 index a96489a5b..000000000 --- a/src/plugins/overscrollBehavior.js +++ /dev/null @@ -1,18 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.overscroll-auto': { 'overscroll-behavior': 'auto' }, - '.overscroll-contain': { 'overscroll-behavior': 'contain' }, - '.overscroll-none': { 'overscroll-behavior': 'none' }, - '.overscroll-y-auto': { 'overscroll-behavior-y': 'auto' }, - '.overscroll-y-contain': { 'overscroll-behavior-y': 'contain' }, - '.overscroll-y-none': { 'overscroll-behavior-y': 'none' }, - '.overscroll-x-auto': { 'overscroll-behavior-x': 'auto' }, - '.overscroll-x-contain': { 'overscroll-behavior-x': 'contain' }, - '.overscroll-x-none': { 'overscroll-behavior-x': 'none' }, - }, - variants('overscrollBehavior') - ) - } -} diff --git a/src/plugins/padding.js b/src/plugins/padding.js deleted file mode 100644 index 2dafb81c0..000000000 --- a/src/plugins/padding.js +++ /dev/null @@ -1,17 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('padding', [ - ['p', ['padding']], - [ - ['px', ['padding-left', 'padding-right']], - ['py', ['padding-top', 'padding-bottom']], - ], - [ - ['pt', ['padding-top']], - ['pr', ['padding-right']], - ['pb', ['padding-bottom']], - ['pl', ['padding-left']], - ], - ]) -} diff --git a/src/plugins/placeContent.js b/src/plugins/placeContent.js deleted file mode 100644 index cdd1507f8..000000000 --- a/src/plugins/placeContent.js +++ /dev/null @@ -1,30 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.place-content-center': { - 'place-content': 'center', - }, - '.place-content-start': { - 'place-content': 'start', - }, - '.place-content-end': { - 'place-content': 'end', - }, - '.place-content-between': { - 'place-content': 'space-between', - }, - '.place-content-around': { - 'place-content': 'space-around', - }, - '.place-content-evenly': { - 'place-content': 'space-evenly', - }, - '.place-content-stretch': { - 'place-content': 'stretch', - }, - }, - variants('placeContent') - ) - } -} diff --git a/src/plugins/placeItems.js b/src/plugins/placeItems.js deleted file mode 100644 index df5d715a7..000000000 --- a/src/plugins/placeItems.js +++ /dev/null @@ -1,21 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.place-items-start': { - 'place-items': 'start', - }, - '.place-items-end': { - 'place-items': 'end', - }, - '.place-items-center': { - 'place-items': 'center', - }, - '.place-items-stretch': { - 'place-items': 'stretch', - }, - }, - variants('placeItems') - ) - } -} diff --git a/src/plugins/placeSelf.js b/src/plugins/placeSelf.js deleted file mode 100644 index 2bd501eb9..000000000 --- a/src/plugins/placeSelf.js +++ /dev/null @@ -1,24 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.place-self-auto': { - 'place-self': 'auto', - }, - '.place-self-start': { - 'place-self': 'start', - }, - '.place-self-end': { - 'place-self': 'end', - }, - '.place-self-center': { - 'place-self': 'center', - }, - '.place-self-stretch': { - 'place-self': 'stretch', - }, - }, - variants('placeSelf') - ) - } -} diff --git a/src/plugins/placeholderColor.js b/src/plugins/placeholderColor.js deleted file mode 100644 index 412d3647d..000000000 --- a/src/plugins/placeholderColor.js +++ /dev/null @@ -1,33 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, theme, variants, corePlugins }) { - matchUtilities( - { - placeholder: (value) => { - if (!corePlugins('placeholderOpacity')) { - return { - '&::placeholder': { - color: value, - }, - } - } - - return { - '&::placeholder': withAlphaVariable({ - color: value, - property: 'color', - variable: '--tw-placeholder-opacity', - }), - } - }, - }, - { - values: flattenColorPalette(theme('placeholderColor')), - variants: variants('placeholderColor'), - type: ['color', 'any'], - } - ) - } -} diff --git a/src/plugins/placeholderOpacity.js b/src/plugins/placeholderOpacity.js deleted file mode 100644 index 544afadee..000000000 --- a/src/plugins/placeholderOpacity.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'placeholder-opacity': (value) => { - return { ['&::placeholder']: { '--tw-placeholder-opacity': value } } - }, - }, - { - values: theme('placeholderOpacity'), - variants: variants('placeholderOpacity'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/pointerEvents.js b/src/plugins/pointerEvents.js deleted file mode 100644 index c5b303298..000000000 --- a/src/plugins/pointerEvents.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.pointer-events-none': { 'pointer-events': 'none' }, - '.pointer-events-auto': { 'pointer-events': 'auto' }, - }, - variants('pointerEvents') - ) - } -} diff --git a/src/plugins/position.js b/src/plugins/position.js deleted file mode 100644 index 26b09d1d1..000000000 --- a/src/plugins/position.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.static': { position: 'static' }, - '.fixed': { position: 'fixed' }, - '.absolute': { position: 'absolute' }, - '.relative': { position: 'relative' }, - '.sticky': { - position: 'sticky', - }, - }, - variants('position') - ) - } -} diff --git a/src/plugins/preflight.js b/src/plugins/preflight.js deleted file mode 100644 index 8657aebc1..000000000 --- a/src/plugins/preflight.js +++ /dev/null @@ -1,16 +0,0 @@ -import fs from 'fs' -import postcss from 'postcss' -import packageJson from '../../package.json' - -export default function () { - return function ({ addBase }) { - const preflightStyles = postcss.parse(fs.readFileSync(`${__dirname}/css/preflight.css`, 'utf8')) - - addBase([ - postcss.comment({ - text: `! tailwindcss v${packageJson.version} | MIT License | https://tailwindcss.com`, - }), - ...preflightStyles.nodes, - ]) - } -} diff --git a/src/plugins/resize.js b/src/plugins/resize.js deleted file mode 100644 index 52d922ab9..000000000 --- a/src/plugins/resize.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.resize-none': { resize: 'none' }, - '.resize-y': { resize: 'vertical' }, - '.resize-x': { resize: 'horizontal' }, - '.resize': { resize: 'both' }, - }, - variants('resize') - ) - } -} diff --git a/src/plugins/ringColor.js b/src/plugins/ringColor.js deleted file mode 100644 index 0150761d7..000000000 --- a/src/plugins/ringColor.js +++ /dev/null @@ -1,27 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - ring: (value) => { - return withAlphaVariable({ - color: value, - property: '--tw-ring-color', - variable: '--tw-ring-opacity', - }) - }, - }, - { - values: Object.fromEntries( - Object.entries(flattenColorPalette(theme('ringColor'))).filter( - ([modifier]) => modifier !== 'DEFAULT' - ) - ), - variants: variants('ringColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/ringOffsetColor.js b/src/plugins/ringOffsetColor.js deleted file mode 100644 index 4213a1dda..000000000 --- a/src/plugins/ringOffsetColor.js +++ /dev/null @@ -1,21 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - 'ring-offset': (value) => { - return { - '--tw-ring-offset-color': toColorValue(value), - } - }, - }, - { - values: flattenColorPalette(theme('ringOffsetColor')), - variants: variants('ringOffsetColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/ringOffsetWidth.js b/src/plugins/ringOffsetWidth.js deleted file mode 100644 index 65c55aa67..000000000 --- a/src/plugins/ringOffsetWidth.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLength } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('ringOffsetWidth', [['ring-offset', ['--tw-ring-offset-width']]], { - resolveArbitraryValue: asLength, - }) -} diff --git a/src/plugins/ringOpacity.js b/src/plugins/ringOpacity.js deleted file mode 100644 index 39bdc00b0..000000000 --- a/src/plugins/ringOpacity.js +++ /dev/null @@ -1,7 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('ringOpacity', [['ring-opacity', ['--tw-ring-opacity']]], { - filterDefault: true, - }) -} diff --git a/src/plugins/ringWidth.js b/src/plugins/ringWidth.js deleted file mode 100644 index fef5d2e2e..000000000 --- a/src/plugins/ringWidth.js +++ /dev/null @@ -1,56 +0,0 @@ -import { withAlphaValue } from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, addBase, addUtilities, theme, variants }) { - let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5') - let ringColorDefault = withAlphaValue( - theme('ringColor.DEFAULT'), - ringOpacityDefault, - `rgba(147, 197, 253, ${ringOpacityDefault})` - ) - - addBase({ - '@defaults ring-width': { - '--tw-ring-inset': 'var(--tw-empty,/*!*/ /*!*/)', - '--tw-ring-offset-width': theme('ringOffsetWidth.DEFAULT', '0px'), - '--tw-ring-offset-color': theme('ringOffsetColor.DEFAULT', '#fff'), - '--tw-ring-color': ringColorDefault, - '--tw-ring-offset-shadow': '0 0 #0000', - '--tw-ring-shadow': '0 0 #0000', - '--tw-shadow': '0 0 #0000', - }, - }) - - matchUtilities( - { - ring: (value) => { - return { - '@defaults ring-width': {}, - '--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, - '--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, - 'box-shadow': [ - `var(--tw-ring-offset-shadow)`, - `var(--tw-ring-shadow)`, - `var(--tw-shadow, 0 0 #0000)`, - ].join(', '), - } - }, - }, - { - values: theme('ringWidth'), - variants: variants('ringWidth'), - type: 'length', - } - ) - - addUtilities( - { - '.ring-inset': { - '@defaults ring-width': {}, - '--tw-ring-inset': 'inset', - }, - }, - variants('ringWidth') - ) - } -} diff --git a/src/plugins/rotate.js b/src/plugins/rotate.js deleted file mode 100644 index d7f3c3083..000000000 --- a/src/plugins/rotate.js +++ /dev/null @@ -1,7 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('rotate', [ - ['rotate', [['@defaults transform', {}], '--tw-rotate', ['transform', 'var(--tw-transform)']]], - ]) -} diff --git a/src/plugins/saturate.js b/src/plugins/saturate.js deleted file mode 100644 index 42946d186..000000000 --- a/src/plugins/saturate.js +++ /dev/null @@ -1,20 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - saturate: (value) => { - return { - '--tw-saturate': `saturate(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { - values: theme('saturate'), - variants: variants('saturate'), - type: 'any', - } - ) - } -} diff --git a/src/plugins/scale.js b/src/plugins/scale.js deleted file mode 100644 index a9eb4ff93..000000000 --- a/src/plugins/scale.js +++ /dev/null @@ -1,25 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('scale', [ - [ - 'scale', - [ - ['@defaults transform', {}], - '--tw-scale-x', - '--tw-scale-y', - ['transform', 'var(--tw-transform)'], - ], - ], - [ - [ - 'scale-x', - [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']], - ], - [ - 'scale-y', - [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']], - ], - ], - ]) -} diff --git a/src/plugins/sepia.js b/src/plugins/sepia.js deleted file mode 100644 index 9d4d7c531..000000000 --- a/src/plugins/sepia.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - sepia: (value) => { - return { - '--tw-sepia': `sepia(${value})`, - '@defaults filter': {}, - filter: 'var(--tw-filter)', - } - }, - }, - { values: theme('sepia'), variants: variants('sepia'), type: 'any' } - ) - } -} diff --git a/src/plugins/skew.js b/src/plugins/skew.js deleted file mode 100644 index d24a307a6..000000000 --- a/src/plugins/skew.js +++ /dev/null @@ -1,16 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('skew', [ - [ - [ - 'skew-x', - [['@defaults transform', {}], '--tw-skew-x', ['transform', 'var(--tw-transform)']], - ], - [ - 'skew-y', - [['@defaults transform', {}], '--tw-skew-y', ['transform', 'var(--tw-transform)']], - ], - ], - ]) -} diff --git a/src/plugins/space.js b/src/plugins/space.js deleted file mode 100644 index 3f119a6cd..000000000 --- a/src/plugins/space.js +++ /dev/null @@ -1,47 +0,0 @@ -export default function () { - return function ({ matchUtilities, addUtilities, theme, variants }) { - matchUtilities( - { - 'space-x': (value) => { - value = value === '0' ? '0px' : value - - return { - '& > :not([hidden]) ~ :not([hidden])': { - '--tw-space-x-reverse': '0', - 'margin-right': `calc(${value} * var(--tw-space-x-reverse))`, - 'margin-left': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`, - }, - } - }, - 'space-y': (value) => { - value = value === '0' ? '0px' : value - - return { - '& > :not([hidden]) ~ :not([hidden])': { - '--tw-space-y-reverse': '0', - 'margin-top': `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`, - 'margin-bottom': `calc(${value} * var(--tw-space-y-reverse))`, - }, - } - }, - }, - { - values: theme('space'), - variants: variants('space'), - type: 'any', - } - ) - - addUtilities( - { - '.space-y-reverse > :not([hidden]) ~ :not([hidden])': { - '--tw-space-y-reverse': '1', - }, - '.space-x-reverse > :not([hidden]) ~ :not([hidden])': { - '--tw-space-x-reverse': '1', - }, - }, - variants('space') - ) - } -} diff --git a/src/plugins/stroke.js b/src/plugins/stroke.js deleted file mode 100644 index 3fb1ea9ce..000000000 --- a/src/plugins/stroke.js +++ /dev/null @@ -1,21 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import toColorValue from '../util/toColorValue' - -export default function () { - return function ({ matchUtilities, theme, variants }) { - matchUtilities( - { - stroke: (value) => { - return { - stroke: toColorValue(value), - } - }, - }, - { - values: flattenColorPalette(theme('stroke')), - variants: variants('stroke'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/strokeWidth.js b/src/plugins/strokeWidth.js deleted file mode 100644 index c001d9519..000000000 --- a/src/plugins/strokeWidth.js +++ /dev/null @@ -1,8 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' -import { asLength } from '../util/pluginUtils' - -export default function () { - return createUtilityPlugin('strokeWidth', [['stroke', ['stroke-width']]], { - resolveArbitraryValue: asLength, - }) -} diff --git a/src/plugins/tableLayout.js b/src/plugins/tableLayout.js deleted file mode 100644 index c2a450019..000000000 --- a/src/plugins/tableLayout.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.table-auto': { 'table-layout': 'auto' }, - '.table-fixed': { 'table-layout': 'fixed' }, - }, - variants('tableLayout') - ) - } -} diff --git a/src/plugins/textAlign.js b/src/plugins/textAlign.js deleted file mode 100644 index 21cf63f49..000000000 --- a/src/plugins/textAlign.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.text-left': { 'text-align': 'left' }, - '.text-center': { 'text-align': 'center' }, - '.text-right': { 'text-align': 'right' }, - '.text-justify': { 'text-align': 'justify' }, - }, - variants('textAlign') - ) - } -} diff --git a/src/plugins/textColor.js b/src/plugins/textColor.js deleted file mode 100644 index a9b110109..000000000 --- a/src/plugins/textColor.js +++ /dev/null @@ -1,27 +0,0 @@ -import flattenColorPalette from '../util/flattenColorPalette' -import withAlphaVariable from '../util/withAlphaVariable' - -export default function () { - return function ({ matchUtilities, theme, variants, corePlugins }) { - matchUtilities( - { - text: (value) => { - if (!corePlugins('textOpacity')) { - return { color: value } - } - - return withAlphaVariable({ - color: value, - property: 'color', - variable: '--tw-text-opacity', - }) - }, - }, - { - values: flattenColorPalette(theme('textColor')), - variants: variants('textColor'), - type: 'color', - } - ) - } -} diff --git a/src/plugins/textDecoration.js b/src/plugins/textDecoration.js deleted file mode 100644 index 807ea4005..000000000 --- a/src/plugins/textDecoration.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.underline': { 'text-decoration': 'underline' }, - '.line-through': { 'text-decoration': 'line-through' }, - '.no-underline': { 'text-decoration': 'none' }, - }, - variants('textDecoration') - ) - } -} diff --git a/src/plugins/textIndent.js b/src/plugins/textIndent.js deleted file mode 100644 index e7c191695..000000000 --- a/src/plugins/textIndent.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('textIndent', [['indent', ['text-indent']]]) -} diff --git a/src/plugins/textOpacity.js b/src/plugins/textOpacity.js deleted file mode 100644 index feaa6350b..000000000 --- a/src/plugins/textOpacity.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('textOpacity', [['text-opacity', ['--tw-text-opacity']]]) -} diff --git a/src/plugins/textOverflow.js b/src/plugins/textOverflow.js deleted file mode 100644 index 9d99aafaf..000000000 --- a/src/plugins/textOverflow.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.truncate': { - overflow: 'hidden', - 'text-overflow': 'ellipsis', - 'white-space': 'nowrap', - }, - '.overflow-ellipsis': { 'text-overflow': 'ellipsis' }, - '.overflow-clip': { 'text-overflow': 'clip' }, - }, - variants('textOverflow') - ) - } -} diff --git a/src/plugins/textTransform.js b/src/plugins/textTransform.js deleted file mode 100644 index 6ac37b1e1..000000000 --- a/src/plugins/textTransform.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.uppercase': { 'text-transform': 'uppercase' }, - '.lowercase': { 'text-transform': 'lowercase' }, - '.capitalize': { 'text-transform': 'capitalize' }, - '.normal-case': { 'text-transform': 'none' }, - }, - variants('textTransform') - ) - } -} diff --git a/src/plugins/transform.js b/src/plugins/transform.js deleted file mode 100644 index f2f958bfd..000000000 --- a/src/plugins/transform.js +++ /dev/null @@ -1,55 +0,0 @@ -export default function () { - return function ({ addBase, addUtilities, variants }) { - addBase({ - '@defaults transform': { - '--tw-translate-x': '0', - '--tw-translate-y': '0', - '--tw-rotate': '0', - '--tw-skew-x': '0', - '--tw-skew-y': '0', - '--tw-scale-x': '1', - '--tw-scale-y': '1', - '--tw-transform': [ - 'translateX(var(--tw-translate-x))', - 'translateY(var(--tw-translate-y))', - 'rotate(var(--tw-rotate))', - 'skewX(var(--tw-skew-x))', - 'skewY(var(--tw-skew-y))', - 'scaleX(var(--tw-scale-x))', - 'scaleY(var(--tw-scale-y))', - ].join(' '), - }, - }) - addUtilities( - { - '.transform': { - '@defaults transform': {}, - transform: 'var(--tw-transform)', - }, - '.transform-cpu': { - '--tw-transform': [ - 'translateX(var(--tw-translate-x))', - 'translateY(var(--tw-translate-y))', - 'rotate(var(--tw-rotate))', - 'skewX(var(--tw-skew-x))', - 'skewY(var(--tw-skew-y))', - 'scaleX(var(--tw-scale-x))', - 'scaleY(var(--tw-scale-y))', - ].join(' '), - }, - '.transform-gpu': { - '--tw-transform': [ - 'translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)', - 'rotate(var(--tw-rotate))', - 'skewX(var(--tw-skew-x))', - 'skewY(var(--tw-skew-y))', - 'scaleX(var(--tw-scale-x))', - 'scaleY(var(--tw-scale-y))', - ].join(' '), - }, - '.transform-none': { transform: 'none' }, - }, - variants('transform') - ) - } -} diff --git a/src/plugins/transformOrigin.js b/src/plugins/transformOrigin.js deleted file mode 100644 index a607ce5ab..000000000 --- a/src/plugins/transformOrigin.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]) -} diff --git a/src/plugins/transitionDelay.js b/src/plugins/transitionDelay.js deleted file mode 100644 index 00de6d260..000000000 --- a/src/plugins/transitionDelay.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('transitionDelay', [['delay', ['transitionDelay']]]) -} diff --git a/src/plugins/transitionDuration.js b/src/plugins/transitionDuration.js deleted file mode 100644 index 45991cea3..000000000 --- a/src/plugins/transitionDuration.js +++ /dev/null @@ -1,7 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('transitionDuration', [['duration', ['transitionDuration']]], { - filterDefault: true, - }) -} diff --git a/src/plugins/transitionProperty.js b/src/plugins/transitionProperty.js deleted file mode 100644 index 7aa84df89..000000000 --- a/src/plugins/transitionProperty.js +++ /dev/null @@ -1,27 +0,0 @@ -export default function () { - return function ({ matchUtilities, theme, variants }) { - let defaultTimingFunction = theme('transitionTimingFunction.DEFAULT') - let defaultDuration = theme('transitionDuration.DEFAULT') - - matchUtilities( - { - transition: (value) => { - return { - 'transition-property': value, - ...(value === 'none' - ? {} - : { - 'transition-timing-function': defaultTimingFunction, - 'transition-duration': defaultDuration, - }), - } - }, - }, - { - values: theme('transitionProperty'), - variants: variants('transitionProperty'), - type: 'lookup', - } - ) - } -} diff --git a/src/plugins/transitionTimingFunction.js b/src/plugins/transitionTimingFunction.js deleted file mode 100644 index d9887b39e..000000000 --- a/src/plugins/transitionTimingFunction.js +++ /dev/null @@ -1,7 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('transitionTimingFunction', [['ease', ['transitionTimingFunction']]], { - filterDefault: true, - }) -} diff --git a/src/plugins/translate.js b/src/plugins/translate.js deleted file mode 100644 index 348d73ec9..000000000 --- a/src/plugins/translate.js +++ /dev/null @@ -1,16 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('translate', [ - [ - [ - 'translate-x', - [['@defaults transform', {}], '--tw-translate-x', ['transform', 'var(--tw-transform)']], - ], - [ - 'translate-y', - [['@defaults transform', {}], '--tw-translate-y', ['transform', 'var(--tw-transform)']], - ], - ], - ]) -} diff --git a/src/plugins/userSelect.js b/src/plugins/userSelect.js deleted file mode 100644 index 04ce5c4a0..000000000 --- a/src/plugins/userSelect.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.select-none': { 'user-select': 'none' }, - '.select-text': { 'user-select': 'text' }, - '.select-all': { 'user-select': 'all' }, - '.select-auto': { 'user-select': 'auto' }, - }, - variants('userSelect') - ) - } -} diff --git a/src/plugins/verticalAlign.js b/src/plugins/verticalAlign.js deleted file mode 100644 index eeaffad2b..000000000 --- a/src/plugins/verticalAlign.js +++ /dev/null @@ -1,15 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.align-baseline': { 'vertical-align': 'baseline' }, - '.align-top': { 'vertical-align': 'top' }, - '.align-middle': { 'vertical-align': 'middle' }, - '.align-bottom': { 'vertical-align': 'bottom' }, - '.align-text-top': { 'vertical-align': 'text-top' }, - '.align-text-bottom': { 'vertical-align': 'text-bottom' }, - }, - variants('verticalAlign') - ) - } -} diff --git a/src/plugins/visibility.js b/src/plugins/visibility.js deleted file mode 100644 index bfc9b206a..000000000 --- a/src/plugins/visibility.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.visible': { visibility: 'visible' }, - '.invisible': { visibility: 'hidden' }, - }, - variants('visibility') - ) - } -} diff --git a/src/plugins/whitespace.js b/src/plugins/whitespace.js deleted file mode 100644 index 1938652df..000000000 --- a/src/plugins/whitespace.js +++ /dev/null @@ -1,14 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.whitespace-normal': { 'white-space': 'normal' }, - '.whitespace-nowrap': { 'white-space': 'nowrap' }, - '.whitespace-pre': { 'white-space': 'pre' }, - '.whitespace-pre-line': { 'white-space': 'pre-line' }, - '.whitespace-pre-wrap': { 'white-space': 'pre-wrap' }, - }, - variants('whitespace') - ) - } -} diff --git a/src/plugins/width.js b/src/plugins/width.js deleted file mode 100644 index 1887d0e78..000000000 --- a/src/plugins/width.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('width', [['w', ['width']]]) -} diff --git a/src/plugins/willChange.js b/src/plugins/willChange.js deleted file mode 100644 index 6807f950b..000000000 --- a/src/plugins/willChange.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('willChange', [['will-change', ['will-change']]]) -} diff --git a/src/plugins/wordBreak.js b/src/plugins/wordBreak.js deleted file mode 100644 index fb2ef8794..000000000 --- a/src/plugins/wordBreak.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function () { - return function ({ addUtilities, variants }) { - addUtilities( - { - '.break-normal': { - 'overflow-wrap': 'normal', - 'word-break': 'normal', - }, - '.break-words': { - 'overflow-wrap': 'break-word', - }, - '.break-all': { 'word-break': 'break-all' }, - }, - variants('wordBreak') - ) - } -} diff --git a/src/plugins/zIndex.js b/src/plugins/zIndex.js deleted file mode 100644 index 41ac639cc..000000000 --- a/src/plugins/zIndex.js +++ /dev/null @@ -1,5 +0,0 @@ -import createUtilityPlugin from '../util/createUtilityPlugin' - -export default function () { - return createUtilityPlugin('zIndex', [['z', ['zIndex']]]) -}