Skip to content

Commit 50d818b

Browse files
author
RJ Spiker
authored
change typography class names (#4)
1 parent f96635e commit 50d818b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

plugins/typography/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Here is some more stuff...
2020
```jsx
2121
<h1 className='g-type-display-2'>Uses</h1>
2222

23-
<p>Here are some uses...</p>
23+
<p className='g-type-long-body'>Here are some uses...</p>
2424

25-
<h2 className='g-type-section-1'>Another title</h2>
25+
<h2 className='g-type-display-3'>Another title</h2>
2626

27-
<p>Here is some more stuff...</p>
27+
<p className='g-type-long-body'>Here is some more stuff...</p>
2828
```

plugins/typography/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ module.exports = function typographyPlugin() {
1212
props.className = 'g-type-display-2'
1313
}
1414
if (node.depth === 2) {
15-
data.id = 'g-type-section-1'
16-
props.className = 'g-type-section-1'
15+
data.id = 'g-type-display-3'
16+
props.className = 'g-type-display-3'
1717
}
1818
if (node.depth === 3) {
19-
data.id = 'g-type-section-2'
20-
props.className = 'g-type-section-2'
19+
data.id = 'g-type-display-4'
20+
props.className = 'g-type-display-4'
2121
}
2222
if (node.depth === 4) {
23-
data.id = 'g-type-section-3'
24-
props.className = 'g-type-section-3'
23+
data.id = 'g-type-display-5'
24+
props.className = 'g-type-display-5'
2525
}
2626
if (node.depth === 5) {
27-
data.id = 'g-type-section-4'
28-
props.className = 'g-type-section-4'
27+
data.id = 'g-type-display-6'
28+
props.className = 'g-type-display-6'
2929
}
3030
if (node.depth === 6) {
3131
data.id = 'g-type-label'
@@ -38,8 +38,8 @@ module.exports = function typographyPlugin() {
3838
node.children.map(li => {
3939
const data = li.data || (li.data = {})
4040
const props = data.hProperties || (data.hProperties = {})
41-
data.id = 'g-type-body'
42-
props.className = 'g-type-body'
41+
data.id = 'g-type-long-body'
42+
props.className = 'g-type-long-body'
4343
})
4444
})
4545
}

plugins/typography/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('type-styles', () => {
2828
/<h6 {\.\.\.{\n\s+"className": "g-type-label"\n\s+}}>{`Heading Six`}<\/h6>/
2929
)
3030
expect(output).toMatch(
31-
/<li parentName="ul" {\.\.\.{\n\s+"className": "g-type-body"\n\s+}}>{`foo`}<\/li>/
31+
/<li parentName="ul" {\.\.\.{\n\s+"className": "g-type-long-body"\n\s+}}>{`foo`}<\/li>/
3232
)
3333
})
3434
})

0 commit comments

Comments
 (0)