mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Revert default syntax support for zIndex and letterSpacing, update tests
This commit is contained in:
parent
a249bc4433
commit
e5c08f6af2
@ -2,16 +2,14 @@ import _ from 'lodash'
|
||||
import escapeClassName from '../../src/util/escapeClassName'
|
||||
import plugin from '../../src/plugins/letterSpacing'
|
||||
|
||||
test('letter spacing can use default keyword and negative prefix syntax', () => {
|
||||
test('letter spacing can use negative prefix syntax', () => {
|
||||
const addedUtilities = []
|
||||
|
||||
const config = {
|
||||
theme: {
|
||||
letterSpacing: {
|
||||
'-1': '-0.05em',
|
||||
'-': '-0.025em',
|
||||
default: '0.025em',
|
||||
'1': '0.05em',
|
||||
'-1': '-0.025em',
|
||||
'1': '0.025em',
|
||||
},
|
||||
},
|
||||
variants: {
|
||||
@ -44,10 +42,8 @@ test('letter spacing can use default keyword and negative prefix syntax', () =>
|
||||
expect(addedUtilities).toEqual([
|
||||
{
|
||||
utilities: {
|
||||
'.-tracking-1': { 'letter-spacing': '-0.05em' },
|
||||
'.-tracking': { 'letter-spacing': '-0.025em' },
|
||||
'.tracking': { 'letter-spacing': '0.025em' },
|
||||
'.tracking-1': { 'letter-spacing': '0.05em' },
|
||||
'.-tracking-1': { 'letter-spacing': '-0.025em' },
|
||||
'.tracking-1': { 'letter-spacing': '0.025em' },
|
||||
},
|
||||
variants: ['responsive'],
|
||||
},
|
||||
|
||||
@ -2,15 +2,15 @@ import _ from 'lodash'
|
||||
import escapeClassName from '../../src/util/escapeClassName'
|
||||
import plugin from '../../src/plugins/zIndex'
|
||||
|
||||
test('z index can use default keyword and negative prefix syntax', () => {
|
||||
test('z index can use negative prefix syntax', () => {
|
||||
const addedUtilities = []
|
||||
|
||||
const config = {
|
||||
theme: {
|
||||
zIndex: {
|
||||
'-20': '-20',
|
||||
'-': '-10',
|
||||
default: '10',
|
||||
'-10': '-10',
|
||||
'10': '10',
|
||||
'20': '20',
|
||||
},
|
||||
},
|
||||
@ -45,8 +45,8 @@ test('z index can use default keyword and negative prefix syntax', () => {
|
||||
{
|
||||
utilities: {
|
||||
'.-z-20': { 'z-index': '-20' },
|
||||
'.-z': { 'z-index': '-10' },
|
||||
'.z': { 'z-index': '10' },
|
||||
'.-z-10': { 'z-index': '-10' },
|
||||
'.z-10': { 'z-index': '10' },
|
||||
'.z-20': { 'z-index': '20' },
|
||||
},
|
||||
variants: ['responsive'],
|
||||
|
||||
@ -5,12 +5,8 @@ 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 [
|
||||
`.${className}`,
|
||||
`.${e(prefixNegativeModifiers('tracking', modifier))}`,
|
||||
{
|
||||
'letter-spacing': value,
|
||||
},
|
||||
|
||||
@ -5,10 +5,8 @@ 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 [
|
||||
`.${className}`,
|
||||
`.${e(prefixNegativeModifiers('z', modifier))}`,
|
||||
{
|
||||
'z-index': value,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user