Skip to content

Commit 8cf3be1

Browse files
fix(ClickableTile): ensure links are correct color when link has been visited (#8159)
* fix(ClickableTile): don't use Link component * style(Tile): update visited styles for clickable links * docs(Tile): add a link to normal tile for verification Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 44b2f49 commit 8cf3be1

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

packages/components/src/components/tile/_tile.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
}
7777

7878
.#{$prefix}--tile--clickable:hover,
79-
.#{$prefix}--tile--clickable:active {
79+
.#{$prefix}--tile--clickable:active,
80+
.#{$prefix}--tile--clickable:visited,
81+
.#{$prefix}--tile--clickable:visited:hover {
8082
color: $text-01;
8183
text-decoration: none;
8284
}

packages/react/src/components/Tile/Tile-story.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
} from '../Tile';
2626
import TileGroup from '../TileGroup';
2727
import RadioTile from '../RadioTile';
28+
import Link from '../Link';
2829
import mdx from './Tile.mdx';
2930

3031
const radioValues = {
@@ -40,7 +41,10 @@ const props = {
4041
}),
4142
clickable: () => ({
4243
disabled: boolean('disabled (disabled)', false),
43-
href: text('Href for clickable UI (href)', 'javascript:void(0)'),
44+
href: text(
45+
'Href for clickable UI (href)',
46+
'https://www.carbondesignsystem.com/'
47+
),
4448
light: boolean('Light variant (light)', false),
4549
}),
4650
selectable: () => ({
@@ -106,7 +110,14 @@ export default {
106110

107111
export const Default = () => {
108112
const regularProps = props.regular();
109-
return <Tile {...regularProps}>Default tile</Tile>;
113+
return (
114+
<Tile {...regularProps}>
115+
Default tile
116+
<br />
117+
<br />
118+
<Link href="https://www.carbondesignsystem.com">Link</Link>
119+
</Tile>
120+
);
110121
};
111122

112123
Default.parameters = {

0 commit comments

Comments
 (0)