mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-02 17:53:47 +08:00
Add layout registration, visual editing, and source generation. Preserve embedded pages and wait for asynchronous layout renderers. Add workspace lint and formatting commands.
143 lines
2.7 KiB
SCSS
143 lines
2.7 KiB
SCSS
.layout-header {
|
|
block-size: $layoutHeaderHeight;
|
|
padding-inline: $layoutRouterViewContainer;
|
|
display: flex;
|
|
align-items: center;
|
|
border-block-end: 1px solid var(--r-line);
|
|
|
|
> .layout-header__method {
|
|
inline-size: 100%;
|
|
min-inline-size: 0;
|
|
gap: 16px;
|
|
}
|
|
|
|
&__navigation {
|
|
min-inline-size: 0;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
|
|
&__actions {
|
|
flex-shrink: 0;
|
|
}
|
|
}
|
|
|
|
.layout-header,
|
|
.r-layout-row {
|
|
.n-breadcrumb {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.override-button__layout,
|
|
.layout-header__menu-toggle {
|
|
inline-size: 36px;
|
|
padding: 0;
|
|
border-radius: var(--r-control-radius);
|
|
color: var(--r-text-secondary);
|
|
}
|
|
|
|
:is(
|
|
.layout-header__menu-toggle,
|
|
.override-button__layout,
|
|
.layout-header__account
|
|
) {
|
|
&:focus-visible {
|
|
outline: 2px solid var(--r-theme-primary-color);
|
|
outline-offset: -2px;
|
|
}
|
|
|
|
@media (hover: none) {
|
|
// 抽屉关闭会将焦点交还给触发按钮,触屏浏览器也可能保留 :hover。
|
|
&:is(:hover, :focus):not(:active, :focus-visible, :disabled, .is-open) {
|
|
background-color: var(--n-color);
|
|
}
|
|
}
|
|
}
|
|
|
|
.layout-header__account {
|
|
block-size: 40px;
|
|
margin-inline-start: 8px;
|
|
padding-inline: 8px;
|
|
border-radius: var(--r-control-radius);
|
|
|
|
&.is-open {
|
|
background: var(--r-surface-hover);
|
|
}
|
|
|
|
.r-app-avatar__name {
|
|
max-inline-size: 9rem;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
|
|
.layout-header__account-chevron {
|
|
color: var(--r-text-muted);
|
|
transition: transform 160ms ease;
|
|
}
|
|
|
|
.layout-header__account.is-open .layout-header__account-chevron {
|
|
transform: rotate(180deg);
|
|
}
|
|
}
|
|
|
|
.layout-account-menu {
|
|
min-inline-size: 224px;
|
|
max-inline-size: calc(100dvw - 24px);
|
|
|
|
&__identity {
|
|
display: grid;
|
|
gap: 4px;
|
|
max-inline-size: 256px;
|
|
padding: 12px 16px 8px;
|
|
overflow-wrap: anywhere;
|
|
|
|
> span {
|
|
color: var(--r-text-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
> strong {
|
|
color: var(--r-text);
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.layout-header {
|
|
padding-inline: 8px;
|
|
|
|
> .layout-header__method {
|
|
gap: 4px;
|
|
}
|
|
|
|
.override-button__layout,
|
|
.layout-header__menu-toggle,
|
|
.layout-header__account {
|
|
inline-size: 44px;
|
|
block-size: 44px;
|
|
padding: 0;
|
|
}
|
|
|
|
.layout-header__account {
|
|
margin-inline-start: 0;
|
|
|
|
.r-app-avatar__name,
|
|
.layout-header__account-chevron {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.layout-account-menu .n-dropdown-option-body {
|
|
min-block-size: 44px;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.layout-header__account-chevron {
|
|
transition: none;
|
|
}
|
|
}
|