Skip to content

Commit

Permalink
Increased color contrast when buttons overlap selected rows (#9880)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbell-lot23 authored Nov 14, 2023
1 parent 36c01c5 commit d61a0a9
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
color: var(--color-default);
}
.Node[data-selected] {
background-color: var(--theme-selection-background);
background-color: var(--primary-accent-dimmed);
}
.Node[data-selected],
.Node[data-selected] .HtmlAttributeName,
Expand All @@ -29,7 +29,6 @@
.Node[data-selected] .HTMLTag,
.Node[data-selected] .Separator,
.Node[data-selected] .Icon {
color: var(--theme-selection-color);
fill: var(--theme-selection-color);
}
.Node[data-loading] {
Expand Down
17 changes: 14 additions & 3 deletions packages/replay-next/pages/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

--primary-accent: #01acfd;
--primary-accent-hover: #0194ff;
--primary-accent-foreground-text: #fff;

--secondary-accent: #f02d5e;
--secondary-accent-hover: #d72451;
Expand Down Expand Up @@ -145,6 +144,10 @@
:root,
:root.theme-dark {
--color-transparent: rgba(0, 0, 0, 0);
--primary-accent-foreground-text: #fff;

--primary-accent-dimmed: #163e58;
--primary-accent-dimmed-foreground-text: var(--body-color);

/* Color ramp (Dark) */
--theme-base-100: #000; /* background chrome */
Expand Down Expand Up @@ -187,7 +190,9 @@
--theme-text-field-bgcolor: var(--theme-base-85);
--theme-text-field-color: #fff;
--theme-text-field-placeholder-color: #babbbc;
--team-row-active: var(--theme-text-field-bgcolor);
--team-row-active: var(--primary-accent-dimmed);
--timing-container: var(--theme-base-85);
--timing-container-selected-row: #175e88;
--tooltip-bgcolor: var(--theme-base-100);
--tooltip-color: #fff;
--tooltip-border: 1px solid rgba(43, 46, 49, 1);
Expand Down Expand Up @@ -668,6 +673,10 @@

:root.theme-light {
--color-transparent: rgba(255, 255, 255, 0);
--primary-accent-foreground-text: #fff;

--primary-accent-dimmed: #cceeff;
--primary-accent-dimmed-foreground-text: var(--body-color);

/* Color ramp (Light) */
--theme-base-100: hsl(0, 0%, 100%);
Expand Down Expand Up @@ -710,7 +719,9 @@
--theme-text-field-bgcolor: #f6f6f6;
--theme-text-field-color: var(--body-color);
--theme-text-field-placeholder-color: #a9a9b1;
--team-row-active: #3f434a;
--team-row-active: #163e58; /* the dark version of --primary-accent-dimmed */
--timing-container: var(--theme-base-85);
--timing-container-selected-row: #94d9fd;
--tooltip-bgcolor: #38383d;
--tooltip-color: white;
--tooltip-border: 1px solid transparent;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/Library/Library.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
}

:root:global(.theme-dark) .libraryRowSelected {
background-color: #14243e;
background-color: var(--primary-accent-dimmed);
}

:root:global(.theme-dark) .libraryRowSelected:hover {
background-color: #162641;
background-color: var(--primary-accent-dimmed);
}

:root:global(.theme-dark) .teamRow:hover,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/Library/Navigation/TeamButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function TeamButton({
href={url}
className={classNames(
`${styles.teamRow} group flex flex-row justify-between space-x-2 px-4 py-2 text-left transition duration-200 hover:text-white focus:outline-none`,
isSelected ? `${styles.teamRowActive} cursor-auto font-bold` : "cursor-pointer"
isSelected ? `${styles.teamRowActive} cursor-auto` : "cursor-pointer"
)}
onClick={onClick}
>
Expand Down
22 changes: 10 additions & 12 deletions src/ui/components/NetworkMonitor/NetworkMonitorListRow.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
.Row[data-selected],
.Row[data-selected]:focus,
.Row[data-selected]:hover {
background: var(--primary-accent-hover);
color: var(--primary-accent-foreground-text);
background: var(--primary-accent-dimmed);
color: var(--primary-accent-dimmed-foreground-text);

--status-color: var(--primary-accent-foreground-text);
--status-color: var(--primary-accent-dimmed-foreground-text);
}

/* These styles should stay in sync with NetworkMonitorListHeader */
Expand Down Expand Up @@ -87,7 +87,7 @@
align-items: center;
gap: 1ch;

background: linear-gradient(0deg, var(--primary-accent) 0, var(--primary-accent) 100%);
background: var(--background-color-primary-button);
color: #fff;
font-weight: bold;
}
Expand All @@ -97,11 +97,6 @@
}
.SeekButton:focus,
.SeekButton:hover {
background: linear-gradient(
0deg,
var(--primary-accent-hover) 0,
var(--primary-accent-hover) 100%
);
outline: none;
}

Expand All @@ -126,10 +121,11 @@
position: relative;
height: 0.8rem;
border-radius: 3px;
background-color: var(--chrome);
background-color: var(--timing-container);
margin-right: 1ch;
overflow: hidden;
}

.TimingContainer[data-incomplete] {
opacity: 0.65;
}
Expand All @@ -141,6 +137,8 @@
min-width: 1px;
}

.Row:hover .TimingContainer {
background-color: var(--body-bgcolor);
.Row[data-selected] .TimingContainer,
.Row[data-selected]:focus .TimingContainer,
.Row[data-selected]:hover .TimingContainer {
background-color: var(--timing-container-selected-row);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
padding-left: calc(var(--data-depth) * var(--indentation-size));
}
.Row[data-selected] {
background-color: var(--theme-selection-background);
}
.Row[data-selected] .ElementKey,
.Row[data-selected] .ElementName,
.Row[data-selected] .Icon {
color: var(--theme-selection-color);
fill: var(--theme-selection-color);
background-color: var(--primary-accent-dimmed);
color: var(--value-type-html-tag);
}

.Row[data-selected] .ElementKey {
background: var(--background-color-current-execution-point-column);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
opacity: 1;
}
.ListItem[data-selected] {
background-color: var(--theme-selection-background);
color: var(--theme-selection-color);
background-color: var(--primary-accent-dimmed);
color: var(--body-color);
opacity: 1;
}

Expand Down

1 comment on commit d61a0a9

@vercel
Copy link

@vercel vercel bot commented on d61a0a9 Nov 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

devtools – ./

devtools-recordreplay.vercel.app
devtools-git-main-recordreplay.vercel.app
app.replay.io

Please sign in to comment.