Skip to content

Commit ecd313b

Browse files
YamanquiKylie Stewart
authored andcommitted
Add custom style prop 'textDecoration' to Link (#869)
1 parent ae758aa commit ecd313b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Surface `textDecoration` prop from styled-system for `Link`s. [#869](https://github.com/FormidableLabs/spectacle/pull/869)
6+
37
## 6.0.1
48

59
- Fix broken doc links.

src/components/__snapshots__/typography.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ exports[`<Link /> should render an <a> with text 1`] = `
143143
"componentStyle": ComponentStyle {
144144
"componentId": "sc-htpNat",
145145
"isStatic": false,
146-
"lastClassName": "PfPpC",
146+
"lastClassName": "cRHPrL",
147147
"rules": Array [
148148
[Function],
149149
],
@@ -165,7 +165,7 @@ exports[`<Link /> should render an <a> with text 1`] = `
165165
textDecoration="underline"
166166
>
167167
<a
168-
className="sc-htpNat PfPpC"
168+
className="sc-htpNat cRHPrL"
169169
color="quaternary"
170170
fontFamily="text"
171171
fontSize="text"

src/components/typography.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import styled from 'styled-components';
2-
import { color, typography, space, compose } from 'styled-system';
2+
import { color, typography, space, compose, system } from 'styled-system';
3+
4+
const decoration = system({ textDecoration: true });
35

46
const Text = styled('div')(compose(color, typography, space));
57
Text.defaultProps = {
@@ -17,7 +19,7 @@ CodeSpan.defaultProps = {
1719
fontSize: 'text'
1820
};
1921

20-
const Link = styled('a')(compose(color, typography, space));
22+
const Link = styled('a')(compose(color, typography, space, decoration));
2123
Link.defaultProps = {
2224
...Text.defaultProps,
2325
textDecoration: 'underline',

0 commit comments

Comments
 (0)