iter(g101): 新增锚点导航组件 anchor
This commit is contained in:
@@ -3611,3 +3611,67 @@ button.ua-step-dot:hover {
|
||||
.ua-space.is-block {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* —— 锚点导航 —— */
|
||||
.ua-anchor {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding-left: var(--ua-space-3);
|
||||
}
|
||||
.ua-anchor::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 2px;
|
||||
background: var(--ua-color-border);
|
||||
border-radius: 1px;
|
||||
}
|
||||
.ua-anchor-link {
|
||||
position: relative;
|
||||
padding: var(--ua-space-1) var(--ua-space-2);
|
||||
border-radius: var(--ua-radius-sm);
|
||||
color: var(--ua-color-text-muted);
|
||||
font-size: var(--ua-font-size-md);
|
||||
text-decoration: none;
|
||||
transition: color 0.15s, background-color 0.15s, transform 0.15s;
|
||||
}
|
||||
.ua-anchor-link:hover {
|
||||
color: var(--ua-color-text);
|
||||
background: color-mix(in srgb, var(--ua-color-accent) 6%, transparent);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
.ua-anchor-link.is-active {
|
||||
color: var(--ua-color-text);
|
||||
background: color-mix(in srgb, var(--ua-color-accent) 10%, transparent);
|
||||
}
|
||||
.ua-anchor-link.is-active::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: calc(-1 * var(--ua-space-3));
|
||||
top: 50%;
|
||||
width: 2px;
|
||||
height: 70%;
|
||||
transform: translateY(-50%);
|
||||
background: var(--ua-color-accent);
|
||||
border-radius: 1px;
|
||||
}
|
||||
.ua-anchor-link.is-disabled {
|
||||
opacity: 0.45;
|
||||
pointer-events: none;
|
||||
}
|
||||
.ua-anchor-link:focus-visible {
|
||||
outline: 2px solid var(--ua-color-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ua-anchor-link {
|
||||
transition: none;
|
||||
}
|
||||
.ua-anchor-link:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user