Skip to content

Commit

Permalink
feat(anchor): child level use css vars (#1600)
Browse files Browse the repository at this point in the history
* feat: spatial distance calculation adjustments in front of anchor points

* refactor(anchor): style optimization

* refactor(anchor): adjust style

* chore: fix lint

* chore: fix lint

* chore: fix style

---------

Co-authored-by: v_pengphe <v_pengphe@tencent.com>
Co-authored-by: wū yāng <uyarnchen@gmail.com>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent 0352a42 commit 01f83a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions style/web/components/anchor/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.@{prefix}-anchor {
.reset;

--td-anchor-space-base: var(--td-size-6);

position: relative;
background: @anchor-bg-color;
width: @anchor-width-default;
Expand Down Expand Up @@ -48,16 +50,16 @@
//锚点item
&__item {
padding: @anchor-item-padding;

--level: 1;

padding-left: calc(var(--level) * var(--td-anchor-space-base));
display: flex;
flex-direction: column;

&.@{prefix}-is-active {
font-weight: 500;
}

.@{prefix}-anchor__item {
padding: @anchor-sub-item-padding;
}
}

&__item-link {
Expand Down

0 comments on commit 01f83a3

Please sign in to comment.