Skip to content

Commit

Permalink
Merge pull request #1221 from dpc-sdp/bugfix/R20-1987-visited-links
Browse files Browse the repository at this point in the history
[R20-1987] Changed visited link style to a util class
  • Loading branch information
waitingallday authored Jun 20, 2024
2 parents b5870ac + 15b62a6 commit aa5affa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@import '@dpc-sdp/ripple-ui-core/style/breakpoints';

.rpl-search-result {
--local-clr-link-visited: var(--rpl-clr-link-visited);

padding-top: var(--rpl-sp-5);
padding-bottom: var(--rpl-sp-5);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const handleClick = () => {
</div>
<div ref="container" class="rpl-search-result__heading">
<h2 class="rpl-search-result__title rpl-type-h3">
<RplTextLink ref="trigger" :url="url" @click="handleClick">
<RplTextLink ref="trigger" :url="url" class="rpl-u-link-visited" @click="handleClick">
{{ title }}
</RplTextLink>
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
}
}

&:visited {
color: var(
--local-clr-link-visited,
var(--local-clr-link, var(--rpl-clr-link))
);
}

&:active {
color: var(--local-clr-link-active, var(--rpl-clr-dark));
text-decoration: none;
Expand Down
1 change: 1 addition & 0 deletions packages/ripple-ui-core/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import 'utilities/_accessibility.css';
@import 'utilities/_container.css';
@import 'utilities/_focus.css';
@import 'utilities/_visited.css';
@import 'generated/_grid.css';
@import 'utilities/_lists.css';
@import 'generated/_margin.css';
Expand Down
9 changes: 9 additions & 0 deletions packages/ripple-ui-core/src/styles/utilities/_visited.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
For most links, we don't want a visited state to be applied.
This utility class can be used to apply a visited state to links that need it.
*/
.rpl-u-link-visited {
&:visited {
color: var(--rpl-clr-link-visited);
}
}

0 comments on commit aa5affa

Please sign in to comment.