Skip to content

Commit

Permalink
enhance(ui): make consistent accent colors for all the popover dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 committed Jan 5, 2024
1 parent f9b26a1 commit a27f360
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 40 deletions.
3 changes: 3 additions & 0 deletions resources/css/shui.css
Expand Up @@ -8,6 +8,8 @@ html {
.ui__select-content {
--accent: var(--rx-gray-04-hsl);
--accent-foreground: var(--rx-gray-12-hsl);

--muted: var(--rx-gray-05-hsl);
}

.ui__dropdown-menu-item,
Expand Down Expand Up @@ -103,6 +105,7 @@ html[data-theme=dark] {
.ui__context-menu-content,
.ui__select-content {
--accent: 190 100% 15%;
--muted: 192 100% 13%;
}

.ui__calendar {
Expand Down
11 changes: 4 additions & 7 deletions src/main/frontend/common.css
Expand Up @@ -392,16 +392,14 @@ button.menu {
.menu-link:hover,
button.pull:hover,
button.menu:focus {
background-color: or(--ls-settings-list-item-hover-background-color, --lx-gray-05, --ls-menu-hover-color, #f4f5f7);
background-color: or(--lx-gray-05, --ls-menu-hover-color, #f4f5f7);
}

.menu-links-wrapper,
.menu-links-outer {
@apply py-2 rounded-md shadow-lg overflow-y-auto;
@apply py-2 rounded-lg shadow-lg overflow-y-auto border bg-popovelx min-w-[12rem];

max-height: calc(100vh - 100px) !important;
background-color: or(--ls-settings-dropdown-background, --lx-gray-03, --ls-primary-background-color, #fff);
min-width: 12rem;
}

.menu-backdrop {
Expand All @@ -411,9 +409,8 @@ button.menu:focus {
}

.menu-link {
background-color: or(--ls-settings-dropdown-link-item-background, --lx-gray-03, --ls-primary-background-color, #fff);
color: or(--ls-settings-dropdown-link-text-color, --lx-gray-11, --ls-primary-text-color);
user-select: none;
@apply text-popover-foreground/90 select-none hover:text-popover-foreground/100;
@apply text-sm px-2 py-1.5 mx-1 hover:rounded transition-opacity duration-150;
}

.menu-separator {
Expand Down
1 change: 1 addition & 0 deletions src/main/frontend/components/content.cljs
Expand Up @@ -18,6 +18,7 @@
[frontend.mixins :as mixins]
[frontend.state :as state]
[frontend.ui :as ui]
[logseq.shui.ui :as shui]
[frontend.util :as util]
[frontend.modules.shortcut.core :as shortcut]
[logseq.graph-parser.util :as gp-util]
Expand Down
4 changes: 0 additions & 4 deletions src/main/frontend/components/content.css
Expand Up @@ -17,8 +17,4 @@

z-index: calc(var(--ls-z-index-level-1) + 1);
width: 270px;

a:hover {
color: var(--ls-primary-text-color);
}
}
2 changes: 2 additions & 0 deletions src/main/frontend/components/editor.css
Expand Up @@ -43,6 +43,8 @@

&[data-modal-name="commands"],
&[data-modal-name="select-code-block-mode"] {
@apply bg-popovelx border overflow-auto rounded-lg py-1;

@screen sm {
width: 380px !important;
max-width: 90vw !important;
Expand Down
5 changes: 0 additions & 5 deletions src/main/frontend/components/file_sync.css
Expand Up @@ -96,11 +96,6 @@
font-size: 13px;
padding: 6px 20px;

> div.flex > div {
margin: 0 !important;
flex: 1;
}

&.is-first-placeholder {
padding: 0 !important;
user-select: none;
Expand Down
6 changes: 0 additions & 6 deletions src/main/frontend/components/theme.css
Expand Up @@ -60,12 +60,6 @@ html[data-theme='light'] #app-container {
}
}

.cp__header {
a {
color: var(--ls-primary-text-color);
}
}

a.right-sidebar-button {
color: var(--ls-primary-text-color);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/ui.cljs
Expand Up @@ -184,7 +184,7 @@
(if only-child?
[:div.menu-link
(dissoc options :only-child?) child]
[:a.flex.justify-between.px-4.py-2.text-sm.transition.ease-in-out.duration-150.cursor.menu-link
[:a.flex.justify-between.menu-link
(cond-> options
(true? no-padding?)
(assoc :class (str class " no-padding"))
Expand Down
29 changes: 12 additions & 17 deletions src/main/frontend/ui.css
Expand Up @@ -6,28 +6,25 @@
-webkit-overflow-scrolling: touch;

.menu-link {
word-break: break-all;
@apply break-all rounded;

.has-help {
display: flex;
align-items: center;
justify-content: space-between;

small {
visibility: visible;
cursor: help;
@apply cursor-help visible flex;

svg {
opacity: .3;
}

&:hover svg {
opacity: .9;
@apply opacity-30 hover:opacity-90;
}
}
}

&:hover, &.chosen {
background-color: or(--lx-gray-05, --ls-menu-hover-color, #f4f5f7);

.has-help small {
visibility: visible;
}
Expand All @@ -48,9 +45,7 @@
}

.ui__ac-group-name {
@apply p-2 text-xs;
color: or(--ls-dropdown-title-color, --lx-gray-11-alpha, --ls-block-ref-link-text-color);
background-color: or(--ls-dropdown-title-background, --lx-gray-03);
@apply p-2 text-xs text-popover-foreground/20 font-medium;
}

.search-all #ui__ac-inner {
Expand Down Expand Up @@ -113,9 +108,8 @@
}

&-panel {
@apply relative rounded-md shadow-xl border-none;
@apply relative rounded-md shadow-lg border border-gray-06 overflow-hidden;

overflow: hidden;
background: or(--ls-modal-panel-color, --lx-gray-04, --ls-secondary-background-color);

.panel-content {
Expand Down Expand Up @@ -283,10 +277,11 @@ html.is-mobile {
}

.dropdown-wrapper {
background-color: or(--ls-dropdown-background, --lx-gray-03, --ls-primary-background-color, #fff);
border: 1px solid or(--ls-dropdown-border-color, --lx-gray-05, --ls-tertiary-background-color);
min-width: 12rem;
border-radius: 6px;
@apply border min-w-[12rem] rounded-lg bg-popovelx overflow-hidden;

.menu-links-wrapper {
@apply border-0;
}
}

.dropdown-caret {
Expand Down
3 changes: 3 additions & 0 deletions tailwind.config.js
Expand Up @@ -279,6 +279,9 @@ module.exports = {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
popovelx: {
DEFAULT: 'var(--lx-gray-03, hsl(var(--popover)))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
Expand Down

0 comments on commit a27f360

Please sign in to comment.