Skip to content

Commit

Permalink
Replace static colors with VSCode CSS variables (#1682)
Browse files Browse the repository at this point in the history
* Remove light colors

* Replace most colors with VSCode variable equivalents

Co-authored-by: mattseddon <37993418+mattseddon@users.noreply.github.com>
  • Loading branch information
rogermparent and mattseddon authored May 11, 2022
1 parent b7871d7 commit bd08a53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 77 deletions.
72 changes: 9 additions & 63 deletions webview/src/experiments/components/table/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,14 @@ $edge-padding: 0.8rem;
$cell-padding: 0.5rem;
$workspace-row-edge-margin: $edge-padding - $cell-padding;

// Dark Theme

$row-bg-alt-color: var(--vscode-sideBar-background);
$header-bg-color: #303031;
$meta-cell-color: #a0a0a0;
$toggle-color: rgba(255, 255, 255, 0.21);
$spinner-color: rgb(255, 255, 255);
$metrics-color: #fbd38d;
$params-color: #90cdf4;

// Light theme

$header-bg-color-light: #e1e1e1;
$border-color-light: #7f7f7f;
$metrics-color-light: #ce9f4c;
$params-color-light: #76add1;
$toggle-color-light: rgba(0, 0, 0, 0.21);
$spinner-color-light: #000;
$row-bg-alt-color: var(--vscode-sideBar-background);
$header-bg-color: var(--vscode-dropdown-background);
$meta-cell-color: var(--vscode-descriptionForeground);
$changed-color: var(--vscode-gitDecoration-modifiedResourceForeground);

// Extendable Silent Rules

%expandableRowArrow {
width: 8px;
height: 8px;
Expand All @@ -45,10 +32,6 @@ $spinner-color-light: #000;
border-left: unset;
transition: transform 0.2s, right 0.2s, bottom 0.2s;
margin: 12px 6px;

:global(.vscode-light) & {
border-color: $toggle-color-light;
}
}

%truncateLeftParent {
Expand Down Expand Up @@ -118,11 +101,7 @@ $spinner-color-light: #000;
}

.workspaceWithChanges.normalExperiment & {
background-color: $metrics-color;

:global(.vscode-light) & {
background-color: $metrics-color-light;
}
background-color: $changed-color;
}

.unselectedExperiment & {
Expand All @@ -138,11 +117,7 @@ $spinner-color-light: #000;
}

.workspaceWithChanges.unselectedExperiment & {
border: 1px solid $metrics-color;

:global(.vscode-light) & {
border: 1px solid $metrics-color-light;
}
border: 1px solid $changed-color;
}

.queuedExperiment & {
Expand All @@ -158,26 +133,13 @@ $spinner-color-light: #000;
border-top: 1.5px solid currentColor;
animation: spin 1s cubic-bezier(0.53, 0.21, 0.29, 0.67) infinite;
background-color: $bg-color;

@at-root {
:global(.vscode-light) & {
border-right-color: $spinner-color-light;
border-top-color: $spinner-color-light;
}
}
}
.runningExperiment.oddRow & {
background-color: $row-bg-alt-color;
}
.workspaceWithChanges.runningExperiment & {
border-right-color: $metrics-color;
border-top-color: $metrics-color;
@at-root {
:global(.vscode-light) & {
border-right-color: $metrics-color-light;
border-top-color: $metrics-color-light;
}
}
border-right-color: $changed-color;
border-top-color: $changed-color;
}

.runningExperiment.oddRow > .firstCell & {
Expand Down Expand Up @@ -305,19 +267,11 @@ $spinner-color-light: #000;
.paramHeaderCell,
&.paramHeaderCell {
color: $params-color;

:global(.vscode-light) & {
color: $params-color-light;
}
}

.metricHeaderCell,
&.metricHeaderCell {
color: $metrics-color;

:global(.vscode-light) & {
color: $metrics-color-light;
}
}
}

Expand Down Expand Up @@ -384,11 +338,7 @@ $spinner-color-light: #000;
}

.workspaceChange {
color: $metrics-color;

:global(.vscode-light) & {
color: $metrics-color-light;
}
color: $changed-color;
}

.td,
Expand Down Expand Up @@ -423,10 +373,6 @@ $spinner-color-light: #000;
.placeholderHeaderCell {
background-color: $header-bg-color;
border-right: 2px solid $bg-color;

:global(.vscode-light) & {
background-color: $header-bg-color-light;
}
}

.headerCell {
Expand Down
6 changes: 0 additions & 6 deletions webview/src/shared/components/emptyState/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,4 @@
opacity: 0.8;
letter-spacing: 0.04em;
color: $watermark-color;

@at-root {
:global(.vscode-light) & {
color: $watermark-color-light;
}
}
}
9 changes: 1 addition & 8 deletions webview/src/shared/variables.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
$fg-color: var(--vscode-editor-foreground);
$bg-color: var(--vscode-editor-background);
$bullet-size: 9px;

// Dark

$watermark-color: rgba(255, 255, 255, 0.6);

// Light

$watermark-color-light: rgba(0, 0, 0, 0.68);
$watermark-color: var(--vscode-descriptionForeground);

0 comments on commit bd08a53

Please sign in to comment.