Skip to content

Commit

Permalink
Add colorblind beta themes
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Oct 3, 2021
1 parent 84b028c commit fef11f4
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ major updates to the project.

## 2021-10-03

### added

- Add colorblind beta themes
([#187](https://github.com/giscus/giscus/pull/187)).

### changed

- Use primer/primitives v5 as theme base and update looks to match GitHub
Expand Down
2 changes: 2 additions & 0 deletions lib/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const Theme = {
dark: 'GitHub Dark',
dark_dimmed: 'GitHub Dark Dimmed',
dark_high_contrast: 'GitHub Dark High Contrast',
dark_protanopia: 'GitHub Dark Colorblind',
light_protanopia: 'GitHub Light Colorblind',
transparent_dark: 'Transparent Dark',
preferred_color_scheme: 'Preferred color scheme',
custom: 'Custom (experimental)',
Expand Down
94 changes: 94 additions & 0 deletions styles/themes/dark_protanopia.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*! MIT License
* Copyright (c) 2018 GitHub Inc.
* https://github.com/primer/primitives/blob/main/LICENSE
*/

main {
--color-prettylights-syntax-comment: #8b949e;
--color-prettylights-syntax-constant: #79c0ff;
--color-prettylights-syntax-entity: #d2a8ff;
--color-prettylights-syntax-storage-modifier-import: #c9d1d9;
--color-prettylights-syntax-entity-tag: #83d4ff;
--color-prettylights-syntax-keyword: #d69a00;
--color-prettylights-syntax-string: #a5d6ff;
--color-prettylights-syntax-variable: #ffa657;
--color-prettylights-syntax-brackethighlighter-unmatched: #c38000;
--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
--color-prettylights-syntax-invalid-illegal-bg: #633e00;
--color-prettylights-syntax-carriage-return-text: #f0f6fc;
--color-prettylights-syntax-carriage-return-bg: #865401;
--color-prettylights-syntax-string-regexp: #83d4ff;
--color-prettylights-syntax-markup-list: #f2cc60;
--color-prettylights-syntax-markup-heading: #1f6feb;
--color-prettylights-syntax-markup-italic: #c9d1d9;
--color-prettylights-syntax-markup-bold: #c9d1d9;
--color-prettylights-syntax-markup-deleted-text: #f0ec59;
--color-prettylights-syntax-markup-deleted-bg: #452f00;
--color-prettylights-syntax-markup-inserted-text: #a0e8ff;
--color-prettylights-syntax-markup-inserted-bg: #0a2861;
--color-prettylights-syntax-markup-changed-text: #ffdfb6;
--color-prettylights-syntax-markup-changed-bg: #5a1e02;
--color-prettylights-syntax-markup-ignored-text: #c9d1d9;
--color-prettylights-syntax-markup-ignored-bg: #1158c7;
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
--color-prettylights-syntax-brackethighlighter-angle: #8b949e;
--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
--color-btn-text: #c9d1d9;
--color-btn-bg: #21262d;
--color-btn-border: rgba(240, 246, 252, 0.1);
--color-btn-shadow: 0 0 transparent;
--color-btn-inset-shadow: 0 0 transparent;
--color-btn-hover-bg: #30363d;
--color-btn-hover-border: #8b949e;
--color-btn-active-bg: hsla(212, 12%, 18%, 1);
--color-btn-active-border: #6e7681;
--color-btn-primary-text: #ffffff;
--color-btn-primary-bg: #1d69e0;
--color-btn-primary-border: rgba(240, 246, 252, 0.1);
--color-btn-primary-shadow: 0 0 transparent;
--color-btn-primary-inset-shadow: 0 0 transparent;
--color-btn-primary-hover-bg: #1585fd;
--color-btn-primary-hover-border: rgba(240, 246, 252, 0.1);
--color-btn-primary-selected-bg: #1d69e0;
--color-btn-primary-selected-shadow: 0 0 transparent;
--color-btn-primary-disabled-text: rgba(240, 246, 252, 0.5);
--color-btn-primary-disabled-bg: rgba(29, 105, 224, 0.6);
--color-btn-primary-disabled-border: rgba(240, 246, 252, 0.1);
--color-fg-default: #c9d1d9;
--color-fg-muted: #8b949e;
--color-fg-subtle: #484f58;
--color-canvas-default: #0d1117;
--color-canvas-overlay: #161b22;
--color-canvas-inset: #010409;
--color-canvas-subtle: #161b22;
--color-border-default: #30363d;
--color-border-muted: #21262d;
--color-neutral-muted: rgba(110, 118, 129, 0.4);
--color-neutral-subtle: rgba(110, 118, 129, 0.1);
--color-accent-fg: #58a6ff;
--color-accent-emphasis: #1f6feb;
--color-accent-muted: rgba(56, 139, 253, 0.4);
--color-accent-subtle: rgba(56, 139, 253, 0.15);
--color-success-fg: #42a0ff;
--color-danger-fg: #c38000;
--color-primer-shadow-focus: 0 0 0 3px #0c2d6b;
--color-scale-gray-7: #424a53;
--color-scale-gray-8: #32383f;
--color-scale-blue-8: #0a3069;

/*! Extensions from @primer/css/alerts/flash.scss */
--color-social-reaction-border: var(--color-scale-blue-8);
--color-social-reaction-bg: var(--color-scale-gray-8);
--color-social-reaction-bg-hover: var(--color-scale-gray-7);
--color-social-reaction-bg-reacted-hover: var(--color-scale-blue-8);
}

main .pagination-loader-container {
background-image: url(https://github.com/images/modules/pulls/progressive-disclosure-line-dark.svg);
}

/*! Custom CSS */
main {
color-scheme: dark;
}
94 changes: 94 additions & 0 deletions styles/themes/light_protanopia.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*! MIT License
* Copyright (c) 2018 GitHub Inc.
* https://github.com/primer/primitives/blob/main/LICENSE
*/

main {
--color-prettylights-syntax-comment: #6e7781;
--color-prettylights-syntax-constant: #0550ae;
--color-prettylights-syntax-entity: #8250df;
--color-prettylights-syntax-storage-modifier-import: #24292f;
--color-prettylights-syntax-entity-tag: #054da9;
--color-prettylights-syntax-keyword: #ac5e00;
--color-prettylights-syntax-string: #0a3069;
--color-prettylights-syntax-variable: #953800;
--color-prettylights-syntax-brackethighlighter-unmatched: #6c3900;
--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
--color-prettylights-syntax-invalid-illegal-bg: #6c3900;
--color-prettylights-syntax-carriage-return-text: #f6f8fa;
--color-prettylights-syntax-carriage-return-bg: #ac5e00;
--color-prettylights-syntax-string-regexp: #054da9;
--color-prettylights-syntax-markup-list: #3b2300;
--color-prettylights-syntax-markup-heading: #0550ae;
--color-prettylights-syntax-markup-italic: #24292f;
--color-prettylights-syntax-markup-bold: #24292f;
--color-prettylights-syntax-markup-deleted-text: #6c3900;
--color-prettylights-syntax-markup-deleted-bg: #fefe48;
--color-prettylights-syntax-markup-inserted-text: #054da9;
--color-prettylights-syntax-markup-inserted-bg: #c0f6ff;
--color-prettylights-syntax-markup-changed-text: #953800;
--color-prettylights-syntax-markup-changed-bg: #ffd8b5;
--color-prettylights-syntax-markup-ignored-text: #eaeef2;
--color-prettylights-syntax-markup-ignored-bg: #0550ae;
--color-prettylights-syntax-meta-diff-range: #8250df;
--color-prettylights-syntax-brackethighlighter-angle: #57606a;
--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
--color-prettylights-syntax-constant-other-reference-link: #0a3069;
--color-btn-text: #24292f;
--color-btn-bg: #f6f8fa;
--color-btn-border: rgba(27, 31, 36, 0.15);
--color-btn-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
--color-btn-inset-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
--color-btn-hover-bg: #f3f4f6;
--color-btn-hover-border: rgba(27, 31, 36, 0.15);
--color-btn-active-bg: hsla(220, 14%, 93%, 1);
--color-btn-active-border: rgba(27, 31, 36, 0.15);
--color-btn-primary-text: #ffffff;
--color-btn-primary-bg: #0088ff;
--color-btn-primary-border: rgba(27, 31, 36, 0.15);
--color-btn-primary-shadow: 0 1px 0 rgba(27, 31, 36, 0.1);
--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
--color-btn-primary-hover-bg: #0566d5;
--color-btn-primary-hover-border: rgba(27, 31, 36, 0.15);
--color-btn-primary-selected-bg: hsla(212, 95%, 41%, 1);
--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0, 31, 80, 0.2);
--color-btn-primary-disabled-text: rgba(255, 255, 255, 0.8);
--color-btn-primary-disabled-bg: #65ccff;
--color-btn-primary-disabled-border: rgba(27, 31, 36, 0.15);
--color-fg-default: #24292f;
--color-fg-muted: #57606a;
--color-fg-subtle: #6e7781;
--color-canvas-default: #ffffff;
--color-canvas-overlay: #ffffff;
--color-canvas-inset: #f6f8fa;
--color-canvas-subtle: #f6f8fa;
--color-border-default: #d0d7de;
--color-border-muted: hsla(210, 18%, 87%, 1);
--color-neutral-muted: rgba(175, 184, 193, 0.2);
--color-neutral-subtle: rgba(234, 238, 242, 0.5);
--color-accent-fg: #0969da;
--color-accent-emphasis: #0969da;
--color-accent-muted: rgba(84, 174, 255, 0.4);
--color-accent-subtle: #ddf4ff;
--color-success-fg: #0566d5;
--color-danger-fg: #ac5e00;
--color-primer-shadow-focus: 0 0 0 3px rgba(9, 105, 218, 0.3);
--color-scale-gray-0: #f6f8fa;
--color-scale-gray-1: #eaeef2;
--color-scale-blue-1: #b6e3ff;

/*! Extensions from @primer/css/alerts/flash.scss */
--color-social-reaction-border: var(--color-scale-blue-1);
--color-social-reaction-bg: var(--color-scale-gray-0);
--color-social-reaction-bg-hover: var(--color-scale-gray-1);
--color-social-reaction-bg-reacted-hover: var(--color-scale-blue-1);
}

main .pagination-loader-container {
background-image: url(https://github.com/images/modules/pulls/progressive-disclosure-line.svg);
}

/*! Custom CSS */
main {
color-scheme: light;
}

1 comment on commit fef11f4

@vercel
Copy link

@vercel vercel bot commented on fef11f4 Oct 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.