Skip to content

Commit 75fc8c1

Browse files
committed
fixed repeated name labels (should be line n not line-n)
1 parent 0a28f0c commit 75fc8c1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = function ({ addUtilities, target, theme }) {
3737
...lines,
3838
..._.fromPairs(
3939
_.map(prefix.lines, (name) => [
40-
`.${prefix.utility}-${name}`,
40+
`.${prefix.utility}-${name.replace(' ', '-')}`,
4141
{
4242
[prefix.class]: name,
4343
},

src/util/extractGridLineNames.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = function (gridTemplate) {
3535
return match
3636
}
3737

38-
return `${match}-${counts[match].count++}`
38+
return `${match} ${counts[match].count++}`
3939
})
4040
})
4141
)

test/plugin.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ test('multiple templates with different names', () => {
9999
'grid-row-start': 'bottom',
100100
},
101101
'.row-start-fold-1': {
102-
'grid-row-start': 'fold-1',
102+
'grid-row-start': 'fold 1',
103103
},
104104
'.row-start-fold-2': {
105-
'grid-row-start': 'fold-2',
105+
'grid-row-start': 'fold 2',
106106
},
107107
'.row-end-top': {
108108
'grid-row-end': 'top',
@@ -111,10 +111,10 @@ test('multiple templates with different names', () => {
111111
'grid-row-end': 'bottom',
112112
},
113113
'.row-end-fold-1': {
114-
'grid-row-end': 'fold-1',
114+
'grid-row-end': 'fold 1',
115115
},
116116
'.row-end-fold-2': {
117-
'grid-row-end': 'fold-2',
117+
'grid-row-end': 'fold 2',
118118
},
119119
'.col-start-left': {
120120
'grid-column-start': 'left',

test/util/extractGridLineNames.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('grid lines with the same name are indexed', () => {
2525
layout: '1fr [column] 1fr [column] 1fr',
2626
}
2727

28-
expect(extractGridLineNames(gridTemplateRows)).toEqual(['column-1', 'column-2'])
28+
expect(extractGridLineNames(gridTemplateRows)).toEqual(['column 1', 'column 2'])
2929
})
3030

3131
test('multiple names on the same grid line are valid', () => {
@@ -51,5 +51,5 @@ test('multiple gridTemplates can use the same grid line names', () => {
5151
multi: '1fr [column] 1fr [column] 1fr',
5252
}
5353

54-
expect(extractGridLineNames(gridTemplateRows)).toEqual(['left', 'right', 'column-1', 'column-2'])
54+
expect(extractGridLineNames(gridTemplateRows)).toEqual(['left', 'right', 'column 1', 'column 2'])
5555
})

0 commit comments

Comments
 (0)