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(3000): Improve opacity of profile pictures #19004

Merged
merged 24 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
72f819d
fix(3000): Improve opacity of profile pictures
Twixes Nov 30, 2023
c721bb5
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
fbca2a1
Update UI snapshots for `chromium` (2)
github-actions[bot] Nov 30, 2023
79f22f0
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
69cc7b9
Fix icon color and sizing edge cases
Twixes Nov 30, 2023
fe44db5
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
e93cf29
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
ec0c59e
Update UI snapshots for `chromium` (1)
github-actions[bot] Nov 30, 2023
b437cae
Merge branch 'master' into improve-3000-profile-picture-opacity
Twixes Dec 5, 2023
d1e965d
Update LemonButton3000.scss
Twixes Dec 5, 2023
da8a689
Restore transition
Twixes Dec 5, 2023
103b4b1
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
3cc328b
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 5, 2023
8fc28e9
Update ProfilePicture.scss
Twixes Dec 5, 2023
cee1076
Update more for new button structure
Twixes Dec 5, 2023
dff8f02
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 5, 2023
ccec343
Update UI snapshots for `chromium` (2)
github-actions[bot] Dec 5, 2023
224046e
Merge branch 'master' into improve-3000-profile-picture-opacity
Twixes Dec 6, 2023
fcec097
Remove divider size override
Twixes Dec 6, 2023
cb2a332
Use vars more
Twixes Dec 6, 2023
c7b37e0
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 6, 2023
d26e0be
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 6, 2023
e5f989b
Update UI snapshots for `chromium` (1)
github-actions[bot] Dec 6, 2023
995772f
Merge branch 'master' into improve-3000-profile-picture-opacity
Twixes Dec 6, 2023
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
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--default--dark.png
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__/lemon-ui-lemon-button--default--light.png
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__/lemon-ui-lemon-button--full-width--dark.png
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__/lemon-ui-lemon-button--loading--dark.png
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__/lemon-ui-lemon-button--more--dark.png
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__/lemon-ui-lemon-button--more--light.png
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__/lemon-ui-lemon-button--no-padding--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.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--sizes--dark.png
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__/lemon-ui-lemon-button--sizes--light.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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm thought I fixed this in #19045

7 changes: 6 additions & 1 deletion frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ export const LemonButtonWithSideAction: React.FunctionComponent<
const SideComponent = sideDropdown ? LemonButtonWithDropdown : LemonButton

return (
<div className={clsx('LemonButtonWithSideAction', `LemonButtonWithSideAction--${buttonProps.size}`)}>
<div
className={clsx(
'LemonButtonWithSideAction',
buttonProps.size && `LemonButtonWithSideAction--${buttonProps.size}`
)}
>
{/* Bogus `sideIcon` div prevents overflow under the side button. */}
<LemonButton
ref={ref}
Expand Down
43 changes: 35 additions & 8 deletions frontend/src/lib/lemon-ui/LemonButton/LemonButton3000.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.posthog-3000 {
.LemonButton,
.Link.LemonButton {
--lemon-button-transition: opacity 200ms ease, transform 200ms ease;
--lemon-button-border-width: 0;

position: relative;
min-height: 2.125rem;
padding: 0;
Expand All @@ -14,7 +11,7 @@
border-width: var(--lemon-button-border-width);
border-radius: var(--radius);
outline: none;
transition: var(--lemon-button-transition);
transition: none;

.LemonButton__chrome {
position: relative;
Expand All @@ -36,10 +33,16 @@
border-style: solid;
border-width: var(--lemon-button-border-width);
border-radius: var(--radius);
transition: var(--transition);
}

.LemonButton__icon {
opacity: 0.5;
.LemonButton__icon {
color: var(--muted-3000);
transition: none;

> :not(.LemonIcon) {
// Elements that serve as an icon, but aren't an icon are slightly muted -
// not so much that they look disabled though
opacity: 0.75;
}
}

Expand Down Expand Up @@ -131,6 +134,13 @@
}
}

&:not([aria-disabled='true']):hover,
&.LemonButton--active {
.LemonButton__icon > :not(.LemonIcon) {
opacity: 1;
}
}

&:not(.LemonButton--tertiary) {
padding-bottom: 1px;

Expand Down Expand Up @@ -216,6 +226,10 @@
.LemonButton__chrome {
border-color: var(--secondary-3000-button-border);
}

.LemonButton__icon {
color: var(--muted-3000);
}
}

&:not(:hover) {
Expand All @@ -227,6 +241,10 @@
background-color: transparent;
border-color: transparent;
}

.LemonButton__icon {
color: var(--trace-3000);
}
}
}

Expand All @@ -249,12 +267,16 @@
height: 1.25rem;
color: var(--muted);

&.LemonButtonWithSideAction__spacer--divider {
&--divider {
padding: 0;
margin-left: 0.25rem;
}
}

.LemonButton--small .LemonButtonWithSideAction__spacer--divider {
height: 1.125rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe beyond the scope of this PR but feels like this value could drift from https://github.com/PostHog/posthog/pull/19004/files#diff-c694fbbe6b6ff7273c964743f37751e5416009c150d0a9ddad1b4c031ef006d3R264. Perhaps the height should be a calc based on the button height minus some vertical padding

Copy link
Member Author

Choose a reason for hiding this comment

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

This actually shouldn't be needed with the recent refactoring, so removed!

}

// SideAction buttons are buttons next to other buttons in the DOM but layered on top. since they're on another button, we don't want them to look like buttons.
.LemonButtonWithSideAction__side-button {
top: 1px;
Expand All @@ -280,6 +302,11 @@
border: none !important;
}

.LemonButton__icon {
color: currentColor;
opacity: 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does --lemon-button-icon-opacity: 0.5 work here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! Thanks, changed to that

}

&:not([aria-disabled='true']):hover {
background: rgb(0 0 0 / 10%);
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/lemon-ui/ProfilePicture/ProfilePicture.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
align-items: center;
justify-content: center;
font-weight: 600;
color: #5f1903;
user-select: none;
background-color: var(--lettermark-6-text);
border-radius: 50%;

&.xxl {
Expand Down Expand Up @@ -71,6 +69,8 @@
height: inherit;
font-size: inherit;
line-height: inherit;
color: #5f1903;
background-color: var(--lettermark-6-text);
}
}

Expand Down
Loading