index.less 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. @import './var.less';
  2. :root {
  3. --van-index-anchor-z-index: @index-anchor-z-index;
  4. --van-index-anchor-padding: @index-anchor-padding;
  5. --van-index-anchor-text-color: @index-anchor-text-color;
  6. --van-index-anchor-font-weight: @index-anchor-font-weight;
  7. --van-index-anchor-font-size: @index-anchor-font-size;
  8. --van-index-anchor-line-height: @index-anchor-line-height;
  9. --van-index-anchor-background-color: @index-anchor-background-color;
  10. --van-index-anchor-sticky-text-color: @index-anchor-sticky-text-color;
  11. --van-index-anchor-sticky-background-color: @index-anchor-sticky-background-color;
  12. }
  13. .van-index-anchor {
  14. z-index: var(--van-index-anchor-z-index);
  15. box-sizing: border-box;
  16. padding: var(--van-index-anchor-padding);
  17. color: var(--van-index-anchor-text-color);
  18. font-weight: var(--van-index-anchor-font-weight);
  19. font-size: var(--van-index-anchor-font-size);
  20. line-height: var(--van-index-anchor-line-height);
  21. background: var(--van-index-anchor-background-color);
  22. &--sticky {
  23. position: fixed;
  24. top: 0;
  25. right: 0;
  26. left: 0;
  27. color: var(--van-index-anchor-sticky-text-color);
  28. background: var(--van-index-anchor-sticky-background-color);
  29. }
  30. }