diff --git a/frontend/resources/styles/common/refactor/themes/default-theme.scss b/frontend/resources/styles/common/refactor/themes/default-theme.scss index cfbead3b81..f5d10bad96 100644 --- a/frontend/resources/styles/common/refactor/themes/default-theme.scss +++ b/frontend/resources/styles/common/refactor/themes/default-theme.scss @@ -4,6 +4,8 @@ // // Copyright (c) KALEIDOS INC +@use "sass:meta"; + :root { --color-background-primary: var(--dark-gray-1); --color-background-secondary: var(--dark-gray-2); @@ -25,4 +27,6 @@ --pending-color: var(--dark-pending-color); --error-color: var(--dark-error-color); --canvas-color: var(--color-canvas); + + @include meta.load-css("hljs-dark-theme"); } diff --git a/frontend/resources/styles/common/refactor/themes/hljs-dark-theme.scss b/frontend/resources/styles/common/refactor/themes/hljs-dark-theme.scss new file mode 100644 index 0000000000..5ae417d47e --- /dev/null +++ b/frontend/resources/styles/common/refactor/themes/hljs-dark-theme.scss @@ -0,0 +1,98 @@ +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ + +.hljs { + color: #e6e6e6; + background: #2a2c2d; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} + +.hljs-comment, +.hljs-quote { + color: #bbbbbb; + font-style: italic; +} + +.hljs-params { + color: #bbbbbb; +} + +.hljs-punctuation, +.hljs-attr { + color: #e6e6e6; +} + +.hljs-selector-tag, +.hljs-name, +.hljs-meta { + color: #ff4b82; +} + +.hljs-operator, +.hljs-char.escape_ { + color: #b084eb; +} + +.hljs-keyword, +.hljs-deletion { + color: #ff75b5; +} + +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #ff9ac1; +} + +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #45a9f9; +} + +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #19f9d8; +} + +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword, +.hljs-punctuation { + color: #ffb86c; +} diff --git a/frontend/resources/styles/common/refactor/themes/hljs-light-theme.scss b/frontend/resources/styles/common/refactor/themes/hljs-light-theme.scss new file mode 100644 index 0000000000..615abdd13a --- /dev/null +++ b/frontend/resources/styles/common/refactor/themes/hljs-light-theme.scss @@ -0,0 +1,94 @@ +/** + * Panda Syntax Theme for Highlight.js + * Based on: https://github.com/tinkertrain/panda-syntax-vscode + * Author: Annmarie Switzer + */ + +.hljs { + color: #2a2c2d; + background: #e6e6e6; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} + +.hljs-comment, +.hljs-quote { + color: #676b79; + font-style: italic; +} + +.hljs-params { + color: #676b79; +} + +.hljs-punctuation, +.hljs-attr { + color: #2a2c2d; +} + +.hljs-selector-tag, +.hljs-name, +.hljs-meta, +.hljs-operator, +.hljs-char.escape_ { + color: #c56200; +} + +.hljs-keyword, +.hljs-deletion { + color: #d92792; +} + +.hljs-regexp, +.hljs-selector-pseudo, +.hljs-selector-attr, +.hljs-variable.language_ { + color: #cc5e91; +} + +.hljs-subst, +.hljs-property, +.hljs-code, +.hljs-formula, +.hljs-section, +.hljs-title.function_ { + color: #3787c7; +} + +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-selector-class, +.hljs-title.class_, +.hljs-title.class_.inherited__, +.hljs-meta .hljs-string { + color: #0d7d6c; +} + +.hljs-variable, +.hljs-template-variable, +.hljs-number, +.hljs-literal, +.hljs-type, +.hljs-link, +.hljs-built_in, +.hljs-title, +.hljs-selector-id, +.hljs-tag, +.hljs-doctag, +.hljs-attribute, +.hljs-template-tag, +.hljs-meta .hljs-keyword { + color: #7641bb; +} diff --git a/frontend/resources/styles/common/refactor/themes/light-theme.scss b/frontend/resources/styles/common/refactor/themes/light-theme.scss index 8c7698ddde..60c904f106 100644 --- a/frontend/resources/styles/common/refactor/themes/light-theme.scss +++ b/frontend/resources/styles/common/refactor/themes/light-theme.scss @@ -4,6 +4,8 @@ // // Copyright (c) KALEIDOS INC +@use "sass:meta"; + .light { --color-background-primary: var(--light-gray-1); --color-background-secondary: var(--light-gray-2); @@ -24,4 +26,6 @@ --pending-color: var(--light-pending-color); --error-color: var(--light-error-color); --canvas-color: var(--color-canvas); + + @include meta.load-css("hljs-light-theme"); } diff --git a/frontend/src/app/main/ui/auth/common.scss b/frontend/src/app/main/ui/auth/common.scss index a873332af6..0bec2bf2d7 100644 --- a/frontend/src/app/main/ui/auth/common.scss +++ b/frontend/src/app/main/ui/auth/common.scss @@ -40,13 +40,19 @@ --input-min-width: 100%; } -.buttons-stack button, -.buttons-stack :global(.btn-primary) { - @extend .button-primary; - font-size: $fs-11; - height: $s-40; - text-transform: uppercase; - width: 100%; +.buttons-stack { + display: flex; + flex-direction: column; + gap: $s-8; + + button, + :global(.btn-primary) { + @extend .button-primary; + font-size: $fs-11; + height: $s-40; + text-transform: uppercase; + width: 100%; + } } .link-entry { diff --git a/frontend/src/app/main/ui/components/code_block.cljs b/frontend/src/app/main/ui/components/code_block.cljs index 9bef8150c2..69a54a6567 100644 --- a/frontend/src/app/main/ui/components/code_block.cljs +++ b/frontend/src/app/main/ui/components/code_block.cljs @@ -10,16 +10,20 @@ ["highlight.js" :as hljs] [app.common.data.macros :as dm] [app.main.ui.context :as ctx] + [cuerdas.core :as str] [rumext.v2 :as mf])) (mf/defc code-block {::mf/wrap-props false} [{:keys [code type]}] (let [new-css-system (mf/use-ctx ctx/new-css-system) - block-ref (mf/use-ref)] + block-ref (mf/use-ref) + code (str/trim code)] (mf/with-effect [code type] (when-let [node (mf/ref-val block-ref)] (hljs/highlightElement node))) - [:pre {:class (dm/str type " " (stl/css new-css-system :code-display)) :ref block-ref} code])) + (if new-css-system + [:pre {:class (dm/str type " " (stl/css :code-display)) :ref block-ref} code] + [:pre {:class (dm/str type " " "code-display") :ref block-ref} code]))) diff --git a/frontend/src/app/main/ui/components/code_block.scss b/frontend/src/app/main/ui/components/code_block.scss index 1b8e72a4d2..49d63fda19 100644 --- a/frontend/src/app/main/ui/components/code_block.scss +++ b/frontend/src/app/main/ui/components/code_block.scss @@ -7,8 +7,10 @@ @import "refactor/common-refactor.scss"; .code-display { + user-select: text; border-radius: $br-8; margin-top: $s-8; padding: $s-12; background-color: var(--menu-background-color); + overflow: auto; } diff --git a/frontend/src/app/main/ui/workspace/sidebar.cljs b/frontend/src/app/main/ui/workspace/sidebar.cljs index 54d914886a..e0433a1762 100644 --- a/frontend/src/app/main/ui/workspace/sidebar.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar.cljs @@ -196,8 +196,8 @@ (obj/set! "on-expand" handle-expand))] [:aside {:class (stl/css-case new-css-system - :global/settings-bar true - :global/settings-bar-right true + :global/settings-bar (not new-css-system) + :global/settings-bar-right (not new-css-system) :right-settings-bar true :not-expand (not can-be-expanded?) :expanded (> size 276))