Skip to content

Build your personal knowledge base with Trilium Notes

style/buttons: restyle button groups

Adorian Doranb9daee12fdfa
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index 877515c357..5e50c49584 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -44,6 +44,11 @@
--button-group-active-button-background: #ffffff4e;
--button-group-active-button-text-color: white;
+ --button-group-background-color: #00000051;
+ --button-group-active-button-background-color: #4f4f4f;
+ --button-group-active-button-color: white;
+ --button-group-active-button-shadow-color: #000000;
+
--icon-button-color: currentColor;
--icon-button-hover-background: var(--hover-item-background-color);
--icon-button-hover-color: var(--hover-item-text-color);
diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css
index 8581eda73a..eb46df345b 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -44,6 +44,11 @@
--button-group-active-button-background: #00000026;
--button-group-active-button-text-color: black;
+ --button-group-background-color: var(--input-background-color);
+ --button-group-active-button-background-color: white;
+ --button-group-active-button-color: black;
+ --button-group-active-button-shadow-color: #00000056;
+
--icon-button-color: currentColor;
--icon-button-hover-background: var(--hover-item-background-color);
--icon-button-hover-color: var(--hover-item-text-color);
diff --git a/apps/client/src/stylesheets/theme-next/forms.css b/apps/client/src/stylesheets/theme-next/forms.css
index 4dd5513ed9..3247980c4f 100644
--- a/apps/client/src/stylesheets/theme-next/forms.css
+++ b/apps/client/src/stylesheets/theme-next/forms.css
@@ -21,21 +21,6 @@ button.ck.ck-button:is(.ck-button-action, .ck-button-save, .ck-button-cancel, .c
&.dropdown-toggle-split {
min-width: unset;
}
-
- .btn-group > & {
- border-radius: 0;
- margin-inline-start: 0 !important;
- }
-
- .btn-group > &:first-child {
- border-start-start-radius: 6px;
- border-end-start-radius: 6px;
- }
-
- .btn-group > &:last-child {
- border-start-end-radius: 6px;
- border-end-end-radius: 6px;
- }
}
button.btn.btn-primary:hover,
@@ -132,16 +117,6 @@ button.tn-low-profile:hover {
color: var(--icon-button-color);
}
-:root .btn-group .icon-action:not(:first-child) {
- border-top-left-radius: unset !important;
- border-bottom-left-radius: unset !important;
-}
-
-:root .btn-group .icon-action:not(:last-child) {
- border-top-right-radius: unset !important;
- border-bottom-right-radius: unset !important;
-}
-
.btn-group .tn-tool-button + .tn-tool-button {
margin-inline-start: 4px !important;
}
@@ -189,10 +164,37 @@ button.tn-low-profile:hover {
/* Button groups */
-/* Active button */
-:root .btn-group button.btn.active {
- background-color: var(--button-group-active-button-background);
- color: var(--button-group-active-button-text-color);
+:root div.btn-group {
+ display: flex;
+ gap: 4px;
+ border-radius: 8px;
+ background: var(--button-group-background-color);
+ padding: 4px;
+
+ button,
+ button.btn,
+ button.btn.btn-secondary {
+ --cmd-button-background-color: transparent;
+ --cmd-button-shadow-color: transparent;
+
+ min-width: unset;
+ margin: 0;
+ box-shadow: unset;
+ border-radius: 8px;
+
+ &.active, &.active:hover {
+ background-color: var(--button-group-active-button-background-color);
+ color: var(--button-group-active-button-color);
+
+ box-shadow: 1px 1px 1px var(--button-group-active-button-shadow-color);
+ }
+ }
+
+ .icon-action {
+ --icon-button-size: 28px;
+ --icon-button-icon-ratio: .75;
+ width: calc(var(--icon-button-size) * 1.25);
+ }
}
/*