Skip to content

Commit e5c08f6

Browse files
committed
Revert default syntax support for zIndex and letterSpacing, update tests
1 parent a249bc4 commit e5c08f6

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

__tests__/plugins/letterSpacing.test.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ import _ from 'lodash'
22
import escapeClassName from '../../src/util/escapeClassName'
33
import plugin from '../../src/plugins/letterSpacing'
44

5-
test('letter spacing can use default keyword and negative prefix syntax', () => {
5+
test('letter spacing can use negative prefix syntax', () => {
66
const addedUtilities = []
77

88
const config = {
99
theme: {
1010
letterSpacing: {
11-
'-1': '-0.05em',
12-
'-': '-0.025em',
13-
default: '0.025em',
14-
'1': '0.05em',
11+
'-1': '-0.025em',
12+
'1': '0.025em',
1513
},
1614
},
1715
variants: {
@@ -44,10 +42,8 @@ test('letter spacing can use default keyword and negative prefix syntax', () =>
4442
expect(addedUtilities).toEqual([
4543
{
4644
utilities: {
47-
'.-tracking-1': { 'letter-spacing': '-0.05em' },
48-
'.-tracking': { 'letter-spacing': '-0.025em' },
49-
'.tracking': { 'letter-spacing': '0.025em' },
50-
'.tracking-1': { 'letter-spacing': '0.05em' },
45+
'.-tracking-1': { 'letter-spacing': '-0.025em' },
46+
'.tracking-1': { 'letter-spacing': '0.025em' },
5147
},
5248
variants: ['responsive'],
5349
},

__tests__/plugins/zIndex.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import _ from 'lodash'
22
import escapeClassName from '../../src/util/escapeClassName'
33
import plugin from '../../src/plugins/zIndex'
44

5-
test('z index can use default keyword and negative prefix syntax', () => {
5+
test('z index can use negative prefix syntax', () => {
66
const addedUtilities = []
77

88
const config = {
99
theme: {
1010
zIndex: {
1111
'-20': '-20',
12-
'-': '-10',
13-
default: '10',
12+
'-10': '-10',
13+
'10': '10',
1414
'20': '20',
1515
},
1616
},
@@ -45,8 +45,8 @@ test('z index can use default keyword and negative prefix syntax', () => {
4545
{
4646
utilities: {
4747
'.-z-20': { 'z-index': '-20' },
48-
'.-z': { 'z-index': '-10' },
49-
'.z': { 'z-index': '10' },
48+
'.-z-10': { 'z-index': '-10' },
49+
'.z-10': { 'z-index': '10' },
5050
'.z-20': { 'z-index': '20' },
5151
},
5252
variants: ['responsive'],

src/plugins/letterSpacing.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ export default function() {
55
return function({ addUtilities, theme, variants, e }) {
66
const utilities = _.fromPairs(
77
_.map(theme('letterSpacing'), (value, modifier) => {
8-
const className =
9-
modifier === 'default'
10-
? 'tracking'
11-
: `${e(prefixNegativeModifiers('tracking', modifier))}`
128
return [
13-
`.${className}`,
9+
`.${e(prefixNegativeModifiers('tracking', modifier))}`,
1410
{
1511
'letter-spacing': value,
1612
},

src/plugins/zIndex.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ export default function() {
55
return function({ addUtilities, e, theme, variants }) {
66
const utilities = _.fromPairs(
77
_.map(theme('zIndex'), (value, modifier) => {
8-
const className =
9-
modifier === 'default' ? 'z' : `${e(prefixNegativeModifiers('z', modifier))}`
108
return [
11-
`.${className}`,
9+
`.${e(prefixNegativeModifiers('z', modifier))}`,
1210
{
1311
'z-index': value,
1412
},

0 commit comments

Comments
 (0)