Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: contrast for LemonButton type=primary status=danger #27194

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

adamleithp
Copy link
Contributor

@adamleithp adamleithp commented Dec 30, 2024

Problem

Primary danger button has a low contrast ratio in light and is basically broken in darkmode with a yellow background.

Although our engineers don't use this variant, there are some instances in the code where it occurs, and instead of changing those files, let's just fix from here.

Changes (top right button is changing)

Before Light (foreground: #F54E00, background: #FFFFFF = 3.51:1 contrast ratio)
image

Before Dark (foreground: #F54E00, background: #E0A045 = 1.55:1 contrast ratio)
image

After Light (foreground: #111111, background: #F8D7CD = 14.02:1 contrast ratio)
image
After Dark (foreground: #111111, background: #F1AF9C = 10.2:1 contrast ratio)
image

Does this work well for both Cloud and self-hosted?

N/A

How did you test this code?

Storybook

@adamleithp adamleithp requested a review from daibhin December 30, 2024 23:29
Copy link
Contributor

github-actions bot commented Dec 30, 2024

Size Change: 0 B

Total Size: 9.44 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 9.44 MB

compressed-size-action

@adamleithp
Copy link
Contributor Author

Found an example in the wild of primary/danger:

image

Removing authorized urls from data-managment/ toolbar

@adamleithp adamleithp requested a review from Twixes January 2, 2025 23:13
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

I liked the reverted earlier iteration of this improvement better: https://github.com/PostHog/posthog/pull/26821/files#diff-6b9ff2616e155dbc78346bd317a521087f520ddd7766cae0750e12c073564ac5

Can we go for that style?

@adamleithp
Copy link
Contributor Author

@Twixes agreed, so does @corywatilo (note the darkmode primary danger)
Updated top right:
image
No changes:
image

@adamleithp adamleithp removed the request for review from daibhin January 3, 2025 22:22
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

5 snapshot changes in total. 0 added, 5 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants