Fix formatting issues

This commit is contained in:
Adam Wathan 2021-05-20 13:43:17 -04:00
parent 2fec61e753
commit 5fa665835f
4 changed files with 18 additions and 23 deletions

View File

@ -690,12 +690,8 @@ function cleanupContext(context) {
export default function setupContext(configOrPath, tailwindDirectives) {
return (result, root) => {
let sourcePath = result.opts.from
let [
tailwindConfig,
userConfigPath,
tailwindConfigHash,
configDependencies,
] = getTailwindConfig(configOrPath)
let [tailwindConfig, userConfigPath, tailwindConfigHash, configDependencies] =
getTailwindConfig(configOrPath)
let isConfigFile = userConfigPath !== null
let contextDependencies = new Set(

View File

@ -281,11 +281,8 @@ function processApplyAtRules(css, lookupTree, config) {
const nearestParentRule = findParent(applyRule, (r) => r.type === 'rule')
const currentUtilityNames = extractUtilityNames(nearestParentRule.selector)
const [
importantEntries,
applyUtilityNames,
important = importantEntries.length > 0,
] = _.partition(applyRule.params.split(/[\s\t\n]+/g), (n) => n === '!important')
const [importantEntries, applyUtilityNames, important = importantEntries.length > 0] =
_.partition(applyRule.params.split(/[\s\t\n]+/g), (n) => n === '!important')
if (_.intersection(applyUtilityNames, currentUtilityNames).length > 0) {
const currentUtilityName = _.intersection(applyUtilityNames, currentUtilityNames)[0]

View File

@ -2,15 +2,16 @@ 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)',
},
'.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',
},

View File

@ -1768,9 +1768,10 @@ test('plugins with extra options can be created using the `createPlugin.withOpti
test('plugins should cache correctly', () => {
const plugin = createPlugin.withOptions(
({ className = 'banana' } = {}) => ({ addComponents, variants }) => {
addComponents({ [`.${className}`]: { position: 'absolute' } }, variants('testPlugin'))
},
({ className = 'banana' } = {}) =>
({ addComponents, variants }) => {
addComponents({ [`.${className}`]: { position: 'absolute' } }, variants('testPlugin'))
},
() => ({ variants: { testPlugin: ['responsive'] } })
)