Skip to content

Commit 97cc65c

Browse files
Use source order for stateful link styles
1 parent 631f613 commit 97cc65c

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

assets/sass/protocol/base/elements/_links.scss

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,31 @@
44

55
@use '../../includes/lib' as *;
66

7+
// Rely on source order for the stateful style overrides
8+
// 1. Visited
9+
// 2. Hover
10+
// 3. Active
11+
// 4. Focus
12+
13+
714
a {
815
color: var(--link-color);
916
text-decoration: underline;
1017

11-
&:where(:hover, :focus, :active) {
18+
&:visited {
19+
color: var(--link-color-visited);
20+
}
21+
22+
&:hover, &:active, &:focus {
1223
color: var(--link-color-hover);
1324
text-decoration: none;
1425
}
1526

16-
&:where(:active) {
27+
&:active {
1728
background-color: rgba(0, 0, 0, 0.05);
1829
}
1930
}
2031

21-
a:where(:visited) {
22-
color: var(--link-color-visited);
23-
24-
&:where(:hover, :focus, :active) {
25-
color: var(--link-color-visited-hover);
26-
}
27-
}
28-
2932
// any descendant link will inherit dark theming (replace light-links mixin)
3033
// this might belong in root file? site-wide dark theme class
3134
.mzp-t-dark {

0 commit comments

Comments
 (0)