From 82c8c3fe90182d44e75e19f9c5967c829cbb5e7a Mon Sep 17 00:00:00 2001 From: redhoodsu Date: Fri, 15 Nov 2024 12:09:20 +0800 Subject: [PATCH] fix(data-grid): hover style --- src/data-grid/index.ts | 1 + src/data-grid/style.scss | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/data-grid/index.ts b/src/data-grid/index.ts index fb2b3fe..dcd57e6 100644 --- a/src/data-grid/index.ts +++ b/src/data-grid/index.ts @@ -599,6 +599,7 @@ export class DataGridNode { this.data = data if (options.selectable) { this.selectable = options.selectable + this.$container.addClass(dataGrid.c('selectable')) } this.render() diff --git a/src/data-grid/style.scss b/src/data-grid/style.scss index 0cf7d36..076f0e5 100644 --- a/src/data-grid/style.scss +++ b/src/data-grid/style.scss @@ -38,10 +38,10 @@ background: theme.$color-fill-secondary; position: relative; &.sortable { - padding-right: theme.$padding-s-m; + padding-right: #{theme.$padding-s-m}px; &:hover, &:active { - background: #e6e6e6; + background: theme.$color-fill; } } .icon-caret-down, @@ -61,15 +61,15 @@ } &:focus { - .node.selected { + .node.selectable.selected { color: #fff; - background: #1a73e8; + background: theme.$color-primary; } } &:focus.theme-dark { - .node.selected { - background: #0e639c; + .node.selectable.selected { + background: theme.$color-primary-dark; } } } @@ -85,7 +85,8 @@ .data-container { overflow-y: auto; - .node.selected { + .node.selected, + .node.selectable:hover { background: #ddd; } tr:nth-child(even) { @@ -126,12 +127,13 @@ background: theme.$color-fill-secondary-dark; &.sortable { &:hover { - background: #303030; + background: theme.$color-fill-dark; } } } .data-container { - .node.selected { + .node.selected, + .node.selectable:hover { background: #393939; } tr:nth-child(even) {