Skip to content

Commit

Permalink
Euilink supports text color (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
snide authored Feb 15, 2019
1 parent 895a07c commit bb9a1ec
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `text` as a color option for `EuiLink` ([#1571](https://github.com/elastic/eui/pull/1571))
- 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))

**Bug fixes**
Expand Down
5 changes: 5 additions & 0 deletions src-docs/src/views/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export default () => (
warning
</EuiLink>
</li>
<li>
<EuiLink color="text" href="#">
text
</EuiLink>
</li>
<li>
<span style={{ background: 'black' }}>
<EuiLink color="ghost" href="#">
Expand Down
7 changes: 7 additions & 0 deletions src/components/link/__snapshots__/link.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ exports[`EuiLink supports target 1`] = `
/>
`;

exports[`EuiLink text is rendered 1`] = `
<button
class="euiLink euiLink--text"
type="button"
/>
`;

exports[`EuiLink warning is rendered 1`] = `
<button
class="euiLink euiLink--warning"
Expand Down
3 changes: 2 additions & 1 deletion src/components/link/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ $textColors: (
accent: $euiColorAccent,
warning: $euiColorWarning,
danger: $euiColorDanger,
ghost: #FFF, // Ghost is special and a constant.
text: $euiTextColor,
ghost: $euiColorGhost,
);

// Create color modifiers based on the map
Expand Down
1 change: 1 addition & 0 deletions src/components/link/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare module '@elastic/eui' {
| 'accent'
| 'danger'
| 'warning'
| 'text'
| 'ghost';

export interface LinkButtonProps {
Expand Down
1 change: 1 addition & 0 deletions src/components/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const colorsToClassNameMap = {
'danger': 'euiLink--danger',
'warning': 'euiLink--warning',
'ghost': 'euiLink--ghost',
'text': 'euiLink--text',
};

export const COLORS = Object.keys(colorsToClassNameMap);
Expand Down

0 comments on commit bb9a1ec

Please sign in to comment.