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
4c25ca5ed6
commit
33e5546e9b
@ -7,7 +7,7 @@ test('plugins can add new theme values', () => {
|
||||
corePlugins: [],
|
||||
plugins: [
|
||||
{
|
||||
modifyConfig: function(config) {
|
||||
modifyConfig(config) {
|
||||
return {
|
||||
...config,
|
||||
theme: {
|
||||
@ -17,26 +17,26 @@ test('plugins can add new theme values', () => {
|
||||
'90': '90deg',
|
||||
'180': '180deg',
|
||||
'270': '270deg',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
handler: function({ addUtilities, theme }) {
|
||||
addUtilities(Object.entries(theme('rotate')).map(([key, value]) => {
|
||||
return {
|
||||
[`.rotate-${key}`]: {
|
||||
transform: `rotate(${value})`,
|
||||
},
|
||||
}
|
||||
}))
|
||||
handler({ addUtilities, theme }) {
|
||||
addUtilities(
|
||||
Object.entries(theme('rotate')).map(([key, value]) => {
|
||||
return {
|
||||
[`.rotate-${key}`]: {
|
||||
transform: `rotate(${value})`,
|
||||
},
|
||||
}
|
||||
})
|
||||
)
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
}),
|
||||
])
|
||||
.process('@tailwind utilities;',
|
||||
{ from: undefined }
|
||||
)
|
||||
.process('@tailwind utilities;', { from: undefined })
|
||||
.then(result => {
|
||||
const expected = `
|
||||
.rotate-0 {
|
||||
|
||||
@ -1211,7 +1211,7 @@ test('plugins can be provided as an object with a handler function', () => {
|
||||
const { components, utilities } = processPlugins(
|
||||
[
|
||||
{
|
||||
handler: function({ addUtilities }) {
|
||||
handler({ addUtilities }) {
|
||||
addUtilities({
|
||||
'.object-fill': {
|
||||
'object-fit': 'fill',
|
||||
@ -1224,7 +1224,7 @@ test('plugins can be provided as an object with a handler function', () => {
|
||||
},
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
makeConfig()
|
||||
)
|
||||
|
||||
@ -1363,15 +1363,15 @@ test('plugin config modifications are applied', () => {
|
||||
const userConfig = {
|
||||
plugins: [
|
||||
{
|
||||
modifyConfig: function (config) {
|
||||
modifyConfig(config) {
|
||||
return {
|
||||
...config,
|
||||
prefix: 'tw-'
|
||||
prefix: 'tw-',
|
||||
}
|
||||
},
|
||||
handler: function () {}
|
||||
}
|
||||
]
|
||||
handler() {},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const defaultConfig = {
|
||||
@ -1391,7 +1391,7 @@ test('plugin config modifications are applied', () => {
|
||||
}
|
||||
|
||||
const result = resolveConfig([userConfig, defaultConfig])
|
||||
|
||||
|
||||
expect(result).toEqual({
|
||||
prefix: 'tw-',
|
||||
important: false,
|
||||
@ -1415,15 +1415,15 @@ test('user config takes precedence over plugin config modifications', () => {
|
||||
prefix: 'user-',
|
||||
plugins: [
|
||||
{
|
||||
modifyConfig: function (config) {
|
||||
modifyConfig(config) {
|
||||
return {
|
||||
...config,
|
||||
prefix: 'plugin-'
|
||||
prefix: 'plugin-',
|
||||
}
|
||||
},
|
||||
handler: function () {}
|
||||
}
|
||||
]
|
||||
handler() {},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const defaultConfig = {
|
||||
@ -1443,7 +1443,7 @@ test('user config takes precedence over plugin config modifications', () => {
|
||||
}
|
||||
|
||||
const result = resolveConfig([userConfig, defaultConfig])
|
||||
|
||||
|
||||
expect(result).toEqual({
|
||||
prefix: 'user-',
|
||||
important: false,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
theme: {
|
||||
screens: {
|
||||
mobile: '400px',
|
||||
},
|
||||
},
|
||||
}
|
||||
theme: {
|
||||
screens: {
|
||||
mobile: '400px',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -103,7 +103,10 @@ function resolveFunctionKeys(object) {
|
||||
}
|
||||
|
||||
export default function resolveConfig([userConfig, defaultConfig]) {
|
||||
const modifiedDefaultConfig = applyPluginConfigModifications(defaultConfig, get(userConfig, 'plugins', []))
|
||||
const modifiedDefaultConfig = applyPluginConfigModifications(
|
||||
defaultConfig,
|
||||
get(userConfig, 'plugins', [])
|
||||
)
|
||||
const configs = [userConfig, modifiedDefaultConfig]
|
||||
|
||||
return defaults(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user