Skip to content

Commit

Permalink
update the link colors on darkmode (#4201)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

https://app.asana.com/0/1200099998847559/1204216689849797/f

Description of the Issue
Review pages and for any links on backgrounds with the color of #262a38
($neutral100), change the hover color of those links to #1FA4A3
($teal30) so that they have appropriate contrast per
[WebAIM](https://webaim.org/) requirements.

Links
Use the WebAIM web extension to check contrast
https://wave.webaim.org/extension/

NOTE: I limited the brightness on the links a bit since this was causing
unanticipated issues on images washing out. I updated the link color and
link hover color to #1FA4A3 on dark mode.

Preview:

https://docs-getdbt-com-git-fix-insufficient-contrast-o-3250d0-dbt-labs.vercel.app/docs/introduction

## Checklist
<!--
Uncomment if you're publishing docs for a prerelease version of dbt
(delete if not applicable):
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/guides/migration/versions)
-->
- [ ] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [ ] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

Adding new pages (delete if not applicable):
- [ ] Add page to `website/sidebars.js`
- [ ] Provide a unique filename for the new page

Removing or renaming existing pages (delete if not applicable):
- [ ] Remove page from `website/sidebars.js`
- [ ] Add an entry `website/static/_redirects`
- [ ] [Ran link
testing](https://github.com/dbt-labs/docs.getdbt.com#running-the-cypress-tests-locally)
to update the links that point to the deleted page
  • Loading branch information
breezyfasano authored Oct 9, 2023
2 parents 132202e + a99d0b5 commit 571abfc
Showing 1 changed file with 57 additions and 10 deletions.
67 changes: 57 additions & 10 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
--pagination-icon-prev: "\2190";
--filter-brightness-low: 1.1;
--filter-brightness-high: 1.5;

--darkmode-link-color: #1FA4A3;
--light-dark-toggle: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuMzA4IDMuMzg1YzAtMS4xNzguMTczLTIuMzcuNjE1LTMuMzg1QzEuOTgzIDEuMjggMCA0LjI4MiAwIDcuNjkyQTguMzA4IDguMzA4IDAgMCAwIDguMzA4IDE2YzMuNDEgMCA2LjQxMi0xLjk4MyA3LjY5Mi00LjkyMy0xLjAxNS40NDItMi4yMDcuNjE1LTMuMzg1LjYxNWE4LjMwOCA4LjMwOCAwIDAgMS04LjMwNy04LjMwN1oiIGZpbGw9IiM5MkEwQjMiLz48L3N2Zz4=";

/* search overrides */
Expand Down Expand Up @@ -104,10 +104,10 @@ html[data-theme="dark"] {

/* Linked `code` tags visibility adjustment */
html[data-theme=dark] a code {
color: var(--ifm-link-color);
color: var(--darkmode-link-color);
}
html[data-theme=dark] a code:hover {
color: var(--ifm-link-hover-color);;
color: var(--darkmode-link-color);
}

/* For /dbt-cloud/api REDOC Page */
Expand All @@ -122,11 +122,11 @@ html[data-theme="dark"] .api-content h1 {

html[data-theme="dark"] .api-content button,
html[data-theme="dark"] .api-content a {
filter: brightness(1.25);
filter: brightness(var(--filter-brightness-low));
}

html[data-theme="dark"] .api-content a:hover {
filter: brightness(1.25);
filter: brightness(var(--filter-brightness-low));
}

.redoc-wrap .api-content a,
Expand Down Expand Up @@ -165,8 +165,19 @@ table td {
vertical-align: top;
}

html[data-theme=dark] main .row .col:first-of-type a:not(.button) {
color: var(--darkmode-link-color);
}

html[data-theme="dark"] main .row .col:first-of-type a:hover {
filter: brightness(var(--filter-brightness-low));
}

html[data-theme="dark"] main .row .col:first-of-type a article * {
color: white;
}

html[data-theme="dark"] table td {
filter: brightness(1.5);
color: white;
}

Expand Down Expand Up @@ -668,6 +679,14 @@ i.theme-doc-sidebar-item-category.theme-doc-sidebar-item-category-level-2.menu__
color: var(--ifm-color-gray-900);
}

.alert--secondary,
.alert--secondary a,
.alert--secondary svg {
--ifm-alert-background-color: #474748;
color: white !important;
fill: white !important;
}

html[data-theme="dark"] .alert * {
--ifm-alert-foreground-color: var(--ifm-color-gray-900);
}
Expand All @@ -683,7 +702,7 @@ html[data-theme="dark"] .alert table {
.alert--success a,
.alert--danger a,
.alert--warning a {
color: var(--ifm-color-gray-900);
color: var(--ifm-color-gray-900) !important;
}

.linkout {
Expand Down Expand Up @@ -842,6 +861,14 @@ div .toggle_src-components-faqs-styles-module {
gap: 1em;
}

html[data-theme="dark"] .pagination-nav a {
color: var(--darkmode-link-color);
}

html[data-theme="dark"] .pagination-nav a:hover {
filter: brightness(var(--filter-brightness-low));
}

.pagination-nav__link {
padding: 1rem 0;
transition: 100ms all ease-in-out;
Expand Down Expand Up @@ -948,8 +975,13 @@ html[data-theme="dark"] .blog-breadcrumbs a[href="#"] {
filter: brightness(var(--filter-brightness-low));
}

html[data-theme="dark"] .blog-breadcrumbs a:not(:last-of-type):after {
color: var(--ifm-link-color);
html[data-theme="dark"] .blog-breadcrumbs a:hover {
filter: brightness(var(--filter-brightness-low));
}

html[data-theme="dark"] .blog-breadcrumbs a:not(:last-of-type):after,
html[data-theme="dark"] .blog-breadcrumbs a {
color: var(--darkmode-link-color);
}

html[data-theme="dark"] .breadcrumbs__item--active .breadcrumbs__link {
Expand Down Expand Up @@ -993,6 +1025,21 @@ article[itemprop="blogPost"] h2 {
font-size: 2rem;
}

html[data-theme="dark"] article[itemprop="blogPost"] a {
color: var(--darkmode-link-color);
}

html[data-theme="dark"] article[itemprop="blogPost"] a:hover {
filter: brightness(var(--filter-brightness-low));
}

/* Sidebar Nav */
html[data-theme="dark"] .main-wrapper nav a:hover,
html[data-theme="dark"] .main-wrapper nav a:active {
color: var(--darkmode-link-color) !important;
filter: brightness(var(--filter-brightness-low));
}

/* footer styles */
.footer {
font-weight: var(--ifm-font-weight-narrow);
Expand Down Expand Up @@ -1053,7 +1100,7 @@ article[itemprop="blogPost"] h2 {
/* copyright */
.footer__bottom {
text-align: left;
color: var(--color-footer-accent);
color: white;
font-size: 0.875rem;
}

Expand Down

0 comments on commit 571abfc

Please sign in to comment.