Skip to content

Commit 5bc8623

Browse files
fix(ai-label): React & WC link colors (#21991)
* fix: link colors in ai-label * chore: add example links in stories
1 parent 0170bd6 commit 5bc8623

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

packages/react/src/components/AILabel/AILabel.stories.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { action } from 'storybook/actions';
1212
import { View, FolderOpen, Folders } from '@carbon/icons-react';
1313
import Button from '../Button';
1414
import { IconButton } from '../IconButton';
15+
import { Link } from '../Link';
1516
import mdx from './AILabel.mdx';
1617
import './ailabel-story.scss';
1718

@@ -136,6 +137,8 @@ export const Default = (args) => {
136137
<hr />
137138
<p className="secondary">Model type</p>
138139
<p className="bold">Foundation model</p>
140+
<a href="#">normal link</a>
141+
<Link href="#">cds link</Link>
139142
</div>
140143
);
141144

packages/styles/scss/components/slug/_slug.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@use '../../type' as *;
1414
@use '../../utilities/ai-gradient' as *;
1515
@use '../../utilities/convert';
16+
@use '../../utilities/custom-property';
1617
@use '../toggletip';
1718
@use '../popover';
1819

@@ -1061,6 +1062,13 @@ $sizes: (
10611062
// This sets the max size to the size of the action bar with 3 buttons
10621063
padding-block: convert.to-rem(24px) convert.to-rem(80px);
10631064
padding-inline: convert.to-rem(24px);
1065+
1066+
// Reset the custom properties of the link styles to initial for AI-label and slug. as the AI-label uses gradient backgrounds.
1067+
@include custom-property.declaration('button-focus-color', initial);
1068+
@include custom-property.declaration('link-text-color', initial);
1069+
@include custom-property.declaration('link-hover-text-color', initial);
1070+
@include custom-property.declaration('link-visited-text-color', initial);
1071+
@include custom-property.declaration('link-focus-text-color', initial);
10641072
}
10651073

10661074
.#{$prefix}--ai-label

packages/web-components/src/components/ai-label/ai-label.stories.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ const content = html`
6262
<hr />
6363
<p class="secondary">Model type</p>
6464
<p class="bold">Foundation model</p>
65+
<a href="#">normal link</a>
66+
<cds-link href="#">cds link</cds-link>
6567
</div>
6668
`;
6769

0 commit comments

Comments
 (0)