From 8feb03ad502f0da9490dd04ed16e602c637bc3a8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 26 Nov 2024 20:17:49 +0800 Subject: [PATCH] :recycle: https://github.com/siyuan-note/siyuan/pull/13281 --- app/appearance/themes/daylight/theme.css | 2 +- app/appearance/themes/midnight/theme.css | 2 +- app/src/assets/scss/base.scss | 6 +-- app/src/assets/scss/business/_av.scss | 2 +- app/src/assets/scss/business/_export.scss | 2 +- app/src/assets/scss/business/_layout.scss | 16 +++---- app/src/assets/scss/business/_search.scss | 6 +-- app/src/assets/scss/component/_list.scss | 2 +- app/src/assets/scss/component/_snackbar.scss | 2 +- app/src/assets/scss/component/_switch.scss | 20 ++++---- app/src/assets/scss/component/_tooltips.scss | 4 +- .../assets/scss/component/_typography.scss | 4 +- app/src/assets/scss/pdf/_pdf.scss | 4 +- app/src/assets/scss/protyle/_protyle.scss | 6 +-- app/src/assets/scss/protyle/_wysiwyg.scss | 47 ++++++++----------- app/src/protyle/ui/initUI.ts | 2 +- app/src/util/assets.ts | 4 +- 17 files changed, 62 insertions(+), 69 deletions(-) diff --git a/app/appearance/themes/daylight/theme.css b/app/appearance/themes/daylight/theme.css index 19bd645e806..86dc7cb66e6 100644 --- a/app/appearance/themes/daylight/theme.css +++ b/app/appearance/themes/daylight/theme.css @@ -200,7 +200,7 @@ } /* https://github.com/siyuan-note/siyuan/issues/6440 */ -.protyle-action--order:after { +.protyle-action--order::after { mix-blend-mode: multiply; } diff --git a/app/appearance/themes/midnight/theme.css b/app/appearance/themes/midnight/theme.css index 2baa55cee5f..fbae409e936 100644 --- a/app/appearance/themes/midnight/theme.css +++ b/app/appearance/themes/midnight/theme.css @@ -199,7 +199,7 @@ } /* https://github.com/siyuan-note/siyuan/issues/6440 */ -.protyle-action--order:after { +.protyle-action--order::after { mix-blend-mode: screen; } diff --git a/app/src/assets/scss/base.scss b/app/src/assets/scss/base.scss index 2263476b94a..05f69431a0a 100644 --- a/app/src/assets/scss/base.scss +++ b/app/src/assets/scss/base.scss @@ -329,8 +329,8 @@ html { opacity: .38; } - .dragover__top:after, - .dragover__bottom:after { + .dragover__top::after, + .dragover__bottom::after { content: ""; width: var(--file-toggle-width); height: 4px; @@ -341,7 +341,7 @@ html { z-index: 1; } - .dragover__top:after { + .dragover__top::after { top: -3px; bottom: auto; } diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss index a4ff136961a..04b848411ea 100644 --- a/app/src/assets/scss/business/_av.scss +++ b/app/src/assets/scss/business/_av.scss @@ -29,7 +29,7 @@ background: var(--b3-border-color); border-radius: var(--b3-border-radius); - &:after { + &::after { content: " "; border-radius: var(--b3-border-radius); position: absolute; diff --git a/app/src/assets/scss/business/_export.scss b/app/src/assets/scss/business/_export.scss index 129ae9fc834..905d287647d 100644 --- a/app/src/assets/scss/business/_export.scss +++ b/app/src/assets/scss/business/_export.scss @@ -7,7 +7,7 @@ position: relative; z-index: 1; - [data-node-id].li[fold="1"] > .protyle-action:after { + [data-node-id].li[fold="1"] > .protyle-action::after { background-color: transparent; border: 1px solid var(--b3-list-hover); box-sizing: border-box; diff --git a/app/src/assets/scss/business/_layout.scss b/app/src/assets/scss/business/_layout.scss index eb3033003be..23df54d8d07 100644 --- a/app/src/assets/scss/business/_layout.scss +++ b/app/src/assets/scss/business/_layout.scss @@ -2,7 +2,7 @@ overflow-y: hidden; // https://github.com/siyuan-note/siyuan/issues/6706 &__wnd--active .layout-tab-bar .item--focus { - &:after { + &::after { background-color: var(--b3-theme-primary); } @@ -111,11 +111,11 @@ position: relative; z-index: 4; // 需大于 #sidebarContainer https://github.com/siyuan-note/siyuan/issues/11759 - &:hover:after { + &:hover::after { background-color: var(--b3-scroll-color); } - &:after { + &::after { content: ""; width: 100%; height: .5px; @@ -133,7 +133,7 @@ margin: 0 -6px 0 0; height: auto; - &:after { + &::after { top: 0; width: .5px; left: 0; @@ -226,7 +226,7 @@ max-width: none; flex: 1; - &.item--focus:after { + &.item--focus::after { background-color: var(--b3-theme-primary); } } @@ -268,7 +268,7 @@ } } - &--focus:after { + &--focus::after { content: ""; width: 100%; height: 3px; @@ -384,12 +384,12 @@ padding: 0; .dock__item { - &[data-index="0"]:after { + &[data-index="0"]::after { top: -32px; bottom: auto; } - &[data-index="1"]:after { + &[data-index="1"]::after { bottom: 100%; } } diff --git a/app/src/assets/scss/business/_search.scss b/app/src/assets/scss/business/_search.scss index 6bc6afbf118..ff0b34b86f4 100644 --- a/app/src/assets/scss/business/_search.scss +++ b/app/src/assets/scss/business/_search.scss @@ -24,7 +24,7 @@ margin: 0 -6px 0 0; height: auto; - &:after { + &::after { width: .5px; height: 100%; } @@ -104,7 +104,7 @@ position: relative; z-index: 2; - &:after { + &::after { content: ""; display: block; background-color: var(--b3-theme-surface-lighter); @@ -116,7 +116,7 @@ height: .5px; } - &:hover:after { + &:hover::after { background-color: var(--b3-scroll-color); } } diff --git a/app/src/assets/scss/component/_list.scss b/app/src/assets/scss/component/_list.scss index dbbd6af78e5..71e3a4cceca 100644 --- a/app/src/assets/scss/component/_list.scss +++ b/app/src/assets/scss/component/_list.scss @@ -27,7 +27,7 @@ position: relative; } - .b3-list__panel:before { + .b3-list__panel::before { content: ""; height: 100%; top: 0; diff --git a/app/src/assets/scss/component/_snackbar.scss b/app/src/assets/scss/component/_snackbar.scss index e4bcc8d69a7..b4edf402842 100644 --- a/app/src/assets/scss/component/_snackbar.scss +++ b/app/src/assets/scss/component/_snackbar.scss @@ -41,7 +41,7 @@ &--error .b3-snackbar__content { padding-left: 47px; - &:after { + &::after { content: "❗"; position: absolute; left: 16px; diff --git a/app/src/assets/scss/component/_switch.scss b/app/src/assets/scss/component/_switch.scss index cb5c8323c75..8eb76b0589f 100644 --- a/app/src/assets/scss/component/_switch.scss +++ b/app/src/assets/scss/component/_switch.scss @@ -24,7 +24,7 @@ align-self: center; } - &:after { + &::after { width: 8px; height: 8px; border-radius: 50%; @@ -40,7 +40,7 @@ transition: left 80ms linear, background-color 80ms linear, width 80ms linear, height 80ms linear; } - &:before { + &::before { z-index: 2; content: ""; left: 7px; @@ -59,28 +59,28 @@ background-color: var(--b3-switch-checked-background); border-color: transparent; - &:after { + &::after { background-color: var(--b3-switch-checked); height: 12px; width: 12px; } - &:before, - &:after { + &::before, + &::after { left: 17px; } &:hover:not(:disabled) { - &:after { + &::after { background-color: var(--b3-switch-checked-hover); } - &:before { + &::before { background-color: var(--b3-switch-checked-hover2); } } - &:active:not(:disabled):after { + &:active:not(:disabled)::after { height: 14px; width: 14px; } @@ -91,12 +91,12 @@ cursor: auto; } - &:active:not(:disabled):after { + &:active:not(:disabled)::after { height: 10px; width: 10px; } - &:hover:not(:disabled):before { + &:hover:not(:disabled)::before { display: inline-block; } } diff --git a/app/src/assets/scss/component/_tooltips.scss b/app/src/assets/scss/component/_tooltips.scss index 885479a1953..87b076b5f55 100644 --- a/app/src/assets/scss/component/_tooltips.scss +++ b/app/src/assets/scss/component/_tooltips.scss @@ -197,8 +197,8 @@ } @media screen and (max-width: 520px) { - .b3-tooltips:before, - .b3-tooltips:after { + .b3-tooltips::before, + .b3-tooltips::after { content: none; } } diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scss index 965c0c2c7e4..8ce3ee58864 100644 --- a/app/src/assets/scss/component/_typography.scss +++ b/app/src/assets/scss/component/_typography.scss @@ -123,7 +123,7 @@ blockquote, .bq { - &:before { + &::before { content: ''; background-color: var(--b3-theme-surface-lighter); width: .25em; @@ -345,7 +345,7 @@ display: flex; align-items: baseline; // https://ld246.com/article/1645933216334 - &:before { + &::before { content: ""; flex: 1; } diff --git a/app/src/assets/scss/pdf/_pdf.scss b/app/src/assets/scss/pdf/_pdf.scss index 6ff8135c5bf..c23adca27a9 100644 --- a/app/src/assets/scss/pdf/_pdf.scss +++ b/app/src/assets/scss/pdf/_pdf.scss @@ -234,7 +234,7 @@ cursor: ew-resize; right: -6px; - &:after { + &::after { content: ""; width: 1px; height: 100%; @@ -244,7 +244,7 @@ left: 3px; } - &:hover:after { + &:hover::after { background-color: var(--b3-scroll-color); } } diff --git a/app/src/assets/scss/protyle/_protyle.scss b/app/src/assets/scss/protyle/_protyle.scss index 38e8909551c..0555e245335 100644 --- a/app/src/assets/scss/protyle/_protyle.scss +++ b/app/src/assets/scss/protyle/_protyle.scss @@ -390,7 +390,7 @@ padding: 0 4px 0 2px; white-space: break-spaces; - &:empty:after { + &:empty::after { content: attr(data-tip); color: var(--b3-theme-on-surface-light); cursor: text; @@ -420,11 +420,11 @@ table[contenteditable="true"] + .protyle-action__table { cursor: col-resize; z-index: 2; - &:hover:after { + &:hover::after { background-color: var(--b3-theme-primary-light); } - &:after { + &::after { top: 0; width: 2px; left: 2px; diff --git a/app/src/assets/scss/protyle/_wysiwyg.scss b/app/src/assets/scss/protyle/_wysiwyg.scss index aa9118deb4c..77a28c79565 100644 --- a/app/src/assets/scss/protyle/_wysiwyg.scss +++ b/app/src/assets/scss/protyle/_wysiwyg.scss @@ -5,7 +5,7 @@ user-select: auto; overflow-x: clip; - &--empty:empty:before { + &--empty:empty::before { color: var(--b3-empty-color); content: attr(placeholder); } @@ -43,7 +43,7 @@ position: relative; height: 26px; - &:after { + &::after { position: absolute; content: " "; height: 1px; @@ -86,14 +86,14 @@ display: flex; flex-direction: column; - &:before { + &::before { content: ""; position: absolute; border-left: .5px solid var(--b3-theme-background-light); left: 17px; } - &:hover:before { + &:hover::before { border-left-color: var(--b3-scroll-color); } @@ -111,11 +111,11 @@ } &[fold="1"] { - &:before { + &::before { content: none; } - & > .protyle-action:after { + & > .protyle-action::after { background-color: var(--b3-list-hover); } @@ -147,7 +147,7 @@ padding-bottom: 0; } - &:after { + &::after { content: ""; position: absolute; border-radius: 50%; @@ -163,7 +163,7 @@ position: relative; } - &--order:after { + &--order::after { border-radius: var(--b3-border-radius); } } @@ -334,7 +334,7 @@ filter: brightness(.68); } - &--drag > span:after { + &--drag > span::after { content: ""; position: absolute; top: 0; @@ -363,8 +363,8 @@ box-shadow: 0 0 1px 1px var(--b3-theme-on-background); } - &:before, - &:after { + &::before, + &::after { position: absolute; width: 4px; content: ""; @@ -372,7 +372,7 @@ left: -4px; } - &:after { + &::after { left: 4px; width: 8px } @@ -409,7 +409,7 @@ } &--drag { - .iframe-content:after { + .iframe-content::after { content: ""; position: absolute; top: 0; @@ -433,7 +433,7 @@ box-shadow: 0 0 1px 1px var(--b3-theme-on-surface); box-sizing: border-box; - &:after { + &::after { content: ""; background-color: var(--b3-theme-surface); width: 32px; @@ -449,7 +449,7 @@ } &:hover, - &:hover:after { + &:hover::after { background-color: var(--b3-theme-background); box-shadow: 0 0 1px 1px var(--b3-theme-on-background); } @@ -459,17 +459,10 @@ &--select, &--hl { - &:after { - background-color: var(--b3-theme-primary-lightest); - position: absolute; - width: 100%; - height: 100%; - content: " "; - left: 0; - top: 0; + @extend .dragover; + + &::after { border-radius: var(--b3-border-radius); - z-index: 3; - pointer-events: none; } } @@ -515,7 +508,7 @@ min-height: 26px !important; } - div[fold="1"][data-type="NodeHeading"]:before { + div[fold="1"][data-type="NodeHeading"]::before { content: ""; height: 16px !important; width: 16px; @@ -600,7 +593,7 @@ cursor: pointer; &:hover { - &:after { + &::after { background-color: var(--b3-theme-background-light); } diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 277e7cc576d..e0feb671a7b 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -184,7 +184,7 @@ export const setPadding = (protyle: IProtyle) => { if (window.siyuan.config.editor.displayBookmarkIcon) { const editorAttrElement = document.getElementById("editorAttr"); if (editorAttrElement) { - editorAttrElement.innerHTML = `.protyle-wysiwyg--attr .b3-tooltips:after { max-width: ${protyle.wysiwyg.element.clientWidth - left - right}px; }`; + editorAttrElement.innerHTML = `.protyle-wysiwyg--attr .b3-tooltips::after { max-width: ${protyle.wysiwyg.element.clientWidth - left - right}px; }`; } } const oldWidth = protyle.wysiwyg.element.getAttribute("data-realwidth"); diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index 8a32927cf1e..7f2835bfbde 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -205,9 +205,9 @@ export const setInlineStyle = (set = true) => { .b3-typography code:not(.hljs), .protyle-wysiwyg span[data-type~=code] { font-variant-ligatures: ${window.siyuan.config.editor.codeLigatures ? "normal" : "none"} } .li > .protyle-action {height:${height + 8}px;line-height: ${height + 8}px} .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h1, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h2, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h3, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h4, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h5, .protyle-wysiwyg [data-node-id].li > .protyle-action ~ .h6 {line-height:${height + 8}px;} -.protyle-wysiwyg [data-node-id].li > .protyle-action:after {height: ${window.siyuan.config.editor.fontSize}px;width: ${window.siyuan.config.editor.fontSize}px;margin:-${window.siyuan.config.editor.fontSize / 2}px 0 0 -${window.siyuan.config.editor.fontSize / 2}px} +.protyle-wysiwyg [data-node-id].li > .protyle-action::after {height: ${window.siyuan.config.editor.fontSize}px;width: ${window.siyuan.config.editor.fontSize}px;margin:-${window.siyuan.config.editor.fontSize / 2}px 0 0 -${window.siyuan.config.editor.fontSize / 2}px} .protyle-wysiwyg [data-node-id].li > .protyle-action svg {height: ${Math.max(14, window.siyuan.config.editor.fontSize - 8)}px} -.protyle-wysiwyg [data-node-id].li:before {height: calc(100% - ${height + 8}px);top:${(height + 8)}px} +.protyle-wysiwyg [data-node-id].li::before {height: calc(100% - ${height + 8}px);top:${(height + 8)}px} .protyle-wysiwyg [data-node-id] [spellcheck] {min-height:${height}px;} .protyle-wysiwyg .p, .protyle-wysiwyg .code-block .hljs,