Skip to content

Commit

Permalink
💄 style(dark-mode): 初步完成工作台深色模式
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 22, 2021
1 parent f0028cb commit 9e85141
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/contentScripts/darkMode/darkMode/dashboard/index.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import '~theme/index';
@import 'sidebar';
@import 'main';
@import 'right';
24 changes: 24 additions & 0 deletions src/contentScripts/darkMode/darkMode/dashboard/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,27 @@
[class*='Layout-module_main'] {
.dark-mode-background-base;
}

[class*='Recent-module_recentTab'] a {
.dark-mode-text-color-base;
&:hover {
.dark-mode-text-color-base-hover;
}
} // 表头
[class*='Recent-module_active'] a {
.dark-mode-text-color-base;
}
// 主表

[class*='Recent-module_title'] {
.dark-mode-text-color-base;
}

[class*='Recent-module_filterItem'] {
.ant-dropdown-open {
.dark-mode-background-light;
}
}
[class*='Recent-module_activeFilterItem'] span {
.dark-mode-background-light;
}
63 changes: 63 additions & 0 deletions src/contentScripts/darkMode/darkMode/dashboard/right.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@import '~theme/index';

// 创建文档
[class*='GlobalDocCreate-module_title'] {
.dark-mode-text-color-base;
}
[class*='GlobalBookSelector-module_bookSelectorItem'] {
.dark-mode-border-bottom-color-light;
&:hover {
.dark-mode-background-base-hover;
}
}

// honor 组件
[class*='Honor-module_wrapper'] {
.ant-card-body {
.dark-mode-background-dark;
}
[class*='Honor-module_value'] {
.dark-mode-text-color-base;
}
[class*='badge-module_memberBadgeDesc'] {
.dark-mode-text-color-second;
}
[class*='badge-module_memberBadgeName'] {
.dark-mode-text-color-emphasize;
}

[class*='Honor-module_thumb'] {
background-image: url('https://gw.alipayobjects.com/zos/antfincdn/St2yCYb%24ym/img.png') !important;
opacity: 0.2;
}

[class*='Honor-module_item']::before {
.dark-mode-background-light;
}
}

// 快捷入口
[class*='QuickLink-module_quicklink'] {
.ant-card-body {
.dark-mode-background-base;
}

[class*='LinkList-module_title'] {
.dark-mode-text-color-base;
}
[class*='LinkList-module_linkItem'] {
&:hover {
.dark-mode-background-light;
}

[class*='LinkList-module_action'] {
.dark-mode-background-light;

[class*='QuickLink-module_icon'] {
&:hover {
.dark-mode-text-color-base-hover;
}
}
}
}
}
2 changes: 0 additions & 2 deletions src/contentScripts/darkMode/darkMode/global/card.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
.larkui-card {
.dark-mode-card-base;
}


3 changes: 3 additions & 0 deletions src/contentScripts/darkMode/darkMode/global/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
@import 'card';
@import 'image';
@import 'input';
@import 'table';
@import 'menu';
@import 'modal';
42 changes: 42 additions & 0 deletions src/contentScripts/darkMode/darkMode/global/menu.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@import '~theme/index';

.ant-menu {
.ant-menu-item {
.dark-mode-background-base;
}
}

// 下拉菜单
.ant-dropdown-menu {
.dark-mode-background-light;

.ant-dropdown-menu-item,
.ant-dropdown-menu-submenu-title {
.dark-mode-text-color-base;
&:hover {
.dark-mode-background-lighter;
}
}
}
// 级联菜单
.ant-cascader-menu,
.ant-cascader-menus {
.dark-mode-background-light;

.ant-cascader-menu-item {
.dark-mode-text-color-base;
&:hover {
.dark-mode-background-lighter;
}
}

.ant-cascader-menu-item-active {
.dark-mode-background-lighter;
}
}

.ant-cascader-menus {
.ant-cascader-menu:not(:last-child) {
border-right-color: @dark-mode-border-color-light !important;
}
}
12 changes: 12 additions & 0 deletions src/contentScripts/darkMode/darkMode/global/modal.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '~theme/index';

// 基础卡片
.ant-modal-content,
.ant-modal-header {
.dark-mode-background-base;
.dark-mode-border-bottom-color-light;
}

.ant-modal-title {
.dark-mode-text-color-base;
}
27 changes: 27 additions & 0 deletions src/contentScripts/darkMode/darkMode/global/table.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@import '~theme/index';

// 表格
.ant-table {
.dark-mode-background-base;
.ant-table-tbody > tr > td {
border-bottom-color: @dark-mode-border-color-light;
}

.ant-table-row:hover {
.dark-mode-background-light;
> td {
.dark-mode-background-light;
}
}

.ant-table-placeholder:hover > td {
.dark-mode-background-light;
}

.ant-table-thead > tr > th {
.dark-mode-background-base;
.dark-mode-text-color-base;

border-bottom-color: @dark-mode-border-color-light;
}
}
5 changes: 5 additions & 0 deletions src/theme/style/background.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
background: @dark-mode-background-base !important;
}

.dark-mode-background-base-hover {
background: @dark-mode-background-base-hover !important;
}

.dark-mode-background-light {
background: @dark-mode-background-light !important;
}

.dark-mode-background-lighter {
background: @dark-mode-background-lighter !important;
}
Expand Down
9 changes: 9 additions & 0 deletions src/theme/style/border.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../token/index';

.dark-mode-border-color-light {
border-color: @dark-mode-border-color-light !important;
}

.dark-mode-border-bottom-color-light {
border-bottom-color: @dark-mode-border-color-light !important;
}
2 changes: 2 additions & 0 deletions src/theme/style/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import 'background';
@import 'text';
@import 'border';
@import 'image';
@import 'button';

@import 'card';

@import 'search-bar';
4 changes: 4 additions & 0 deletions src/theme/style/text.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@import '../token/index';
.dark-mode-text-color-emphasize {
color: @dark-mode-text-color-emphasize !important;
}

.dark-mode-text-color-base {
color: @dark-mode-text-color-base !important;
}
Expand Down
1 change: 1 addition & 0 deletions src/theme/token/dark-mode.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@base-hue: 240;

@dark-mode-background-base: hsl(@base-hue, @base-tone, 15%);
@dark-mode-background-base-hover: hsl(@base-hue, @base-tone, 17%);
// 面板
@dark-mode-background-lighter: hsl(@base-hue, @base-tone, 22%);
@dark-mode-background-lighter-hover: hsl(@base-hue, @base-tone, 28%);
Expand Down

0 comments on commit 9e85141

Please sign in to comment.