Standardise usage of CSS variables to work inside client and builder

This commit is contained in:
Andrew Kingston 2023-06-14 09:19:11 +01:00
parent ed9065aae3
commit 328336463c
7 changed files with 22 additions and 20 deletions

View File

@ -138,7 +138,7 @@
top: 100%; top: 100%;
left: 0; left: 0;
width: 320px; width: 320px;
background: var(--background); background: var(--grid-background-alt);
border: var(--cell-border); border: var(--cell-border);
padding: var(--cell-padding); padding: var(--cell-padding);
box-shadow: 0 0 20px -4px rgba(0, 0, 0, 0.15); box-shadow: 0 0 20px -4px rgba(0, 0, 0, 0.15);

View File

@ -218,7 +218,7 @@
.header-cell :global(.cell) { .header-cell :global(.cell) {
padding: 0 var(--cell-padding); padding: 0 var(--cell-padding);
gap: calc(2 * var(--cell-spacing)); gap: calc(2 * var(--cell-spacing));
background: var(--spectrum-global-color-gray-100); background: var(--grid-background-alt);
} }
.name { .name {

View File

@ -240,7 +240,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: var(--cell-spacing); gap: var(--cell-spacing);
background-color: var(--background); background-color: var(--grid-background-alt);
} }
.option:hover, .option:hover,
.option.focused { .option.focused {

View File

@ -453,7 +453,7 @@
var(--max-cell-render-height) + var(--row-height) - var(--max-cell-render-height) + var(--row-height) -
var(--max-relationship-height) var(--max-relationship-height)
); );
background: var(--background); background: var(--grid-background-alt);
border: var(--cell-border); border: var(--cell-border);
box-shadow: 0 0 20px -4px rgba(0, 0, 0, 0.15); box-shadow: 0 0 20px -4px rgba(0, 0, 0, 0.15);
display: flex; display: flex;

View File

@ -168,6 +168,18 @@
<style> <style>
.grid { .grid {
/* Variables */
--grid-background: var(--spectrum-global-color-gray-50);
--grid-background-alt: var(--spectrum-global-color-gray-100);
--cell-background: var(--grid-background);
--cell-background-hover: var(--grid-background-alt);
--cell-background-alt: var(--cell-background);
--cell-padding: 8px;
--cell-spacing: 4px;
--cell-border: 1px solid var(--spectrum-global-color-gray-200);
--cell-font-size: 14px;
--controls-height: 50px;
flex: 1 1 auto; flex: 1 1 auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -175,17 +187,7 @@
align-items: stretch; align-items: stretch;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background: var(--cell-background); background: var(--grid-background);
/* Variables */
--cell-background: var(--spectrum-global-color-gray-50);
--cell-background-hover: var(--spectrum-global-color-gray-100);
--cell-background-alt: var(--cell-background);
--cell-padding: 8px;
--cell-spacing: 4px;
--cell-border: 1px solid var(--spectrum-global-color-gray-200);
--cell-font-size: 14px;
--controls-height: 50px;
} }
.grid, .grid,
.grid :global(*) { .grid :global(*) {
@ -234,7 +236,7 @@
border-bottom: 2px solid var(--spectrum-global-color-gray-200); border-bottom: 2px solid var(--spectrum-global-color-gray-200);
padding: var(--cell-padding); padding: var(--cell-padding);
gap: var(--cell-spacing); gap: var(--cell-spacing);
background: var(--spectrum-global-color-gray-100); background: var(--grid-background-alt);
z-index: 2; z-index: 2;
} }
.controls-left, .controls-left,
@ -270,7 +272,7 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: var(--spectrum-global-color-gray-100); background: var(--grid-background-alt);
opacity: 0.6; opacity: 0.6;
} }
</style> </style>

View File

@ -42,7 +42,7 @@
<style> <style>
.header { .header {
background: var(--background); background: var(--grid-background-alt);
border-bottom: var(--cell-border); border-bottom: var(--cell-border);
position: relative; position: relative;
height: var(--default-row-height); height: var(--default-row-height);
@ -60,7 +60,7 @@
border-left: var(--cell-border); border-left: var(--cell-border);
border-right: var(--cell-border); border-right: var(--cell-border);
border-bottom: var(--cell-border); border-bottom: var(--cell-border);
background: var(--spectrum-global-color-gray-100); background: var(--grid-background-alt);
z-index: 1; z-index: 1;
} }
.add:hover { .add:hover {

View File

@ -159,7 +159,7 @@
z-index: 1; z-index: 1;
} }
.header :global(.cell) { .header :global(.cell) {
background: var(--spectrum-global-color-gray-100); background: var(--grid-background-alt);
} }
.row { .row {
display: flex; display: flex;