Skip to content

Commit

Permalink
Make text links underlined by default #577
Browse files Browse the repository at this point in the history
Since the color inheritance for links has been introduced
in #492, links in e.g. validation messages cannot be
distinguished from regular text until hovered. We chose
to underline all text links by default to make those links
discoverable by users.
  • Loading branch information
adamkudrna committed Dec 6, 2024
1 parent 6e6b321 commit d3264dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/styles/elements/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

a {
text-decoration: links.$decoration;
text-underline-offset: links.$underline-offset;
color: links.$color;

&:hover {
Expand Down
1 change: 1 addition & 0 deletions src/styles/theme/_links.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$color: var(--rui-local-link-color, var(--rui-color-text-link));
$decoration: var(--rui-text-decoration-link);
$underline-offset: var(--rui-underline-offset-link);
$hover-color: var(--rui-local-link-color-hover, var(--rui-color-text-link-hover));
$hover-decoration: var(--rui-text-decoration-link-hover);
$active-color: var(--rui-local-link-color-active, var(--rui-color-text-link-active));
Expand Down
3 changes: 2 additions & 1 deletion src/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
--rui-line-height-small: 1.25;

// Text decorations
--rui-text-decoration-link: none;
--rui-underline-offset-link: 0.1875em;
--rui-text-decoration-link: underline;
--rui-text-decoration-link-hover: underline;
--rui-text-decoration-link-active: underline;

Expand Down

0 comments on commit d3264dd

Please sign in to comment.