Fix style

This commit is contained in:
Adam Wathan 2021-04-02 14:12:47 -04:00
parent f97456483c
commit 7afeeb7084
59 changed files with 84 additions and 143 deletions

View file

@ -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,
[

View file

@ -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) => {

View file

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

View file

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

View file

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

View file

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

View file

@ -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) => {

View file

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

View file

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

View file

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

View file

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

View file

@ -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({

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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 []
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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