From e869f9a47a2d45395366323b67e06963a28d7fb3 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Sun, 24 Apr 2022 22:09:58 +0800 Subject: [PATCH] fix: fix pre-commit hook --- package.json | 2 +- .../document/version/index.module.scss | 18 +++++++------- .../components/wiki/tocs/index.module.scss | 2 +- packages/client/src/styles/globals.scss | 2 +- .../color-picker/style.module.scss | 14 +++++------ packages/client/src/tiptap/styles/base.scss | 24 +++++++++++++------ packages/client/src/tiptap/styles/code.scss | 4 ++-- .../client/src/tiptap/styles/mention.scss | 2 +- packages/client/src/tiptap/styles/node.scss | 5 ++-- .../client/src/tiptap/styles/selection.scss | 11 +++++---- packages/client/src/tiptap/styles/table.scss | 15 ++++-------- packages/client/src/tiptap/styles/var.scss | 9 ++++--- .../attachment/player/index.module.scss | 4 ++-- .../player/pdf-player/index.module.scss | 4 ++-- .../tiptap/wrappers/banner/index.module.scss | 2 +- .../wrappers/code-block/index.module.scss | 2 +- .../wrappers/countdown/index.module.scss | 3 +-- .../document-children/index.module.scss | 2 +- .../document-reference/index.module.scss | 2 +- .../tiptap/wrappers/iframe/index.module.scss | 2 +- 20 files changed, 69 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index 4751c80..31b3e2a 100644 --- a/package.json +++ b/package.json @@ -45,5 +45,5 @@ "stylelint-prettier": "^2.0.0", "typescript": "^4.5.5" }, - "pre-commit": "lint" + "pre-commit": "format" } \ No newline at end of file diff --git a/packages/client/src/components/document/version/index.module.scss b/packages/client/src/components/document/version/index.module.scss index 26773c0..0df60de 100644 --- a/packages/client/src/components/document/version/index.module.scss +++ b/packages/client/src/components/document/version/index.module.scss @@ -1,11 +1,11 @@ .headerWrap { - margin: 0 -24px; position: relative; z-index: 1000; display: flex; + padding: 12px 24px; + margin: 0 -24px; justify-content: space-between; align-items: center; - padding: 12px 24px; border-bottom: 1px solid var(--semi-color-border); > div { @@ -16,9 +16,9 @@ } .contentWrap { - margin: 0 -24px; - height: calc(100vh - 56px); display: flex; + height: calc(100vh - 56px); + margin: 0 -24px; flex-wrap: nowrap; > aside { @@ -30,18 +30,18 @@ overflow: auto; > ul { - margin: 0; padding: 0; + margin: 0; list-style: none; > li { width: 100%; padding: 12px 16px; - color: var(--semi-color-text-0); font-size: 14px; - border-radius: var(--semi-border-radius-small); + color: var(--semi-color-text-0); text-align: center; cursor: pointer; + border-radius: var(--semi-border-radius-small); &:hover { background-color: var(--semi-color-primary-light-default); @@ -56,10 +56,10 @@ } > main { - flex: 1; - background-color: var(--semi-color-nav-bg); padding: 24px 0; overflow: auto; + background-color: var(--semi-color-nav-bg); + flex: 1; .editorWrap { min-height: 100%; diff --git a/packages/client/src/components/wiki/tocs/index.module.scss b/packages/client/src/components/wiki/tocs/index.module.scss index 952e7b6..8fdd25a 100644 --- a/packages/client/src/components/wiki/tocs/index.module.scss +++ b/packages/client/src/components/wiki/tocs/index.module.scss @@ -103,5 +103,5 @@ } .docListTitle { - margin: 12px 0.5rem; + margin: 12px .5rem; } diff --git a/packages/client/src/styles/globals.scss b/packages/client/src/styles/globals.scss index 21c6581..0638c01 100644 --- a/packages/client/src/styles/globals.scss +++ b/packages/client/src/styles/globals.scss @@ -27,7 +27,7 @@ .Resizer { z-index: 1; - opacity: 0.2; + opacity: .2; box-sizing: border-box; background-clip: padding; } diff --git a/packages/client/src/tiptap/menus/_components/color-picker/style.module.scss b/packages/client/src/tiptap/menus/_components/color-picker/style.module.scss index 7b9b6f7..336c2dc 100644 --- a/packages/client/src/tiptap/menus/_components/color-picker/style.module.scss +++ b/packages/client/src/tiptap/menus/_components/color-picker/style.module.scss @@ -10,23 +10,23 @@ > span:first-child { position: relative; + display: block; width: 18px; height: 18px; - display: block; - border-radius: 2px 2px; - border: 1px solid #e8e8e8; margin-right: 8px; + border: 1px solid #e8e8e8; + border-radius: 2px; &::after { - content: ''; - display: block; position: absolute; top: 8px; - left: 0px; + left: 0; + display: block; width: 17px; height: 0; - border-bottom: 2px solid #ff5151; + content: ''; transform: rotate(45deg); + border-bottom: 2px solid #ff5151; } } } diff --git a/packages/client/src/tiptap/styles/base.scss b/packages/client/src/tiptap/styles/base.scss index f92c28d..29e4c3d 100644 --- a/packages/client/src/tiptap/styles/base.scss +++ b/packages/client/src/tiptap/styles/base.scss @@ -1,8 +1,18 @@ .ProseMirror { - font-family: 'Chinese Quote', 'Segoe UI', Roboto, RobotoNum, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', - 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-family: + 'Chinese Quote', + 'Segoe UI', + Roboto, + RobotoNum, + 'PingFang SC', + 'Hiragino Sans GB', + 'Microsoft YaHei', + 'Helvetica Neue', + Helvetica, + Arial, + sans-serif; line-height: 1.74; - letter-spacing: 0.008em; + letter-spacing: .008em; color: var(--semi-color-text-0); word-break: break-word; word-wrap: break-word; @@ -24,19 +34,19 @@ } p { - margin-top: 0.75rem; + margin-top: .75rem; margin-bottom: 0; font-size: 1em; font-weight: normal; line-height: 1.714; - letter-spacing: -0.005em; + letter-spacing: -.005em; } blockquote { box-sizing: border-box; padding-left: 10px; border-left: 2px solid var(--semi-color-fill-2); - margin: 0.75rem 0; + margin: .75rem 0; } hr { @@ -74,7 +84,7 @@ body[theme-mode='dark'] { .ProseMirror { img { - opacity: 0.75; + opacity: .75; } } } diff --git a/packages/client/src/tiptap/styles/code.scss b/packages/client/src/tiptap/styles/code.scss index 830ba53..4388f9f 100644 --- a/packages/client/src/tiptap/styles/code.scss +++ b/packages/client/src/tiptap/styles/code.scss @@ -2,7 +2,7 @@ code { padding: 4px; font-family: Consolas, Menlo, Courier, monospace; - font-size: 0.875rem; + font-size: .875rem; line-height: 1.3; cursor: text; background-color: var(--semi-color-fill-1); @@ -25,7 +25,7 @@ padding: 0; margin: 8px; overflow: auto; - font-size: 0.875rem; + font-size: .875rem; line-height: 1.5rem; color: inherit; white-space: pre; diff --git a/packages/client/src/tiptap/styles/mention.scss b/packages/client/src/tiptap/styles/mention.scss index 9a658af..202900e 100644 --- a/packages/client/src/tiptap/styles/mention.scss +++ b/packages/client/src/tiptap/styles/mention.scss @@ -1,6 +1,6 @@ .mention { - color: #fff; padding: 2px 6px; + color: #fff; background-color: var(--semi-color-primary); border: 1px solid var(--semi-color-border); border-radius: 999em; diff --git a/packages/client/src/tiptap/styles/node.scss b/packages/client/src/tiptap/styles/node.scss index 9de6abd..128f172 100644 --- a/packages/client/src/tiptap/styles/node.scss +++ b/packages/client/src/tiptap/styles/node.scss @@ -1,4 +1,5 @@ /* 自定义节点样式 */ +/* stylelint-disable */ .ProseMirror { .node-status { margin-right: 4px; @@ -63,12 +64,12 @@ &:active { &::after { position: absolute; - content: ''; - inset: 0; pointer-events: none; background-color: transparent; border: 1px solid var(--node-hover-border-color) !important; border-radius: var(--border-radius); + content: ''; + inset: 0; } } } diff --git a/packages/client/src/tiptap/styles/selection.scss b/packages/client/src/tiptap/styles/selection.scss index 987aa31..458398e 100644 --- a/packages/client/src/tiptap/styles/selection.scss +++ b/packages/client/src/tiptap/styles/selection.scss @@ -1,3 +1,4 @@ +/* stylelint-disable */ .ProseMirror { hr.selected-node { background-color: var(--node-selected-border-color); @@ -48,10 +49,10 @@ &::after { position: absolute; + pointer-events: none; + background-color: rgb(179 212 255 / 30%); content: ''; inset: 0; - pointer-events: none; - background-color: rgba(179, 212, 255, 0.3); } } } @@ -70,12 +71,12 @@ &::after { position: absolute; - content: ''; - inset: 0; pointer-events: none; - background-color: rgba(179, 212, 255, 0.3); + background-color: rgb(179 212 255 / 30%); border: 1px solid var(--node-selected-border-color) !important; border-radius: var(--border-radius); + content: ''; + inset: 0; } } } diff --git a/packages/client/src/tiptap/styles/table.scss b/packages/client/src/tiptap/styles/table.scss index caa5e70..b28b326 100644 --- a/packages/client/src/tiptap/styles/table.scss +++ b/packages/client/src/tiptap/styles/table.scss @@ -1,15 +1,15 @@ .ProseMirror { .tableWrapper { - margin: 0; padding: 0; + margin: 0; } table { - border-collapse: collapse; - overflow: hidden; - table-layout: fixed; width: 100%; margin: 0.75em 0 0; + overflow: hidden; + border-collapse: collapse; + table-layout: fixed; td, th { @@ -55,12 +55,7 @@ } } -.tableWrapper { - padding: 1rem 0; - overflow-x: auto; -} - .resize-cursor { cursor: ew-resize; - cursor: col-resize; + cursor: col-resize; /* stylelint-disable declaration-block-no-duplicate-properties */ } diff --git a/packages/client/src/tiptap/styles/var.scss b/packages/client/src/tiptap/styles/var.scss index 60cea85..782f007 100644 --- a/packages/client/src/tiptap/styles/var.scss +++ b/packages/client/src/tiptap/styles/var.scss @@ -1,17 +1,20 @@ .ProseMirror { - --node-text-color: rgba(3, 3, 3, 0.8); + --node-text-color: rgb(3 3 3 / 80%); --node-hover-text-color: rgb(0 101 255); + /* 自定义节点 边框 */ --node-border-color: rgb(28 31 35 / 8%); + /* 自定义节点 hover */ --node-hover-border-color: rgb(0 101 255); + /* 自定义节点选中 */ --node-selected-border-color: rgb(0 101 255); } body[theme-mode='dark'] { .ProseMirror { - --node-text-color: rgba(249, 249, 249, 0.8); - --node-border-color: rgb(255, 255, 255, 0.08); + --node-text-color: rgb(249 249 249 / 80%); + --node-border-color: rgb(255 255 255 / 8%); } } diff --git a/packages/client/src/tiptap/wrappers/attachment/player/index.module.scss b/packages/client/src/tiptap/wrappers/attachment/player/index.module.scss index a5d6407..c04d2a6 100644 --- a/packages/client/src/tiptap/wrappers/attachment/player/index.module.scss +++ b/packages/client/src/tiptap/wrappers/attachment/player/index.module.scss @@ -1,9 +1,9 @@ .playerWrap { - width: 100%; display: flex; + width: 100%; + padding: 12px; justify-content: center; border-top: 1px solid var(--node-border-color); - padding: 12px; > video { width: 100%; diff --git a/packages/client/src/tiptap/wrappers/attachment/player/pdf-player/index.module.scss b/packages/client/src/tiptap/wrappers/attachment/player/pdf-player/index.module.scss index 03c96e3..2e9d9a0 100644 --- a/packages/client/src/tiptap/wrappers/attachment/player/pdf-player/index.module.scss +++ b/packages/client/src/tiptap/wrappers/attachment/player/pdf-player/index.module.scss @@ -18,8 +18,8 @@ } .react-pdf__Page canvas { - max-width: 100%; height: auto !important; + max-width: 100%; } .react-pdf__message { @@ -29,9 +29,9 @@ } .paginationWrap { + display: flex; margin-top: 1em; text-align: center; - display: flex; justify-content: center; } } diff --git a/packages/client/src/tiptap/wrappers/banner/index.module.scss b/packages/client/src/tiptap/wrappers/banner/index.module.scss index 3794e0d..7f2823b 100644 --- a/packages/client/src/tiptap/wrappers/banner/index.module.scss +++ b/packages/client/src/tiptap/wrappers/banner/index.module.scss @@ -4,7 +4,7 @@ border-radius: var(--border-radius); p { - margin-top: 0.25em; + margin-top: .25em; } p:first-child { diff --git a/packages/client/src/tiptap/wrappers/code-block/index.module.scss b/packages/client/src/tiptap/wrappers/code-block/index.module.scss index e29551c..0adb894 100644 --- a/packages/client/src/tiptap/wrappers/code-block/index.module.scss +++ b/packages/client/src/tiptap/wrappers/code-block/index.module.scss @@ -1,6 +1,6 @@ .wrap { position: relative; - margin-top: 0.75em; + margin-top: .75em; .handleWrap { display: flex; diff --git a/packages/client/src/tiptap/wrappers/countdown/index.module.scss b/packages/client/src/tiptap/wrappers/countdown/index.module.scss index dd38f9b..4a946ac 100644 --- a/packages/client/src/tiptap/wrappers/countdown/index.module.scss +++ b/packages/client/src/tiptap/wrappers/countdown/index.module.scss @@ -1,12 +1,11 @@ .wrap { + display: flex; height: 96px; overflow: hidden; line-height: 0; background-color: var(--semi-color-fill-0); border: 1px solid var(--node-border-color); border-radius: var(--border-radius); - - display: flex; align-items: center; justify-content: center; flex-direction: column; diff --git a/packages/client/src/tiptap/wrappers/document-children/index.module.scss b/packages/client/src/tiptap/wrappers/document-children/index.module.scss index 23de4dd..0c2e9ec 100644 --- a/packages/client/src/tiptap/wrappers/document-children/index.module.scss +++ b/packages/client/src/tiptap/wrappers/document-children/index.module.scss @@ -1,6 +1,6 @@ .wrap { padding: 12px; - margin-top: 0.75em; + margin-top: .75em; border: 1px solid var(--node-border-color); border-radius: var(--border-radius); diff --git a/packages/client/src/tiptap/wrappers/document-reference/index.module.scss b/packages/client/src/tiptap/wrappers/document-reference/index.module.scss index 38042ef..f2656cd 100644 --- a/packages/client/src/tiptap/wrappers/document-reference/index.module.scss +++ b/packages/client/src/tiptap/wrappers/document-reference/index.module.scss @@ -1,5 +1,5 @@ .wrap { - margin-top: 0.75em; + margin-top: .75em; border-radius: var(--border-radius); .itemWrap { diff --git a/packages/client/src/tiptap/wrappers/iframe/index.module.scss b/packages/client/src/tiptap/wrappers/iframe/index.module.scss index 60554b8..0d03ae4 100644 --- a/packages/client/src/tiptap/wrappers/iframe/index.module.scss +++ b/packages/client/src/tiptap/wrappers/iframe/index.module.scss @@ -23,8 +23,8 @@ } .emptyWrap { - height: 100%; display: flex; + height: 100%; justify-content: center; align-items: center; }