Style fixes

This commit is contained in:
Adam Wathan 2018-03-02 14:52:03 -05:00
parent ac8099251f
commit 2feac441e7
2 changed files with 22 additions and 18 deletions

View File

@ -10,19 +10,18 @@ test('plugins can create utilities', () => {
const [components, utilities] = processPlugins({
plugins: [
function({ rule, addUtilities }) {
addUtilities(
[
rule('.object-fill', {
'object-fit': 'fill',
}),
rule('.object-contain', {
'object-fit': 'contain',
}),
rule('.object-cover', {
'object-fit': 'cover',
}),
addUtilities([
rule('.object-fill', {
'object-fit': 'fill',
}),
rule('.object-contain', {
'object-fit': 'contain',
}),
rule('.object-cover', {
'object-fit': 'cover',
}),
])
}
},
],
})
@ -57,8 +56,10 @@ test('plugins can create utilities with variants', () => {
rule('.object-cover', {
'object-fit': 'cover',
}),
], ['responsive', 'hover', 'group-hover', 'focus'])
}
],
['responsive', 'hover', 'group-hover', 'focus']
)
},
],
})
@ -93,7 +94,7 @@ test('plugins can create components', () => {
'background-color': 'darkblue',
}),
])
}
},
],
})
@ -135,7 +136,7 @@ test('plugins can create components with media queries', () => {
}),
]),
])
}
},
],
})
@ -418,7 +419,7 @@ test("plugins can apply the user's chosen prefix", () => {
`)
})
test("utilities are escaped and automatically respect prefix and important options when created via `utility`", () => {
test('utilities are escaped and automatically respect prefix and important options when created via `utility`', () => {
const [, utilities] = processPlugins({
plugins: [
function({ utility, addUtilities }) {

View File

@ -20,7 +20,10 @@ function defineUtility(selector, properties, options) {
return defineUtility(selector.slice(1), properties, options)
}
const rule = defineRule(prefixSelector(options.prefix, `.${escapeClassName(selector)}`), properties)
const rule = defineRule(
prefixSelector(options.prefix, `.${escapeClassName(selector)}`),
properties
)
if (options.important) {
rule.walkDecls(decl => (decl.important = true))