summaryrefslogtreecommitdiff
path: root/web/src/components/grid/index.css
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-10-29 01:54:37 +0200
committerJosh Kingsley <josh@joshkingsley.me>2025-10-29 01:54:37 +0200
commit986e65f9ab7122995ae1d647df23d817cecf6816 (patch)
tree39d4f77c6a6565b59522a5a77e2f550334472713 /web/src/components/grid/index.css
parent95069f13d908bfd3c0f3b33f8fad7d8464fd192e (diff)
refactor(web): improve state management
Diffstat (limited to 'web/src/components/grid/index.css')
-rw-r--r--web/src/components/grid/index.css73
1 files changed, 44 insertions, 29 deletions
diff --git a/web/src/components/grid/index.css b/web/src/components/grid/index.css
index 93d6f6f..64153ed 100644
--- a/web/src/components/grid/index.css
+++ b/web/src/components/grid/index.css
@@ -1,34 +1,49 @@
-ntv-grid {
- display: block;
- position: relative;
+@layer components {
+ ntv-grid {
+ display: block;
+ position: relative;
- --grid-bg-fill: var(--color-neutral-900);
- --grid-border-stroke: var(--color-neutral-700);
- --grid-cell-stroke: var(--color-neutral-800);
- --grid-active-cell-stroke: var(--color-green-400);
- --grid-selection-range-fill: color-mix(
- in oklab,
- var(--color-green-400) 10%,
- transparent
- );
- --grid-selection-range-stroke: var(--color-green-400);
- font-size: 14px;
-}
+ --grid-bg-fill: var(--color-neutral-900);
+ --grid-border-stroke: var(--color-neutral-700);
+ --grid-cell-stroke: var(--color-neutral-800);
+ --grid-active-cell-stroke: var(--color-green-400);
+ --grid-selection-range-fill: color-mix(
+ in oklab,
+ var(--color-green-400) 10%,
+ transparent
+ );
+ --grid-selection-range-stroke: var(--color-green-400);
+ font-size: 14px;
+ }
-ntv-grid > canvas {
- display: block;
-}
+ ntv-grid > canvas {
+ display: block;
+ }
-ntv-grid input[data-edit-cell] {
- position: absolute;
- vertical-align: baseline;
- background: var(--color-neutral-800);
- padding-right: 1px;
- padding-bottom: 1px;
- color: white;
- text-align: center;
-}
+ ntv-grid > canvas[data-selection] {
+ position: absolute;
+ top: 0;
+ left: 0;
+ pointer-events: none;
+ }
+
+ :has(ntv-grid:state(selecting))
+ > ntv-grid:not(:state(selecting))
+ > canvas[data-selection] {
+ display: none;
+ }
+
+ ntv-grid input[data-edit-cell] {
+ position: absolute;
+ vertical-align: baseline;
+ background: var(--color-neutral-800);
+ padding-right: 1px;
+ padding-bottom: 1px;
+ color: white;
+ text-align: center;
+ }
-ntv-grid input[data-edit-cell]:focus-visible {
- outline: none;
+ ntv-grid input[data-edit-cell]:focus-visible {
+ outline: none;
+ }
}