-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(custom-block): 新增列表看板视图 | Add list kanban view.
- Loading branch information
1 parent
e997c55
commit 34eb771
Showing
10 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
workspace/plugins/custom-block/src/styles/custom-block-list-view-board.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Copyright (C) 2023 Zuoqiu Yingyi | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as | ||
// published by the Free Software Foundation, either version 3 of the | ||
// License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* 列表转看板 | ||
* REF [notion-theme/list2board.css](https://github.com/royc01/notion-theme/blob/main/style/list2board.css) | ||
*/ | ||
|
||
// 循环 | ||
// REF [Less 循环 - 知乎](https://zhuanlan.zhihu.com/p/192364861) | ||
.loop(@base, @i) when (@i > 0) { | ||
.loop(@base, (@i - 1)); // 递归调用自身 | ||
.board-background-color(e("@{base}n + @{i}"), @i); | ||
} | ||
|
||
// 字看板标题背景颜色 | ||
.board-background-color(@nth, @index) { | ||
&:nth-child(@{nth}) { | ||
>.protyle-action { | ||
// display: none; | ||
visibility: hidden; | ||
} | ||
|
||
>[data-node-id]:not(.list) { | ||
margin-left: 0 !important; | ||
border-radius: var(--custom-block-border-radius); | ||
background-color: var(e(%("--b3-font-background%d", @index))); | ||
} | ||
} | ||
} | ||
|
||
:root { | ||
&[plugin-custom-block~=list-view-board] { | ||
|
||
.b3-dialog__content, | ||
.protyle-content { | ||
|
||
[custom-block-list-view=board] { | ||
|
||
// 为列表块设置块属性 | ||
&, | ||
// 为文档块设置块属性 | ||
>[data-node-index] { | ||
&[data-node-id].list { | ||
/* 看板块样式 */ | ||
display: flex; | ||
overflow-x: auto; | ||
|
||
>[data-node-id].li { | ||
/* 子看板 */ | ||
min-width: var(--custom-block-list-board-min-width); | ||
margin-left: 0.25em; | ||
margin-right: 0.25em; | ||
|
||
&[fold="1"] { | ||
>[data-node-id]:not(.list) { | ||
outline: 2px dashed; | ||
} | ||
} | ||
|
||
.loop(12, 12); | ||
|
||
&::before { | ||
/* 子看板列表辅助线 */ | ||
content: unset; | ||
} | ||
|
||
>[data-node-id].list { | ||
/* 子看板内容 */ | ||
margin-left: 0 !important; | ||
padding-left: 0 !important; | ||
|
||
>[data-node-id].li { | ||
/* 子看板项 */ | ||
margin-top: 0.5em; | ||
border-radius: var(--custom-block-border-radius); | ||
background-color: var(--b3-font-background5); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters