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
This commit is contained in:
Robin Malfait 2021-09-09 15:22:50 +02:00 committed by GitHub
parent 00025020f7
commit 688357fdde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
156 changed files with 2185 additions and 3239 deletions

View File

@ -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'),

File diff suppressed because it is too large Load Diff

View File

@ -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'

View File

@ -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'],
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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') }
)
}
}

View File

@ -1,10 +0,0 @@
export default function () {
return function ({ addUtilities, variants }) {
addUtilities(
{
'.appearance-none': { appearance: 'none' },
},
variants('appearance')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('aspectRatio', [['aspect', ['aspect-ratio']]])
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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,
})
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('backgroundOpacity', [['bg-opacity', ['--tw-bg-opacity']]])
}

View File

@ -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')
)
}
}

View File

@ -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,
})
}

View File

@ -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')
)
}
}

View File

@ -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,
})
}

View File

@ -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',
}
)
}
}

View File

@ -1,11 +0,0 @@
export default function () {
return function ({ addUtilities, variants }) {
addUtilities(
{
'.border-collapse': { 'border-collapse': 'collapse' },
'.border-separate': { 'border-collapse': 'separate' },
},
variants('borderCollapse')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('borderOpacity', [['border-opacity', ['--tw-border-opacity']]])
}

View File

@ -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']],
],
])
}

View File

@ -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')
)
}
}

View File

@ -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 }
)
}

View File

@ -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')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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'],
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('content')
}

View File

@ -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' }
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('cursor')
}

View File

@ -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')
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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'))
}
}

View File

@ -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'],
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('flex')
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('flexGrow', [['flex-grow', ['flex-grow']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('flexShrink', [['flex-shrink', ['flex-shrink']]])
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,8 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
import { asLookupValue } from '../util/pluginUtils'
export default function () {
return createUtilityPlugin('fontFamily', [['font', ['fontFamily']]], {
resolveArbitraryValue: asLookupValue,
})
}

View File

@ -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',
}
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,11 +0,0 @@
export default function () {
return function ({ addUtilities, variants }) {
addUtilities(
{
'.italic': { 'font-style': 'italic' },
'.not-italic': { 'font-style': 'normal' },
},
variants('fontStyle')
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,8 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
import { asLookupValue } from '../util/pluginUtils'
export default function () {
return createUtilityPlugin('fontWeight', [['font', ['fontWeight']]], {
resolveArbitraryValue: asLookupValue,
})
}

View File

@ -1,11 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gap', [
['gap', ['gap']],
[
['gap-x', ['columnGap']],
['gap-y', ['rowGap']],
],
])
}

View File

@ -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
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridAutoColumns', [['auto-cols', ['gridAutoColumns']]])
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridAutoRows', [['auto-rows', ['gridAutoRows']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridColumn', [['col', ['gridColumn']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridColumnEnd', [['col-end', ['gridColumnEnd']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridColumnStart', [['col-start', ['gridColumnStart']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridRow', [['row', ['gridRow']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridRowEnd', [['row-end', ['gridRowEnd']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('gridRowStart', [['row-start', ['gridRowStart']]])
}

View File

@ -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,
})
}

View File

@ -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,
})
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('height', [['h', ['height']]])
}

View File

@ -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',
}
)
}
}

View File

@ -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'

View File

@ -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
)
}
}

View File

@ -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',
}
)
}
}

View File

@ -1,15 +0,0 @@
export default function () {
return function ({ addUtilities, variants }) {
addUtilities(
{
'.isolate': {
isolation: 'isolate',
},
'.isolation-auto': {
isolation: 'auto',
},
},
variants('isolation')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('letterSpacing', [['tracking', ['letterSpacing']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('lineHeight', [['leading', ['lineHeight']]])
}

View File

@ -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')
)
}
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('listStyleType', [['list', ['listStyleType']]])
}

View File

@ -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']],
],
])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('maxHeight', [['max-h', ['maxHeight']]])
}

View File

@ -1,5 +0,0 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
export default function () {
return createUtilityPlugin('maxWidth', [['max-w', ['maxWidth']]])
}

Some files were not shown because too many files have changed in this diff Show More