Skip to content

Commit 946448f

Browse files
authored
fix: Ensure links maintain green color within bold text (#7744)
* fix: ensure links maintain green color within bold text * fix(markdown): ensure links inside bold text retain correct green color - Remove color styling from `strong` so it only applies font weight, not color. - Restore color styling for headings only. - Remove unnecessary selectors and \!important overrides for link color. - This allows links within bold text to inherit the correct green color naturally, resolving the previous override issue. * test(storybook): add story for bold text and links to cover markdown edge cases - Adds a story to the text stories. - Demonstrates bold text, a link inside bold, and bold inside a link. - Ensures CSS changes are visually tested for all relevant markdown scenarios.
1 parent 479f73b commit 946448f

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

packages/ui-components/__design__/text.stories.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,24 @@ export const HeadingsWithLinks: StoryObj = {
7777
),
7878
};
7979

80+
export const BoldAndLinks: StoryObj = {
81+
render: () => (
82+
<main>
83+
<p>
84+
<strong>Bold text (should inherit normal text color)</strong>
85+
</p>
86+
<p>
87+
<strong>
88+
<a href="#">Bold green link (link inside bold)</a>
89+
</strong>
90+
</p>
91+
<p>
92+
<a href="#">
93+
<strong>Bold green link (bold inside link)</strong>
94+
</a>
95+
</p>
96+
</main>
97+
),
98+
};
99+
80100
export default { title: 'Design System' } as MetaObj;

packages/ui-components/styles/markdown.css

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,18 @@ main {
4040
h4,
4141
h5,
4242
h6 {
43+
@apply font-semibold
44+
text-neutral-900
45+
dark:text-white;
46+
4347
&[id] a {
4448
@apply text-neutral-900
4549
dark:text-white;
4650
}
4751
}
4852

49-
h1,
50-
h2,
51-
h3,
52-
h4,
53-
h5,
54-
h6,
5553
strong {
56-
@apply font-semibold
57-
text-neutral-900
58-
dark:text-white;
54+
@apply font-semibold;
5955
}
6056

6157
code {

0 commit comments

Comments
 (0)