Skip to content

Commit

Permalink
fix: Fix up table opacities (#18955)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Nov 29, 2023
1 parent a696b3f commit 9d0d787
Show file tree
Hide file tree
Showing 94 changed files with 41 additions and 20 deletions.
Binary file modified frontend/__snapshots__/components-command-bar--search--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__/insights-insightstable--aggregation.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__/insights-insightstable--default.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__/insights-insightstable--hourly.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__/insights-insightstable--is-legend.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.
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-a.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-icons--shelf-b.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-icons--shelf-c.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-icons--shelf-d.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-icons--shelf-e.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-icons--shelf-f.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-icons--shelf-g.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-icons--shelf-h.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-icons--shelf-i.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-icons--shelf-j.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-icons--shelf-k.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-icons--shelf-l.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-icons--shelf-m.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-icons--shelf-n.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-icons--shelf-o.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-icons--shelf-other.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-icons--shelf-p.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-icons--shelf-q.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-r.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-s.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-t.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-u.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-v.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-w.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-x.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-y.png
Binary file modified frontend/__snapshots__/lemon-ui-icons--shelf-z.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--basic.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--borderless-rows.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--empty-loading.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--empty.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--grouped.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--loading.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--small.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--with-footer.png
Binary file modified frontend/__snapshots__/lemon-ui-lemon-table--x-small.png
Binary file modified frontend/__snapshots__/scenes-app-annotations--annotations.png
Binary file modified frontend/__snapshots__/scenes-app-apps--installed.png
Binary file modified frontend/__snapshots__/scenes-app-dashboards--list.png
Binary file modified frontend/__snapshots__/scenes-app-events--event-explorer.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-area-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-bar-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-line-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-number-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-pie-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-table-edit.png
Binary file modified frontend/__snapshots__/scenes-app-notebooks--notebooks-list.png
Binary file modified frontend/__snapshots__/scenes-app-persons-groups--cohorts.png
Binary file modified frontend/__snapshots__/scenes-app-persons-groups--persons.png
Binary file modified frontend/__snapshots__/scenes-app-pipeline--pipeline-app-logs.png
Binary file modified frontend/__snapshots__/scenes-app-saved-insights--list-view.png
Binary file modified frontend/__snapshots__/scenes-other-settings--settings-project.png
61 changes: 41 additions & 20 deletions frontend/src/lib/lemon-ui/LemonTable/LemonTable.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
.LemonTable {
--row-base-height: 3rem;
--row-horizontal-padding: 1rem;
--lemon-table-background-color: var(--bg-table);

position: relative;
flex: 1;
width: 100%;
overflow: hidden;
background: var(--bg-table);
background: var(--lemon-table-background-color);
border: 1px solid var(--border);
border-radius: var(--radius);

.WebAnalyticsDashboard &,
.Insight & {
// Special override for scenes where the table is primarily next to insights
--lemon-table-background-color: var(--bg-light);
}

.posthog-3000 & {
--row-base-height: auto;

Expand Down Expand Up @@ -119,17 +126,20 @@
text-transform: uppercase;
letter-spacing: 0.03125rem;
background: var(--mid);
border-bottom: 1px solid var(--border);

.posthog-3000 & {
background: none;
background: var(--lemon-table-background-color);
}

> tr {
> th {
font-weight: 700;
text-align: left;

// box shadow as a border supports sticky headers
// Also it needs to be on the th - any higher and safari will not render the shadow
box-shadow: inset 0 -1px var(--border);

.posthog-3000 & {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
Expand All @@ -150,6 +160,10 @@

> tbody {
> tr {
&:not(:first-child) {
border-top: 1px solid var(--border);
}

&.LemonTable__expansion {
position: relative;
background: var(--side);
Expand Down Expand Up @@ -191,10 +205,6 @@
> tr {
height: var(--row-base-height);

&:not(:first-child) {
border-top: 1px solid var(--border);
}

> th,
> td {
padding-right: var(--row-horizontal-padding);
Expand Down Expand Up @@ -244,7 +254,7 @@
width: 100%;
height: 100%;
pointer-events: none;
background: var(--bg-light);
background: var(--lemon-table-background-color);
opacity: 0;
transition: opacity 200ms ease;

Expand All @@ -258,19 +268,25 @@
cursor: default;

.posthog-3000 & {
opacity: 0.4;
.LemonTable__header-content {
color: var(--text-secondary);
}
}

&.LemonTable__header--actionable {
cursor: pointer;

.posthog-3000 & {
&:hover {
opacity: 0.7;
.LemonTable__header-content {
color: var(--default);
}
}

&:active {
opacity: 0.9;
.LemonTable__header-content {
color: var(--default);
}
}
}
}
Expand All @@ -294,6 +310,19 @@
border-top: 1px solid var(--border);
}

// NOTE: this is outside of the storybook check for 3000 selective styling
.LemonTable__cell--sticky::before {
background: var(--lemon-table-background-color);
}

.LemonTable__header--sticky::before {
background: var(--mid);

.posthog-3000 & {
background: var(--lemon-table-background-color);
}
}

// Stickiness is disabled in snapshots due to flakiness
body:not(.storybook-test-runner) {
.LemonTable__header--sticky,
Expand All @@ -307,29 +336,21 @@ body:not(.storybook-test-runner) {
&::before {
position: absolute;
top: 0;
bottom: 1px; // Leave room for box shadow border
left: 0;
z-index: -1; // Place below cell content
width: 100%;
height: 100%;
clip-path: inset(0 -16px 0 0);
content: '';
box-shadow: -16px 0 16px 16px transparent;
transition: box-shadow 200ms ease;
}
}

.LemonTable__cell--sticky::before {
background: var(--bg-light);
}

tr.LemonTable__row--status-highlighted .LemonTable__cell--sticky::before {
background: #e8ecff; // TRICKY: This is a one-off opaque form of --primary-bg-hover, keep in sync with source
}

.LemonTable__header--sticky::before {
background: var(--mid);
}

.scrollable--left {
.LemonTable__cell--sticky::before,
.LemonTable__header--sticky::before {
Expand Down

0 comments on commit 9d0d787

Please sign in to comment.