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

feat(dev ex): Update Lemon Button with new color design system #26778

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/components-hogqleditor--no-value--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/components-sso-select--sso-select--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/components-verticalnesteddnd--base--dark.png
Binary file modified frontend/__snapshots__/filters-action-filter--bordered--dark.png
Binary file modified frontend/__snapshots__/filters-action-filter--sortable--dark.png
Binary file modified frontend/__snapshots__/filters-action-filter--standard--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-a--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-b--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-c--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-d--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-e--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-f--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-g--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-h--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-i--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-j--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-k--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-l--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-m--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-n--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-o--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-other--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-p--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-q--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-r--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-t--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-u--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-v--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-w--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-x--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--active--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--loading--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--no-padding--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--sizes--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--text-only--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--text-only--light.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-dialog--form--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-dialog--minimal--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-dialog--template--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-divider--vertical--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-field--pure-fields--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-menu--nested-menu--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-modal--lemon-modal--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-select--clearable--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-select--flat--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-spinner--in-buttons--dark.png
Binary file modified frontend/__snapshots__/lemon-ui-spinner--in-buttons--light.png
Binary file modified frontend/__snapshots__/scenes-app-dashboards--list--dark.png
Binary file modified frontend/__snapshots__/scenes-app-max-ai--welcome--dark.png
Binary file modified frontend/__snapshots__/scenes-app-persons-groups--cohorts--dark.png
Binary file modified frontend/__snapshots__/scenes-app-persons-groups--groups--dark.png
Binary file modified frontend/__snapshots__/scenes-app-surveys--surveys-list--dark.png
Binary file modified frontend/__snapshots__/scenes-other-invitesignup--cloud--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--cloud--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--cloud-eu--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--second-factor--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--self-hosted--dark.png
Binary file modified frontend/__snapshots__/scenes-other-login--sso-error--dark.png
adamleithp marked this conversation as resolved.
Show resolved Hide resolved
Binary file modified frontend/__snapshots__/scenes-other-products--products--dark.png
Binary file modified frontend/__snapshots__/scenes-other-signup--cloud--dark.png
Binary file modified frontend/__snapshots__/scenes-other-signup--self-hosted--dark.png
84 changes: 55 additions & 29 deletions frontend/src/lib/lemon-ui/LemonButton/LemonButton.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@mixin secondary-variables {
--button-border-color: var(--secondary-3000-button-border);
--lemon-button-bg-color-active: var(--bg-light);
--lemon-button-border-color-hover: var(--secondary-3000-button-border-hover);
--lemon-button-frame-bg-color: var(--secondary-3000-frame-bg);
--lemon-button-border-color: var(--border-tertiary);
--lemon-button-bg-color-active: transparent;
--lemon-button-border-color-hover: var(--border-secondary);
--lemon-button-frame-bg-color: var(--background-tertiary);
}

@mixin size-variables {
Expand Down Expand Up @@ -47,15 +47,16 @@
--lemon-button-transition: opacity 200ms ease, transform 200ms ease;
--lemon-button-border-width: 0;
--lemon-button-bg-color: transparent;
--button-border-color: none;
--lemon-button-border-color: none;
--lemon-button-border-color-hover: none;
--lemon-button-frame-bg-color: none;
--lemon-button-font-size: 0.875rem;
--lemon-button-icon-size: 1.5rem;
--lemon-button-height: 2.3125rem;
--lemon-button-gap: 0.5rem;
--lemon-button-icon-opacity: 0.8;
--lemon-button-color: var(--text-3000);
--lemon-button-color: var(--content-primary);
--lemon-button-spacer-color: var(--content-tertiary);

// column-gap: 4px;
// flex-direction: row;
Expand Down Expand Up @@ -188,20 +189,30 @@
}

&.LemonButton--primary {
--lemon-button-bg-color: var(--primary-3000-button-bg);
--lemon-button-bg-color-active: var(--primary-3000-button-bg);
--button-border-color: var(--primary-3000-button-border);
--lemon-button-border-color-hover: var(--primary-3000-button-border-hover);
--lemon-button-frame-bg-color: var(--primary-3000-frame-bg);
--lemon-button-color: var(--text-3000-light);
--lemon-button-bg-color: var(--background-primary);
--lemon-button-bg-color-active: var(--background-primary);
--lemon-button-border-color: var(--border-button);
--lemon-button-border-color-hover: var(--border-button-hover);
--lemon-button-frame-bg-color: var(--background-button-subtle);
--lemon-button-color: var(--content-primary);

[theme='dark'] & {
--lemon-button-bg-color: var(--background-button);
--lemon-button-border-color-hover: var(--border-button-bold-hover);
}

&.LemonButton--status-alt {
--lemon-button-bg-color: var(--primary-3000-frame-bg-light);
--lemon-button-bg-color-active: var(--lemon-button-bg-color);
--button-border-color: var(--primary-3000-button-border);
--lemon-button-border-color-hover: var(--primary-3000-button-border-hover);
--lemon-button-frame-bg-color: var(--primary-3000-button-bg-dark);
--lemon-button-color: var(--text-3000-light);
--lemon-button-bg-color: var(--background-button-subtle);
--lemon-button-bg-color-active: var(--background-button-subtle);
--lemon-button-border-color-hover: var(--border-button-hover);
--lemon-button-frame-bg-color: var(--background-button-subtle);
--lemon-button-color: var(--content-primary);

[theme='dark'] & {
--lemon-button-border-color: var(--border-button);
--lemon-button-bg-color: var(--background-button-subtle);
--lemon-button-border-color-hover: var(--background-button-subtle-hover);
}
}
}

Expand All @@ -214,19 +225,30 @@
&.LemonButton--status-danger,
&.LemonButton--primary.LemonButton--status-danger,
&.LemonButton--secondary.LemonButton--status-danger {
--lemon-button-color: var(--danger-3000-button-border-hover);
--button-border-color: var(--danger-3000-button-border);
--lemon-button-border-color-hover: var(--danger-3000-button-border-hover);
--lemon-button-frame-bg-color: var(--danger-3000-frame-bg);
--lemon-button-bg-color: var(--background-danger-subtle);
--lemon-button-color: var(--content-danger-bold);
--lemon-button-border-color: var(--border-danger);
--lemon-button-border-color-hover: var(--border-danger-bold);
--lemon-button-frame-bg-color: var(--background-danger-bold);
--lemon-button-icon-opacity: 1;

[theme='dark'] & {
--lemon-button-border-color: var(--border-danger);
--lemon-button-bg-color: var(--background-button-subtle);
--lemon-button-border-color-hover: var(--border-danger-hover);
}

&[aria-disabled='true']:not(.LemonButton--loading) {
--lemon-button-color: var(--content-danger-bold-disabled);
}
}

&.LemonButton--secondary.LemonButton--status-alt {
--lemon-button-color: var(--muted);
--lemon-button-color: var(--content-tertiary);

&.LemonButton--active,
&:hover:not([aria-disabled='true']) {
--lemon-button-color: var(--text-3000);
--lemon-button-color: var(--content-tertiary);
}
}

Expand Down Expand Up @@ -264,7 +286,7 @@
inset: -1px;
z-index: 0;
content: '';
border: 1px solid var(--button-border-color);
border: 1px solid var(--lemon-button-border-color);
border-radius: var(--radius);
}

Expand All @@ -274,7 +296,7 @@
z-index: 0;
content: '';
background: var(--lemon-button-bg-color);
border: 1px solid var(--button-border-color);
border: 1px solid var(--lemon-button-border-color);
border-radius: var(--radius);
box-shadow: 0 var(--lemon-button-chrome-depth) 0 -1px var(--lemon-button-frame-bg-color);
transition: opacity 200ms ease;
Expand Down Expand Up @@ -325,13 +347,13 @@
&.LemonButton--tertiary {
&:not([aria-disabled='true']):hover,
&.LemonButton--active {
background-color: var(--glass-border-3000);
background-color: var(--background-tertiary);
}

&.LemonButton--status-danger {
&:not([aria-disabled='true']):hover,
&.LemonButton--active {
background-color: var(--danger-highlight);
background-color: var(--background-danger-subtle);
}
}
}
Expand Down Expand Up @@ -363,7 +385,7 @@
var(--lemon-button-padding-right, var(--lemon-button-padding-horizontal))
);
height: calc(var(--lemon-button-height) - 1.0625rem);
color: var(--muted);
color: var(--lemon-button-spacer-color);

&--divider {
padding: 0;
Expand Down Expand Up @@ -416,6 +438,10 @@

&:not([aria-disabled='true']):hover {
background: rgb(0 0 0 / 10%);

[theme='dark'] & {
background: rgb(255 255 255 / 10%);
}
}
}

Expand Down
27 changes: 25 additions & 2 deletions frontend/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,15 @@ Only 400 (`normal`), 500 (`var(--font-medium)`), 600 (`var(--font-semibold)`), o
--background-brand: var(--brand-500);
--background-brand-hover: var(--brand-600);
--background-brand-pressed: var(--brand-700);
--background-button: var(--yellow-500);
--background-button-hover: var(--yellow-700);
--background-button-pressed: var(--yellow-800);
--background-button-subtle: var(--yellow-500);
--background-warning: var(--orange-500);
--background-warning-subtle: var(--orange-50);
--background-danger: var(--red-500);
--background-danger-subtle: var(--red-50);
--background-danger-bold: var(--red-200);
--background-success: var(--green-500);
--background-success-subtle: var(--green-50);
--border-primary: var(--neutral-warm-600);
Expand All @@ -241,7 +246,12 @@ Only 400 (`normal`), 500 (`var(--font-medium)`), 600 (`var(--font-semibold)`), o
--border-focus: var(--blue-500);
--border-warning: var(--orange-500);
--border-danger: var(--red-500);
--border-danger-bold: var(--red-600);
--border-success: var(--green-500);
--border-button: var(--yellow-600);
--border-button-hover: var(--yellow-700);
--border-button-bold-hover: var(--yellow-900);
--border-button-subtle: var(--yellow-500);
--overlay-50: var(--primary-black-50);
--overlay-50-inverse: var(--primary-white-50);

Expand Down Expand Up @@ -578,17 +588,30 @@ body {
&[theme='dark'] {
// Semantic colors (Dark mode) WIP
--content-primary: var(--neutral-cool-100);
--content-warning: var(--orange-300);
--content-secondary: var(--neutral-cool-200);
--content-tertiary: var(--neutral-cool-300);
--content-warning-bold: var(--orange-100);
--content-danger-bold: var(--red-100);
--content-danger-bold: var(--red-200);
--content-danger-bold-disabled: var(--red-100);
--content-success-bold: var(--green-100);
--background-primary: var(--neutral-cool-900);
--background-secondary: var(--neutral-cool-850);
--background-tertiary: var(--neutral-cool-800);
--background-warning-subtle: var(--orange-850);
--background-danger-subtle: var(--red-800);
--background-danger-bold: var(--red-600);
--border-button-hover: var(--yellow-700);
--border-button-bold-hover: var(--yellow-500);
--border-button-subtle: var(--yellow-500);
--background-button: var(--yellow-800);
--background-button-subtle: var(--yellow-900);
--background-button-subtle-hover: var(--yellow-500);
--background-success-subtle: var(--green-800);
--border-secondary: var(--neutral-cool-650);
--border-tertiary: var(--neutral-cool-750);
--border-danger: var(--red-500);
--border-danger-hover: var(--red-400);
--border-danger-bold: var(--red-400);

@include dark-mode-3000-variables;
}
Expand Down
Loading