Handle default keyword for negative prefix syntax. Write tests for negative prefix syntax

This commit is contained in:
AlexVipond 2019-06-28 10:11:47 -06:00
parent fd203a8906
commit a249bc4433
8 changed files with 204 additions and 9 deletions

View file

@ -5,9 +5,10 @@ export default function() {
return function({ addUtilities, e, theme, variants }) {
const utilities = _.fromPairs(
_.map(theme('boxShadow'), (value, modifier) => {
const className = modifier === 'default' ? 'shadow' : `shadow-${modifier}`
const className =
modifier === 'default' ? 'shadow' : `${e(prefixNegativeModifiers('shadow', modifier))}`
return [
`.${e(prefixNegativeModifiers('shadow', modifier))}`,
`.${className}`,
{
'box-shadow': value,
},

View file

@ -5,8 +5,12 @@ export default function() {
return function({ addUtilities, theme, variants, e }) {
const utilities = _.fromPairs(
_.map(theme('letterSpacing'), (value, modifier) => {
const className =
modifier === 'default'
? 'tracking'
: `${e(prefixNegativeModifiers('tracking', modifier))}`
return [
`.${e(prefixNegativeModifiers('tracking', modifier))}`,
`.${className}`,
{
'letter-spacing': value,
},

View file

@ -5,8 +5,10 @@ export default function() {
return function({ addUtilities, e, theme, variants }) {
const utilities = _.fromPairs(
_.map(theme('zIndex'), (value, modifier) => {
const className =
modifier === 'default' ? 'z' : `${e(prefixNegativeModifiers('z', modifier))}`
return [
`.${e(prefixNegativeModifiers('z', modifier))}`,
`.${className}`,
{
'z-index': value,
},