fix(frontend): align top navigation with reference theme
This commit is contained in:
1 parent
1c501ff713
commit
9b27508a5b
12 files changed
+234
-607
No files matched your search
@@ -1,122 +1,43 @@
|
||||
/**
|
||||
* Header account popover.
|
||||
*
|
||||
* The shared legacy navigation styles provide the popover shell, and every
|
||||
* account row (avatar, VIP bar, check-in, wallet tiles, stats badges) renders
|
||||
* through the reference legacy classes. This module only owns the navigation
|
||||
* shell anchoring plus the account action-row geometry.
|
||||
* The shared navigation rules own the layout. Restore the reference typography
|
||||
* and action controls where the public reset differs from Bootstrap 3.
|
||||
*/
|
||||
|
||||
/* The reference keeps the right cluster as three floated .navbar-form groups.
|
||||
* Bootstrap's base .navbar-form rule carries margin-top: 8px and the >=768px
|
||||
* override only zeroes the horizontal margins, so every right-cluster group
|
||||
* starts 8px below the top of .navbar-collapse. The 50px menu row and the logo
|
||||
* put the navbar midline at 25px, so a 34px cross-size lands a group's midline
|
||||
* at 8 + 17 = 25px. The publish/VIP chips already reach that line through their
|
||||
* own 0.4em margin stacked on the group's 8px; the account row reaches it from
|
||||
* its 34px icon tiles, and the theme group needs the same cross-size because
|
||||
* its 29px toggle is otherwise 2.5px high. Nothing here may restate a 50px
|
||||
* min-height: it would double-count the 8px and push that group's content 8px
|
||||
* below the line while inflating the navbar from 50px to 58px. */
|
||||
.navbar-top .aksrt-navbar-account {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-navbar-account > li {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
padding: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-navbar-account > li > .sub-menu {
|
||||
top: calc(100% + 5px);
|
||||
right: 0;
|
||||
left: auto;
|
||||
z-index: 1002;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-nav-icon,
|
||||
.navbar-top .aksrt-nav-avatar {
|
||||
display: inline-flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
padding: 0 !important;
|
||||
overflow: visible !important;
|
||||
border: 0 !important;
|
||||
border-radius: 0;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-nav-icon .icon {
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-nav-avatar {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.navbar-top .aksrt-nav-avatar .avatar {
|
||||
display: block;
|
||||
width: 29px;
|
||||
height: 29px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* The account-row chips, the theme and the language toggles all want the 29px
|
||||
* midline circle. The popover's quick-login buttons are .toggle-radius too and
|
||||
* also live inside .navbar-form, but they must keep the .social_loginbar
|
||||
* geometry from main.css: in a flex container flex-basis outranks width, so
|
||||
* without this exemption the buttons collapse to 29px and lose the 5px side
|
||||
* margins that space them apart. */
|
||||
.navbar-top .navbar-form .toggle-radius:not(.social-login-item):not(.xh-social-item) {
|
||||
flex: 0 0 29px;
|
||||
margin: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Match the account row's 34px cross-size so the 29px toggle shares the 25px
|
||||
* midline instead of sitting 2.5px above it. */
|
||||
.navbar-top .navbar-form.flex.ac {
|
||||
min-height: 34px;
|
||||
}
|
||||
|
||||
.navbar-top .navbar-form .aksrt-navbar-language {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* The reference keeps the publish/VIP hover wrapper a plain inline-block, so the
|
||||
* absolutely positioned .sub-vip-card takes its normal-flow static position.
|
||||
* The shared action cluster otherwise forces inline-flex on every child, which
|
||||
* would move that static position to the flex container's cross-start. */
|
||||
.navbar-top .navbar-but > .hover-show {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Keep the drop-down search panel above a fixed header (z-index: 999). */
|
||||
.header,
|
||||
.mobile-header,
|
||||
.navbar-search {
|
||||
z-index: 1001;
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -24px, 0);
|
||||
transition: transform .24s ease, opacity .18s ease, visibility 0s linear .24s;
|
||||
will-change: transform, opacity;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
-webkit-font-smoothing: auto;
|
||||
-moz-osx-font-smoothing: auto;
|
||||
text-rendering: auto;
|
||||
}
|
||||
|
||||
.navbar-search.show {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
transition-delay: 0s;
|
||||
/* Keep the logo inline so the centered mobile brand can use text-align. */
|
||||
.navbar-logo > img {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* Reference .btn geometry without the public .btn skin. The 14px SVG keeps
|
||||
* main.css's 1em size and -0.15em baseline; list-inline owns the item spacing. */
|
||||
.navbar-top .aksrt-nav-icon {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
touch-action: manipulation;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.navbar-search .line-form-input:focus,
|
||||
@@ -125,17 +46,6 @@
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.navbar-search .search-close-box {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
max-width: 660px;
|
||||
margin: 16px auto 0;
|
||||
}
|
||||
|
||||
.navbar-search .search-close-box > .but {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.aksrt-header-userbox {
|
||||
color: var(--color-ink-2);
|
||||
line-height: 1.42857143;
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
/**
|
||||
* AKSRT Menu Decorations
|
||||
*
|
||||
* 菜单图标、徽章、多列下拉、图文卡片子菜单样式。
|
||||
* 所有选择器均带 aksrt- 或 .site-nav 命名空间。
|
||||
*/
|
||||
|
||||
/* ========== 菜单图标 ========== */
|
||||
.nav-desktop .menu-item > a .menu-icon,
|
||||
.nav-desktop .menu-item > a > i:first-child {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-right: 6px;
|
||||
font-size: 14px;
|
||||
opacity: 0.75;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-desktop .menu-item:hover > a .menu-icon,
|
||||
.nav-desktop .menu-item:hover > a > i:first-child {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* ========== 菜单徽章 ========== */
|
||||
.nav-desktop .menu-item > a .menu-badge,
|
||||
.nav-desktop .menu-item > a .aksrt-menu-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 6px;
|
||||
padding: 1px 6px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
letter-spacing: 0.02em;
|
||||
border-radius: 8px;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.aksrt-menu-badge--new {
|
||||
background: var(--color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-menu-badge--hot {
|
||||
background: #ff4d4f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-menu-badge--info {
|
||||
background: var(--color-info, #1890ff);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-menu-badge--success {
|
||||
background: var(--color-success, #52c41a);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-menu-badge--warning {
|
||||
background: var(--color-warning, #faad14);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* ========== Hover 效果 ========== */
|
||||
/* 下划线效果 */
|
||||
.aksrt-menu-hover--underline .nav-desktop .menu-item > a {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.aksrt-menu-hover--underline .nav-desktop .menu-item > a::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background: var(--color-primary);
|
||||
border-radius: 1px;
|
||||
transform: translateX(-50%);
|
||||
transition: width 0.25s ease;
|
||||
}
|
||||
|
||||
.aksrt-menu-hover--underline .nav-desktop .menu-item:hover > a::after,
|
||||
.aksrt-menu-hover--underline .nav-desktop .menu-item.current-menu-item > a::after,
|
||||
.aksrt-menu-hover--underline .nav-desktop .menu-item.current_page_item > a::after {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
/* 背景色效果 */
|
||||
.aksrt-menu-hover--background .nav-desktop .menu-item > a {
|
||||
border-radius: 6px;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.aksrt-menu-hover--background .nav-desktop .menu-item:hover > a {
|
||||
background-color: var(--color-primary-soft, rgba(240, 68, 148, 0.08));
|
||||
}
|
||||
|
||||
/* 文字变色效果 */
|
||||
.aksrt-menu-hover--color .nav-desktop .menu-item > a {
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.aksrt-menu-hover--color .nav-desktop .menu-item:hover > a {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* ========== 多列 Mega 下拉 ========== */
|
||||
.nav-desktop .menu-item .aksrt-mega-submenu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
z-index: 999;
|
||||
min-width: var(--aksrt-mega-width, 480px);
|
||||
padding: 16px 20px;
|
||||
background: var(--surface-page, #fff);
|
||||
border: 1px solid var(--color-line, #e8e8e8);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateX(-50%) translateY(8px);
|
||||
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-desktop .menu-item:hover .aksrt-mega-submenu {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__grid {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
|
||||
.aksrt-mega-submenu__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
|
||||
.aksrt-mega-submenu__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
|
||||
.aksrt-mega-submenu__grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
|
||||
|
||||
.aksrt-mega-submenu__item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
color: var(--color-ink);
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__item:hover {
|
||||
background-color: var(--color-primary-soft, rgba(240, 68, 148, 0.08));
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__item-icon {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 6px;
|
||||
background: var(--color-primary-soft, rgba(240, 68, 148, 0.08));
|
||||
color: var(--color-primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__item-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__item-title {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
color: var(--color-ink);
|
||||
}
|
||||
|
||||
.aksrt-mega-submenu__item-desc {
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
color: var(--text-tertiary, #8a909c);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ========== 图文卡片子菜单 ========== */
|
||||
.nav-desktop .menu-item .aksrt-card-submenu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
background: var(--surface-page, #fff);
|
||||
border: 1px solid var(--color-line, #e8e8e8);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateX(-50%) translateY(8px);
|
||||
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-desktop .menu-item:hover .aksrt-card-submenu {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: var(--aksrt-card-width, 160px);
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__item:hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__thumb {
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 10;
|
||||
object-fit: cover;
|
||||
background: var(--color-fill, #f5f5f5);
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__body {
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__title {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
color: var(--color-ink);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.aksrt-card-submenu__desc {
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
color: var(--text-tertiary, #8a909c);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ========== 暗色模式适配 ========== */
|
||||
html.dark .aksrt-mega-submenu,
|
||||
body.dark-theme .aksrt-mega-submenu,
|
||||
html.dark .aksrt-card-submenu,
|
||||
body.dark-theme .aksrt-card-submenu {
|
||||
background: var(--surface-page);
|
||||
border-color: var(--color-line, #2d2d3f);
|
||||
}
|
||||
|
||||
html.dark .aksrt-mega-submenu__item-title,
|
||||
body.dark-theme .aksrt-mega-submenu__item-title,
|
||||
html.dark .aksrt-card-submenu__title,
|
||||
body.dark-theme .aksrt-card-submenu__title {
|
||||
color: var(--color-ink);
|
||||
}
|
||||
Reference in new issue
Block a user