Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Apr 2, 2021
1 parent b242fb7 commit d541742
Show file tree
Hide file tree
Showing 59 changed files with 84 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"jest": true
},
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": ["prettier"],
Expand Down
4 changes: 2 additions & 2 deletions jit/corePlugins/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
[
Expand Down
4 changes: 2 additions & 2 deletions jit/corePlugins/backgroundColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/backgroundImage.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/backgroundOpacity.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/backgroundPosition.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/backgroundSize.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions jit/corePlugins/borderColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/borderOpacity.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/borderRadius.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/borderWidth.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/cursor.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions jit/corePlugins/divideColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/divideOpacity.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/divideWidth.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
7 changes: 3 additions & 4 deletions jit/corePlugins/fill.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/flexGrow.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/flexShrink.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/fontSize.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gap.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridAutoColumns.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridAutoRows.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridRowEnd.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridRowStart.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridTemplateColumns.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/gridTemplateRows.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 4 additions & 4 deletions jit/corePlugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = {
)
}
},
directionVariants: function ({ config, theme, addVariant }) {
directionVariants: function ({ config, addVariant }) {
addVariant(
'ltr',
transformAllSelectors(
Expand All @@ -85,7 +85,7 @@ module.exports = {
)
)
},
reducedMotionVariants: function ({ config, theme, addVariant }) {
reducedMotionVariants: function ({ config, addVariant }) {
addVariant(
'motion-safe',
transformLastClasses(
Expand All @@ -106,7 +106,7 @@ module.exports = {
)
)
},
darkVariants: function ({ config, theme, addVariant }) {
darkVariants: function ({ config, addVariant }) {
if (config('darkMode') === 'class') {
addVariant(
'dark',
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/letterSpacing.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/lineHeight.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/opacity.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/order.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/outline.js
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/padding.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
7 changes: 3 additions & 4 deletions jit/corePlugins/placeholderColor.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/placeholderOpacity.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 3 additions & 4 deletions jit/corePlugins/ringColor.js
Original file line number Diff line number Diff line change
@@ -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 []
}
Expand Down
7 changes: 3 additions & 4 deletions jit/corePlugins/ringOffsetColor.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/ringOffsetWidth.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/ringOpacity.js
Original file line number Diff line number Diff line change
@@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion jit/corePlugins/rotate.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading

0 comments on commit d541742

Please sign in to comment.