Files
logseq/src/main/frontend/components/header.css
Charlie 630c077c02 Enhance(UX): left sidebar (#11649)
* chore(ui): add sidebar related components

* chore(shui): add sidebar core

* enhance(ui): WIP polish left sidebar

* enhance(ui): polish opacity value

* enhance(ui): remove unnecessary css

* enhance(ui): simplify the left sidebar related css

* enhance(ui): polish left sidebar navigations

* enhance(ui): polish navigations items

* enhance(ui): polish graphs picker from the left sidebar

* enhance(ui): polish graphs selector

* enhance(ui): graphs dropdown content

* enhance(ux): create new page for the graphs selector section

* enhance(ui): remote icon for the graphs selector

* enhance(ui): polish sidebar navigations filter

* fix(ui): background color for the left sidebar

* enhance(ui): refactor names related with the left sidebar

* enhance(ux): WIP configurable navigations from the left sidebar

* enhance(ux): configurable navigations popup

* enhance(ux): persist user navigations from the left sidebar

* fix(ui): bad graph selector type icon

* fix: lint

* fix: lint

* enhance(ui): polish details for the left sidebar

* chore: remove shadcn sidebar component

* chore: remove shadcn sidebar related component

* fix(ui): text overflow for the page name item
2024-12-19 15:00:52 +08:00

335 lines
5.7 KiB
CSS

.cp__header {
@apply shadow z-10;
-webkit-app-region: drag;
padding-top: calc(var(--ls-headbar-inner-top-padding));
margin-top: var(--ls-win32-title-bar-height);
height: calc(var(--ls-headbar-height) + var(--ls-headbar-inner-top-padding));
display: flex;
align-items: center;
justify-content: space-between;
flex: 0 0 auto;
position: sticky;
top: 0;
left: 0;
right: 0;
line-height: 1;
white-space: nowrap;
> .l {
@apply pl-2;
min-width: var(--ls-left-sidebar-width);
height: 100%;
align-items: center;
transition: padding-left .2s;
}
> .r {
align-items: center;
flex: 1;
justify-content: flex-end;
padding-right: 6px;
}
/* To prevent header glitch on Safari */
> .l, > .r {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.button {
display: flex;
align-items: center;
justify-content: center;
.ti, .tie {
font-size: 20px;
}
}
.ui-items-container .button {
width: auto;
padding: 0 8px;
}
svg.warning {
transform: scale(0.6);
color: red;
}
&-tips {
position: absolute;
padding: 13px 0;
text-align: center;
font-weight: 500;
background: transparent;
margin-top: 0;
line-height: 0;
top: 0;
left: 40%;
transform: translateX(-50%);
z-index: 1000;
> p {
color: var(--ls-primary-text-color);
margin: 0;
display: inline-flex;
align-items: center;
font-size: 14px;
}
a {
color: var(--ls-link-text-color, #045591) !important;
}
a.restart {
position: relative;
display: flex;
align-items: center;
svg {
color: currentColor !important;
margin-right: 2px;
}
> strong {
display: inline-block;
padding-left: 2px;
cursor: pointer;
}
}
}
.dropdown-wrapper {
.ti, .tie {
opacity: .9;
}
}
.add-graph-btn {
border: 1px dashed var(--ls-border-color);
padding: 0 8px;
strong {
padding: 0 10px;
position: relative;
top: 1px;
}
}
}
.is-electron.is-mac .cp__header {
> .l {
padding-left: 78px;
}
}
.is-electron.is-mac.is-fullscreen .cp__header > .l {
padding-left: 1rem;
}
/* Workaround for Linux Intel GPU text rendering issue GH#7233 */
.is-electron.is-linux .cp__header .dropdown-wrapper .title-wrap {
position: relative;
}
.cp__header a,
.cp__header svg,
.cp__header button {
-webkit-app-region: no-drag;
}
.cp__header-logo {
@apply p-2;
}
.cp__header-logo {
display: none;
}
.cp__header-logo:hover {
opacity: 1;
}
.cp__header-logo-img {
width: 24px;
height: 24px;
}
@screen sm {
.cp__header {
@apply shadow-none;
}
.cp__header-logo {
display: block;
}
}
.cp__header-logo svg {
transform: scale(0.9);
}
.button {
@apply h-8 px-2.5 py-1 rounded-md opacity-90 block select-none hover:opacity-100 active:opacity-80;
&:hover {
@screen md {
background: var(--lx-gray-04, var(--ls-tertiary-background-color, var(--rx-gray-04)));
}
}
}
.button.icon {
@apply w-8 h-8 p-1 flex items-center justify-center;
}
.button.icon.add-graph-btn {
width: unset;
margin: 0 6px;
}
.is-mac.is-electron :is(.cp__header, .cp__right-sidebar-topbar) :is(button, .button, a):not(.file-sync-item) {
cursor: default !important;
}
html.is-ios.is-safari {
.cp__header {
background-color: var(--ls-primary-background-color);
}
.is-vw-pending {
display: none !important;
}
}
html.is-native-iphone,
html.is-native-iphone-without-notch,
html.is-native-ipad {
#main-container {
padding-top: 0;
display: flex;
flex-direction: column;
}
#main-content-container {
padding-left: 22px;
padding-right: 14px;
padding-top: 0;
height: calc(100vh - var(--ls-headbar-inner-top-padding) - var(--ls-headbar-height));
@screen sm {
padding-left: 2rem;
}
.page {
margin-top: 15px;
}
}
.cp__header {
> .r {
display: flex;
}
.button {
opacity: 1;
}
}
}
html.is-native-ipad {
--ls-headbar-inner-top-padding: 0px;
--ls-headbar-height: 4rem;
.cp__header {
background-color: transparent !important;
display: flex;
> .l {
/* background-color: var(--ls-primary-background-color); */
padding-top: 20px;
}
> .r {
flex: 1;
background-color: var(--ls-primary-background-color);
height: 100%;
padding-top: 20px;
justify-content: flex-end;
align-items: center;
}
}
.cp__right-sidebar {
&-settings {
margin-top: -4px;
}
&-topbar {
padding-top: 37px;
}
}
}
html.is-native-iphone {
--ls-headbar-inner-top-padding: 38px;
.left-sidebar-inner {
.create {
padding-bottom: 32px;
}
}
.ui__notifications {
top: calc(var(--ls-headbar-height) + var(--ls-headbar-inner-top-padding) - 0.3rem);
}
@media (orientation: landscape) {
--ls-headbar-inner-top-padding: 8px;
--ls-headbar-height: 2.5rem;
}
}
html.is-native-iphone-without-notch {
--ls-headbar-inner-top-padding: 15px;
--ls-headbar-height: 2.5rem;
@media (orientation: landscape) {
--ls-headbar-inner-top-padding: 0px;
--ls-headbar-height: 2.5rem;
}
}
html.is-zoomed-native-ios {
--ls-headbar-inner-top-padding: 30px;
@media (orientation: landscape) {
--ls-headbar-inner-top-padding: 8px;
--ls-headbar-height: 2.5rem;
}
}
.drag-region {
user-select: none;
-webkit-app-region: drag;
}
.recent-slider {
user-select: initial;
-webkit-app-region: no-drag
}
/* TODO: remote for prod */
.theme-container-inner:not(.ls-left-sidebar-open) {
.cp__header > .l {
min-width: auto;
}
}