Skip to content

Commit

Permalink
improve color contrast on forest, halloween, lofi, night themes
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Jun 7, 2023
1 parent 75251a0 commit 7cd2487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extend([mixPlugin, namesPlugin, lchPlugin, hwbPlugin, labPlugin, xyzPlugin, a11y
// large text.

export const ContrastRatioWarningThreshold = 3
export const ContrastRatioErrorThreshold = 2.1
export const ContrastRatioErrorThreshold = 2.5

export const isColorContrastOkay = (input1, input2, ratio) => {
if (colord(input1).contrast(input2) > ratio) {
Expand Down
5 changes: 4 additions & 1 deletion src/theming/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ module.exports = {
"[data-theme=forest]": {
"color-scheme": "dark",
"primary": "#1eb854",
"primary-content": "#000000",
"secondary": "#1DB88E",
"accent": "#1DB8AB",
"neutral": "#19362D",
Expand All @@ -181,6 +182,7 @@ module.exports = {
"primary-content": "#131616",
"secondary": "#6d3a9c",
"accent": "#51a800",
"accent-content": "#000000",
"neutral": "#2F1B05",
"base-100": "#212121",
"info": "#2563eb",
Expand Down Expand Up @@ -220,7 +222,7 @@ module.exports = {
"info": "#0070F3",
"info-content": "#ffffff",
"success": "#21CC51",
"success-content": "#ffffff",
"success-content": "#000000",
"warning": "#FF6154",
"warning-content": "#ffffff",
"error": "#DE1C8D",
Expand Down Expand Up @@ -397,6 +399,7 @@ module.exports = {
"neutral-focus": "#273449",
"base-100": "#0F172A",
"info": "#0CA5E9",
"info-content": "#000000",
"success": "#2DD4BF",
"warning": "#F4BF50",
"error": "#FB7085",
Expand Down

0 comments on commit 7cd2487

Please sign in to comment.