Skip to content

Commit 54f2993

Browse files
feat: 添加固定顶部导航和右侧面板粘性效果
Signed-off-by: wangsimiao1 <wangsimiao1@xiaomi.com>
1 parent 56359b4 commit 54f2993

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

_sass/base/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ body {
500500

501501
#main-wrapper {
502502
position: relative;
503-
overflow: hidden;
503+
overflow: clip;
504504

505505
@include mx.pl-pr(0);
506506

_sass/layout/_panel.scss

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
@use '../abstracts/placeholders';
44

55
.access {
6-
top: 2rem;
7-
transition: top 0.2s cubic-bezier(0.22, 1, 0.36, 1);
6+
top: 3rem;
87
margin-top: 3rem;
9-
10-
&:only-child {
11-
position: -webkit-sticky;
12-
position: sticky;
13-
}
8+
position: -webkit-sticky;
9+
position: sticky;
1410

1511
> section {
1612
@extend %panel-border;

_sass/layout/_topbar.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#topbar-wrapper {
77
height: v.$topbar-height;
88
background-color: var(--topbar-bg);
9+
position: -webkit-sticky;
10+
position: sticky;
11+
top: 0;
12+
z-index: 1030;
913

1014
@include bp.lt(bp.get(lg)) {
1115
@include mx.slide(top 0.25s cubic-bezier(0.22, 1, 0.36, 1));

_sass/themes/_dark.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
--avatar-border-color: rgb(200 193 185 / 80%);
4545

4646
/* Topbar */
47-
--topbar-bg: rgb(30 29 27 / 64%);
47+
--topbar-bg: rgb(30 29 27 / 100%);
4848
--topbar-text-color: var(--text-color);
4949
--search-border-color: #3A3632;
5050
--search-icon-color: #6A6560;

_sass/themes/_light.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
--avatar-border-color: #F5F0EB;
4242

4343
/* Topbar */
44-
--topbar-bg: rgb(245 240 235 / 70%);
44+
--topbar-bg: rgb(245 240 235 / 100%);
4545
--topbar-text-color: #5A5A5A;
4646
--search-border-color: #E0D8D0;
4747
--search-icon-color: #B8B0A8;

0 commit comments

Comments
 (0)