mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Fix formatting issues
This commit is contained in:
parent
2fec61e753
commit
5fa665835f
@ -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(
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
@ -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'] } })
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user