diff --git a/src/index-anchor/index.less b/src/index-anchor/index.less index 078819ada..923f725e1 100644 --- a/src/index-anchor/index.less +++ b/src/index-anchor/index.less @@ -15,6 +15,7 @@ top: 0; right: 0; left: 0; + color: @index-anchor-sticky-text-color; background-color: @index-anchor-sticky-background-color; } } diff --git a/src/index-bar/index.js b/src/index-bar/index.js index d37a95347..c57723df4 100644 --- a/src/index-bar/index.js +++ b/src/index-bar/index.js @@ -1,6 +1,5 @@ // Utils import { createNamespace, isDef } from '../utils'; -import { GREEN } from '../utils/constant'; import { isHidden } from '../utils/dom/style'; import { preventDefault } from '../utils/dom/event'; import { @@ -44,14 +43,11 @@ export default createComponent({ props: { zIndex: Number, + highlightColor: String, sticky: { type: Boolean, default: true, }, - highlightColor: { - type: String, - default: GREEN, - }, stickyOffsetTop: { type: Number, default: 0, diff --git a/src/index-bar/index.less b/src/index-bar/index.less index 6a58ee974..1ee621e60 100644 --- a/src/index-bar/index.less +++ b/src/index-bar/index.less @@ -19,5 +19,9 @@ font-weight: @font-weight-bold; font-size: @index-bar-index-font-size; line-height: @index-bar-index-line-height; + + &--active { + color: @index-bar-index-active-color; + } } } diff --git a/src/index-bar/test/__snapshots__/index.spec.js.snap b/src/index-bar/test/__snapshots__/index.spec.js.snap index f038eef00..66721ebb2 100644 --- a/src/index-bar/test/__snapshots__/index.spec.js.snap +++ b/src/index-bar/test/__snapshots__/index.spec.js.snap @@ -14,7 +14,7 @@ exports[`custom anchor text 1`] = ` exports[`scroll and update active anchor 1`] = `