mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Fix style
This commit is contained in:
parent
b242fb70b5
commit
d541742774
@ -3,7 +3,7 @@
|
||||
"jest": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"extends": ["prettier"],
|
||||
|
||||
@ -2,9 +2,9 @@ const { nameClass } = require('../pluginUtils')
|
||||
const transformThemeValue = require('../../lib/util/transformThemeValue').default
|
||||
const parseAnimationValue = require('../../lib/util/parseAnimationValue').default
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let keyframes = Object.fromEntries(
|
||||
Object.entries(theme.keyframes).map(([key, value]) => {
|
||||
Object.entries(theme('keyframes')).map(([key, value]) => {
|
||||
return [
|
||||
key,
|
||||
[
|
||||
|
||||
@ -2,8 +2,8 @@ const flattenColorPalette = require('../../lib/util/flattenColorPalette').defaul
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.backgroundColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('backgroundColor'))
|
||||
|
||||
matchUtilities({
|
||||
bg: (modifier) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
bg: (modifier, { theme }) => {
|
||||
let value = theme.backgroundImage[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme, addVariant, e } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'bg-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.backgroundOpacity)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
bg: (modifier, { theme }) => {
|
||||
let value = theme.backgroundPosition[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
bg: (modifier, { theme }) => {
|
||||
let value = theme.backgroundSize[modifier]
|
||||
|
||||
@ -2,8 +2,8 @@ const flattenColorPalette = require('../../lib/util/flattenColorPalette').defaul
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.borderColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('borderColor'))
|
||||
|
||||
matchUtilities({
|
||||
border: (modifier) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'border-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.borderOpacity)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
rounded: (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['borderRadius'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
border: (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['borderWidth'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
cursor: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.cursor)
|
||||
|
||||
@ -2,8 +2,8 @@ const flattenColorPalette = require('../../lib/util/flattenColorPalette').defaul
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.divideColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('divideColor'))
|
||||
|
||||
// TODO: Make sure there is no issue with DEFAULT here
|
||||
matchUtilities({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'divide-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.divideOpacity)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ addUtilities, matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ addUtilities, matchUtilities }) {
|
||||
matchUtilities({
|
||||
'divide-x': (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['divideWidth'])
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.fill)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('fill'))
|
||||
|
||||
matchUtilities({
|
||||
fill: (modifier, { theme }) => {
|
||||
fill: (modifier) => {
|
||||
let value = asColor(modifier, colorPalette)
|
||||
|
||||
if (value === undefined) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'flex-grow': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.flexGrow)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'flex-shrink': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.flexShrink)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
const { isPlainObject } = require('../lib/utils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
text: (modifier, { theme }) => {
|
||||
let value = theme.fontSize[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
gap: (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['gap'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asList, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'auto-cols': (modifier, { theme }) => {
|
||||
let value = asList(modifier, theme.gridAutoColumns)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asList, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'auto-rows': (modifier, { theme }) => {
|
||||
let value = asList(modifier, theme.gridAutoRows)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'row-end': (modifier, { theme }) => {
|
||||
let value = theme.gridRowEnd[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'row-start': (modifier, { theme }) => {
|
||||
let value = theme.gridRowStart[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asList, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'grid-cols': (modifier, { theme }) => {
|
||||
let value = asList(modifier, theme.gridTemplateColumns)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asList, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'grid-rows': (modifier, { theme }) => {
|
||||
let value = asList(modifier, theme.gridTemplateRows)
|
||||
|
||||
@ -10,7 +10,7 @@ const {
|
||||
} = require('../pluginUtils')
|
||||
|
||||
module.exports = {
|
||||
pseudoClassVariants: function ({ config, theme, addVariant }) {
|
||||
pseudoClassVariants: function ({ config, addVariant }) {
|
||||
let pseudoVariants = [
|
||||
['first', 'first-child'],
|
||||
['last', 'last-child'],
|
||||
@ -62,7 +62,7 @@ module.exports = {
|
||||
)
|
||||
}
|
||||
},
|
||||
directionVariants: function ({ config, theme, addVariant }) {
|
||||
directionVariants: function ({ config, addVariant }) {
|
||||
addVariant(
|
||||
'ltr',
|
||||
transformAllSelectors(
|
||||
@ -85,7 +85,7 @@ module.exports = {
|
||||
)
|
||||
)
|
||||
},
|
||||
reducedMotionVariants: function ({ config, theme, addVariant }) {
|
||||
reducedMotionVariants: function ({ config, addVariant }) {
|
||||
addVariant(
|
||||
'motion-safe',
|
||||
transformLastClasses(
|
||||
@ -106,7 +106,7 @@ module.exports = {
|
||||
)
|
||||
)
|
||||
},
|
||||
darkVariants: function ({ config, theme, addVariant }) {
|
||||
darkVariants: function ({ config, addVariant }) {
|
||||
if (config('darkMode') === 'class') {
|
||||
addVariant(
|
||||
'dark',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
tracking: (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['letterSpacing'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
leading: (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['lineHeight'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
opacity: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.opacity)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
order: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.order)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
outline: (modifier, { theme }) => {
|
||||
let value = theme.outline[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
p: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme['padding'])
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.placeholderColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('placeholderColor'))
|
||||
|
||||
matchUtilities({
|
||||
placeholder: (modifier, { theme }) => {
|
||||
placeholder: (modifier) => {
|
||||
let value = asColor(modifier, colorPalette)
|
||||
|
||||
if (value === undefined) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'placeholder-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.placeholderOpacity)
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.ringColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('ringColor'))
|
||||
|
||||
matchUtilities({
|
||||
ring: (modifier, { theme }) => {
|
||||
ring: (modifier) => {
|
||||
if (modifier === 'DEFAULT') {
|
||||
return []
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.ringOffsetColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('ringOffsetColor'))
|
||||
|
||||
matchUtilities({
|
||||
'ring-offset': (modifier, { theme }) => {
|
||||
'ring-offset': (modifier) => {
|
||||
let value = asColor(modifier, colorPalette)
|
||||
|
||||
if (value === undefined) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'ring-offset': (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['ringOffsetWidth'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'ring-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme['ringOpacity'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asAngle, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
rotate: (modifier, { theme }) => {
|
||||
let value = asAngle(modifier, theme.rotate)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
scale: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.scale)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asAngle, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'skew-x': (modifier, { theme }) => {
|
||||
let value = asAngle(modifier, theme.skew)
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.stroke)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('stroke'))
|
||||
|
||||
matchUtilities({
|
||||
stroke: (modifier, { theme }) => {
|
||||
stroke: (modifier) => {
|
||||
let value = asColor(modifier, colorPalette)
|
||||
|
||||
if (value === undefined) {
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
||||
const withAlphaVariable = require('../../lib/util/withAlphaVariable').default
|
||||
const toColorValue = require('../../lib/util/toColorValue').default
|
||||
const { asColor, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let colorPalette = flattenColorPalette(theme.textColor)
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let colorPalette = flattenColorPalette(theme('textColor'))
|
||||
|
||||
matchUtilities({
|
||||
text: (modifier, { theme }) => {
|
||||
text: (modifier) => {
|
||||
let value = asColor(modifier, colorPalette)
|
||||
|
||||
if (value === undefined) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'text-opacity': (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.textOpacity)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
origin: (modifier, { theme }) => {
|
||||
let value = theme.transformOrigin[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
delay: (modifier, { theme }) => {
|
||||
let value = theme.transitionDelay[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass, asValue } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
duration: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.transitionDuration)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
let defaultTimingFunction = theme.transitionTimingFunction.DEFAULT
|
||||
let defaultDuration = theme.transitionDuration.DEFAULT
|
||||
module.exports = function ({ matchUtilities, theme }) {
|
||||
let defaultTimingFunction = theme('transitionTimingFunction.DEFAULT')
|
||||
let defaultDuration = theme('transitionDuration.DEFAULT')
|
||||
|
||||
matchUtilities({
|
||||
transition: (modifier, { theme }) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
ease: (modifier, { theme }) => {
|
||||
let value = theme.transitionTimingFunction[modifier]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asLength, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
'translate-x': (modifier, { theme }) => {
|
||||
let value = asLength(modifier, theme['translate'])
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const { asValue, nameClass } = require('../pluginUtils')
|
||||
|
||||
module.exports = function ({ matchUtilities, jit: { theme } }) {
|
||||
module.exports = function ({ matchUtilities }) {
|
||||
matchUtilities({
|
||||
z: (modifier, { theme }) => {
|
||||
let value = asValue(modifier, theme.zIndex)
|
||||
|
||||
48
jit/index.js
48
jit/index.js
@ -1,5 +1,4 @@
|
||||
const postcss = require('postcss')
|
||||
const dlv = require('dlv')
|
||||
|
||||
const evaluateTailwindFunctions = require('../lib/lib/evaluateTailwindFunctions').default
|
||||
const substituteScreenAtRules = require('../lib/lib/substituteScreenAtRules').default
|
||||
@ -57,53 +56,6 @@ module.exports = (configOrPath = {}) => {
|
||||
return root
|
||||
},
|
||||
].filter(Boolean)
|
||||
|
||||
return {
|
||||
postcssPlugin: 'tailwindcss-jit',
|
||||
plugins: [
|
||||
env.DEBUG &&
|
||||
function (root) {
|
||||
console.log('\n')
|
||||
console.time('JIT TOTAL')
|
||||
return root
|
||||
},
|
||||
function (root, result) {
|
||||
function registerDependency(fileName, type = 'dependency') {
|
||||
result.messages.push({
|
||||
type,
|
||||
plugin: 'tailwindcss-jit',
|
||||
parent: result.opts.from,
|
||||
file: fileName,
|
||||
})
|
||||
}
|
||||
|
||||
rewriteTailwindImports(root)
|
||||
|
||||
let context = setupContext(configOrPath)(result, root)
|
||||
|
||||
if (!env.TAILWIND_DISABLE_TOUCH) {
|
||||
if (context.configPath !== null) {
|
||||
registerDependency(context.configPath)
|
||||
}
|
||||
}
|
||||
|
||||
return postcss([
|
||||
removeLayerAtRules(context),
|
||||
expandTailwindAtRules(context, registerDependency),
|
||||
expandApplyAtRules(context),
|
||||
evaluateTailwindFunctions(context.tailwindConfig),
|
||||
substituteScreenAtRules(context.tailwindConfig),
|
||||
collapseAdjacentRules(context),
|
||||
]).process(root, { from: undefined })
|
||||
},
|
||||
env.DEBUG &&
|
||||
function (root) {
|
||||
console.timeEnd('JIT TOTAL')
|
||||
console.log('\n')
|
||||
return root
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.postcss = true
|
||||
|
||||
@ -4,7 +4,7 @@ let comparisonMap = {
|
||||
}
|
||||
let types = new Set(Object.keys(comparisonMap))
|
||||
|
||||
function collapseAdjacentRules(context) {
|
||||
function collapseAdjacentRules() {
|
||||
return (root) => {
|
||||
let currentRule = null
|
||||
root.each((node) => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const postcss = require('postcss')
|
||||
const parseObjectStyles = require('../../lib/util/parseObjectStyles').default
|
||||
const { isPlainObject, bigSign } = require('./utils')
|
||||
const { isPlainObject } = require('./utils')
|
||||
const selectorParser = require('postcss-selector-parser')
|
||||
const prefixSelector = require('../../lib/util/prefixSelector').default
|
||||
const { updateAllClasses } = require('../pluginUtils')
|
||||
@ -191,12 +191,6 @@ function* resolveMatchedPlugins(classCandidate, context) {
|
||||
}
|
||||
}
|
||||
|
||||
function sortAgainst(toSort, against) {
|
||||
return toSort.slice().sort((a, z) => {
|
||||
return bigSign(against.get(a)[0] - against.get(z)[0])
|
||||
})
|
||||
}
|
||||
|
||||
function* resolveMatches(candidate, context) {
|
||||
let separator = context.tailwindConfig.separator
|
||||
let [classCandidate, ...variants] = candidate.split(separator).reverse()
|
||||
@ -207,10 +201,12 @@ function* resolveMatches(candidate, context) {
|
||||
classCandidate = classCandidate.slice(1)
|
||||
}
|
||||
|
||||
// Strip prefix
|
||||
// md:hover:tw-bg-black
|
||||
|
||||
// TODO: Reintroduce this in ways that doesn't break on false positives
|
||||
// function sortAgainst(toSort, against) {
|
||||
// return toSort.slice().sort((a, z) => {
|
||||
// return bigSign(against.get(a)[0] - against.get(z)[0])
|
||||
// })
|
||||
// }
|
||||
// let sorted = sortAgainst(variants, context.variantMap)
|
||||
// if (sorted.toString() !== variants.toString()) {
|
||||
// let corrected = sorted.reverse().concat(classCandidate).join(':')
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
function removeLayerAtRules(context) {
|
||||
function removeLayerAtRules() {
|
||||
return (root) => {
|
||||
root.walkAtRules((rule) => {
|
||||
if (['layer', 'responsive', 'variants'].includes(rule.name)) {
|
||||
|
||||
@ -21,7 +21,6 @@ const resolveConfig = require('../../resolveConfig')
|
||||
const sharedState = require('./sharedState')
|
||||
const corePlugins = require('../corePlugins')
|
||||
const { isPlainObject, escapeClassName } = require('./utils')
|
||||
const { isBuffer } = require('util')
|
||||
|
||||
let contextMap = sharedState.contextMap
|
||||
let configContextMap = sharedState.configContextMap
|
||||
@ -676,7 +675,7 @@ function setupContext(configOrPath) {
|
||||
return (result, root) => {
|
||||
let foundTailwind = false
|
||||
|
||||
root.walkAtRules('tailwind', (rule) => {
|
||||
root.walkAtRules('tailwind', () => {
|
||||
foundTailwind = true
|
||||
})
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ function transformAllSelectors(transformSelector, wrap = null) {
|
||||
}
|
||||
}
|
||||
|
||||
function transformAllClasses(transformClass, wrap = null) {
|
||||
function transformAllClasses(transformClass) {
|
||||
return ({ container }) => {
|
||||
container.walkRules((rule) => {
|
||||
let selector = rule.selector
|
||||
|
||||
@ -15,7 +15,7 @@ test('modify selectors', () => {
|
||||
corePlugins: { preflight: false },
|
||||
theme: {},
|
||||
plugins: [
|
||||
function ({ addVariant, e }) {
|
||||
function ({ addVariant }) {
|
||||
addVariant('foo', ({ modifySelectors, separator }) => {
|
||||
modifySelectors(({ selector }) => {
|
||||
return selectorParser((selectors) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user