File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed
Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 2929 background-color : var (--reactist-badge-fill );
3030 line-height : calc (var (--reactist-badge-font-size ) + 3px );
3131 white-space : nowrap;
32+ text-decoration : none;
33+ }
34+
35+ .badge : hover {
36+ color : var (--reactist-badge-tint );
37+ text-decoration : none;
3238}
3339
3440.badge-info {
Original file line number Diff line number Diff line change 1414 cursor : pointer;
1515}
1616
17- .container : hover {
17+ .container > * {
18+ text-decoration : var (--reactist-text-link-idle-decoration );
19+ color : var (--reactist-text-link-idle-tint );
20+ }
21+
22+ /**
23+ * We need to target the child elements to ensure that styles are
24+ * applied to the text independently of the DOM elements hierarchy.
25+ */
26+ .container : hover ,
27+ .container : hover > * {
1828 text-decoration : var (--reactist-text-link-hover-decoration );
1929 color : var (--reactist-text-link-hover-tint );
2030}
Original file line number Diff line number Diff line change @@ -41,3 +41,36 @@ A component used to create text-based hyperlinks.
4141## Props
4242
4343<ArgsTable of = { TextLink } />
44+
45+ ## Nested elements
46+
47+ When using nested elements inside a ` TextLink ` , hover styles are properly applied to all children.
48+
49+ <Canvas >
50+ <Story
51+ name = " Nested elements"
52+ parameters = { {
53+ docs: { source: { type: ' code' } },
54+ chromatic: { disableSnapshot: false },
55+ }}
56+ >
57+ <Stack space = " medium" align = " start" >
58+ <TextLink href = " https://www.doist.com/" >
59+ <span >Link with nested span</span >
60+ </TextLink >
61+ <TextLink href = " https://www.doist.com/" >
62+ <div >Link with nested div</div >
63+ </TextLink >
64+ <TextLink href = " https://www.doist.com/" >
65+ Text with <strong >bold</strong > section
66+ </TextLink >
67+ <TextLink href = " https://www.doist.com/" >
68+ Text with{ ' ' }
69+ <a href = " https://www.doist.com" target = " _blank" >
70+ link
71+ </a >{ ' ' }
72+ section
73+ </TextLink >
74+ </Stack >
75+ </Story >
76+ </Canvas >
You can’t perform that action at this time.
0 commit comments