Skip to content

Commit

Permalink
fix: link design alignment (#1972)
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-ico authored Jun 9, 2023
1 parent dcf1f94 commit 24c1d7d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
22 changes: 16 additions & 6 deletions packages/components/src/components/link/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
--color-line-hover: currentColor;
--line-thickness-hover: var(--telekom-line-weight-highlight);
/* focus */
--color-focus-outline: var(--telekom-color-functional-focus-standard);
--color-focus: var(--telekom-color-text-and-icon-link-standard);
--color-line-focus: transparent;
--line-thickness-focus: 0;
Expand Down Expand Up @@ -100,13 +101,20 @@ slot[name='icon']::slotted(*) {
--line-color: transparent;
}

:host(.no-underline) [part='anchor'] {
text-decoration: none;
}

[part='anchor']:hover,
[part='anchor']:focus,
[part='anchor']:active {
[part='anchor']:active,
:host(.no-underline) [part='anchor']:hover,
:host(.no-underline) [part='anchor']:active {
text-decoration: underline;
}

[part='anchor']:hover {
[part='anchor']:hover,
:host(.no-underline) [part='anchor']:hover {
color: var(--color-hover);
text-decoration-color: var(--color-line-hover);
text-decoration-thickness: var(
Expand All @@ -115,19 +123,21 @@ slot[name='icon']::slotted(*) {
);
}

[part='anchor']:focus {
[part='anchor']:focus,
[part='anchor']:focus-visible {
color: var(--color-focus);
text-decoration-color: var(--color-line-focus);
text-decoration-thickness: var(
--line-thickness-focus,
var(--line-thickness-initial)
);
outline: var(--telekom-line-weight-highlight) solid currentColor;
outline: var(--telekom-line-weight-highlight) solid var(--color-focus-outline);
outline-offset: var(--telekom-spacing-unit-x025);
border-radius: var(--telekom-radius-small);
}

[part='anchor']:active {
[part='anchor']:active,
:host(.no-underline) [part='anchor']:active {
color: var(--color-active);
text-decoration-color: var(--color-line-active);
text-decoration-thickness: var(
Expand Down Expand Up @@ -156,7 +166,7 @@ slot[name='icon']::slotted(*) {
:host(.disabled) [part='anchor']:hover,
:host(.disabled) [part='anchor']:active {
color: var(--color-disabled);
text-decoration-color: var(--color-line-disabled);
text-decoration: none;
cursor: not-allowed;
pointer-events: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ For Shadow Parts, please inspect the element's #shadow.
args={{
label: 'A link, without an underline',
omitUnderline: true,
innerTabindex: 0
}}
>
{Template.bind({})}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 24c1d7d

Please sign in to comment.