Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(mobile/text): draw toolbar button states on an inset pill
Elian Doranbaf0dea253ca
diff --git a/apps/client/src/stylesheets/theme-next/notes/text.css b/apps/client/src/stylesheets/theme-next/notes/text.cssindex 60a4e08784..18f8bf7cef 100644--- a/apps/client/src/stylesheets/theme-next/notes/text.css+++ b/apps/client/src/stylesheets/theme-next/notes/text.css@@ -33,6 +33,10 @@/* Toolbar button in on state */.ck.ck-toolbar .ck-button.ck-on:not(.ck-dropdown__button):not(.ck-list-item-button):not(.ck-button_with-text) {--ck-color-button-on-background: var(--ck-editor-toolbar-button-on-background);+ --ck-color-button-on-hover-background:+ linear-gradient(var(--hover-item-background-color), var(--hover-item-background-color)),+ var(--ck-editor-toolbar-button-on-background);+ --ck-color-button-on-active-background: var(--ck-color-button-on-hover-background);--ck-color-button-on-color: var(--ck-editor-toolbar-button-on-color);box-shadow: var(--ck-editor-toolbar-button-on-shadow);}@@ -40,6 +44,10 @@/* Toolbar button with its dropdown open */.ck.ck-toolbar .ck-button.ck-dropdown__button {--ck-color-button-on-background: var(--ck-editor-toolbar-dropdown-button-open-background);+ --ck-color-button-on-hover-background:+ linear-gradient(var(--hover-item-background-color), var(--hover-item-background-color)),+ var(--ck-editor-toolbar-dropdown-button-open-background);+ --ck-color-button-on-active-background: var(--ck-color-button-on-hover-background);--ck-color-button-on-color: currentColor;}diff --git a/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.css b/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.cssindex 06cd5a42b7..0543d8b2bd 100644--- a/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.css+++ b/apps/client/src/widgets/type_widgets/text/mobile_editor_toolbar.css@@ -157,6 +157,58 @@ body.mobile {--ck-size-control-min-height: var(--mobile-toolbar-button-size);--ck-icon-size: var(--mobile-toolbar-icon-size);}++ /* A button keeps the full height of the bar to be pressed, and draws its state on a pill+ inside it. */+ .ck-toolbar__items > :is(+ .ck-button,+ .ck-dropdown > .ck-button,+ .ck-dropdown > .ck-splitbutton > .ck-button+ ) {+ --mobile-toolbar-pill: transparent;+ --mobile-toolbar-pill-tint: transparent;+ --mobile-toolbar-pill-shadow: none;+ position: relative;+ isolation: isolate;++ &, &:hover, &:active {+ background: transparent;+ box-shadow: none;+ }++ &::before {+ content: "";+ position: absolute;+ inset: 6px 2px;+ z-index: -1;+ border-radius: 6px;+ background:+ linear-gradient(var(--mobile-toolbar-pill-tint), var(--mobile-toolbar-pill-tint)),+ var(--mobile-toolbar-pill);+ box-shadow: var(--mobile-toolbar-pill-shadow);+ }++ &.ck-on {+ --mobile-toolbar-pill: var(--ck-editor-toolbar-button-on-background, var(--accented-background-color));+ --mobile-toolbar-pill-shadow: var(--ck-editor-toolbar-button-on-shadow, none);+ }++ &.ck-dropdown__button.ck-on {+ --mobile-toolbar-pill: var(--ck-editor-toolbar-dropdown-button-open-background, var(--accented-background-color));+ --mobile-toolbar-pill-shadow: none;+ }++ &:not(.ck-disabled):active {+ --mobile-toolbar-pill-tint: var(--hover-item-background-color);+ }++ /* A touch screen keeps `:hover` on the last button pressed. */+ @media (hover: hover) {+ &:not(.ck-disabled):hover {+ --mobile-toolbar-pill-tint: var(--hover-item-background-color);+ }+ }+ }}}