Skip to content

Commit

Permalink
Add :visited colour and enforce uniform contrast between light/dark
Browse files Browse the repository at this point in the history
The typography colours now consistently have a contrast of ~6.
  • Loading branch information
pradyunsg committed Jan 30, 2024
1 parent c718f86 commit ae21077
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
12 changes: 11 additions & 1 deletion src/furo/assets/styles/base/_typography.sass
Expand Up @@ -84,11 +84,21 @@ a
color: var(--color-link)
text-decoration-color: var(--color-link-underline)

&:visited
color: var(--color-link--visited)
text-decoration-color: var(--color-link-underline--visited)
&:hover
color: var(--color-link--visited--hover)
text-decoration-color: var(--color-link-underline--visited--hover)

&:hover
color: var(--color-link--hover)
text-decoration-color: var(--color-link-underline--hover)
&.muted-link
color: inherit
&:hover
color: var(--color-link)
color: var(--color-link--hover)
text-decoration-color: var(--color-link-underline--hover)
&:visited
color: var(--color-link--visited--hover)
text-decoration-color: var(--color-link-underline--visited--hover)
19 changes: 13 additions & 6 deletions src/furo/assets/styles/variables/_colors.scss
Expand Up @@ -27,8 +27,9 @@
--color-announcement-text: #eeebee;

// Brand colors
--color-brand-primary: #2962ff;
--color-brand-content: #2a5adf;
--color-brand-primary: #0a4bff;
--color-brand-content: #2757dd;
--color-brand-visited: #872ee0;

// API documentation
--color-api-background: var(--color-background-hover--transparent);
Expand Down Expand Up @@ -120,16 +121,21 @@

// Links
--color-link: var(--color-brand-content);
--color-link--hover: var(--color-brand-content);
--color-link-underline: var(--color-background-border);
--color-link--hover: var(--color-brand-content);
--color-link-underline--hover: var(--color-foreground-border);

--color-link--visited: var(--color-brand-visited);
--color-link-underline--visited: var(--color-background-border);
--color-link--visited--hover: var(--color-brand-visited);
--color-link-underline--visited--hover: var(--color-foreground-border);
}

@mixin colors-dark {
--color-problematic: #ee5151;

// Base Colors
--color-foreground-primary: #ffffffcc; // for main text and headings
--color-foreground-primary: #cfd0d0; // for main text and headings
--color-foreground-secondary: #9ca0a5; // for secondary text
--color-foreground-muted: #81868d; // for muted text
--color-foreground-border: #666666; // for content borders
Expand All @@ -146,8 +152,9 @@
--color-announcement-text: #eeebee;

// Brand colors
--color-brand-primary: #2b8cee;
--color-brand-content: #368ce2;
--color-brand-primary: #668fff;
--color-brand-content: #7292e9;
--color-brand-visited: #b27aeb;

// Highlighted text (search)
--color-highlighted-background: #083563;
Expand Down

0 comments on commit ae21077

Please sign in to comment.