Skip to content

Commit bb9a1ec

Browse files
authored
Euilink supports text color (#1571)
1 parent 895a07c commit bb9a1ec

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## [`master`](https://github.com/elastic/eui/tree/master)
22

3+
- Added `text` as a color option for `EuiLink` ([#1571](https://github.com/elastic/eui/pull/1571))
34
- Added `EuiResizeObserver` to expose ResizeObserver API to React components; falls back to MutationObserver API in unsupported browsers ([#1559](https://github.com/elastic/eui/pull/1559))
45

56
**Bug fixes**

src-docs/src/views/link/link.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export default () => (
6767
warning
6868
</EuiLink>
6969
</li>
70+
<li>
71+
<EuiLink color="text" href="#">
72+
text
73+
</EuiLink>
74+
</li>
7075
<li>
7176
<span style={{ background: 'black' }}>
7277
<EuiLink color="ghost" href="#">

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ exports[`EuiLink supports target 1`] = `
106106
/>
107107
`;
108108

109+
exports[`EuiLink text is rendered 1`] = `
110+
<button
111+
class="euiLink euiLink--text"
112+
type="button"
113+
/>
114+
`;
115+
109116
exports[`EuiLink warning is rendered 1`] = `
110117
<button
111118
class="euiLink euiLink--warning"

src/components/link/_link.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ $textColors: (
99
accent: $euiColorAccent,
1010
warning: $euiColorWarning,
1111
danger: $euiColorDanger,
12-
ghost: #FFF, // Ghost is special and a constant.
12+
text: $euiTextColor,
13+
ghost: $euiColorGhost,
1314
);
1415

1516
// Create color modifiers based on the map

src/components/link/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ declare module '@elastic/eui' {
2222
| 'accent'
2323
| 'danger'
2424
| 'warning'
25+
| 'text'
2526
| 'ghost';
2627

2728
export interface LinkButtonProps {

src/components/link/link.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const colorsToClassNameMap = {
1212
'danger': 'euiLink--danger',
1313
'warning': 'euiLink--warning',
1414
'ghost': 'euiLink--ghost',
15+
'text': 'euiLink--text',
1516
};
1617

1718
export const COLORS = Object.keys(colorsToClassNameMap);

0 commit comments

Comments
 (0)