Skip to content

Commit

Permalink
fix(label): text color for anchor variant (#1653)
Browse files Browse the repository at this point in the history
## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?
When using `anchor` HTML element as `label` text color follow default anchor color.
 
Issue Number: CDE-2516

## What is the new behavior?
When using `anchor` HTML element as `label` text color follow label color.

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

## Other information

---------

Co-authored-by: GitHub <noreply@github.com>
  • Loading branch information
valentin-mladenov and web-flow authored Dec 20, 2024
1 parent 946a816 commit 38862d4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .storybook/stories/label/label.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const LabelAllTemplate: StoryFn = args => ({
<span class="text">{{ content }}</span>
</span>
</div>
<h6>Clickable Anchor Labels</h6>
<div style="margin-top: 5px">
<a href="javascript://" class="label clickable" *ngFor="let type of LABEL_COLOR_TYPES" [class]="type">
<span class="text">{{ content }}</span>
</a>
</div>
<h6>Status Labels</h6>
<div style="margin-top: 5px">
Expand Down
6 changes: 3 additions & 3 deletions projects/angular/src/layout/nav/_links.clarity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
@include mixins.exports('links.clarity') {
a {
/*
* Due to the higher specificity of `a:link` over `.btn`, `.nav-link`, `.dropdown-item`, `.alert-action` and `badge`
* Due to the higher specificity of `a:link` over `.btn`, `.nav-link`, `.dropdown-item`, `.label`, `.alert-action` and `badge`
* it overrides the styles of both which is not required.
* Also `.btn, .nav-link, .dropdown-item, .alert-action, .badge` doesn't need these styles, so we don't add them in these cases.
* Also `.btn, .nav-link, .dropdown-item, .label, .alert-action, .badge` doesn't need these styles, so we don't add them in these cases.
*/
&:not(.btn, .nav-link, .dropdown-item, .alert-action, .badge, .clr-treenode-link) {
&:not(.btn, .nav-link, .dropdown-item, .label, .alert-action, .badge, .clr-treenode-link) {
@include mixins.generate-typography-token('LINK-13');
&:link {
color: nav-variables.$clr-link-color;
Expand Down
Binary file modified tests/snapshots/chromium/label/label--showcase-core-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/chromium/label/label--showcase-core-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/firefox/label/label--showcase-core-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/firefox/label/label--showcase-core-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38862d4

Please sign in to comment.