anchor.scss 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/var' as *;
  4. @use 'common/var' as *;
  5. @include b(anchor) {
  6. @include set-component-css-var('anchor', $anchor);
  7. position: relative;
  8. background-color: getCssVar('anchor-bg-color');
  9. @include e(marker) {
  10. position: absolute;
  11. background-color: getCssVar('anchor-marker-bg-color');
  12. border-radius: 4px;
  13. opacity: 0;
  14. z-index: 0;
  15. }
  16. &.#{$namespace}-anchor--vertical {
  17. @include e(marker) {
  18. width: 4px;
  19. height: 14px;
  20. top: 8px;
  21. left: 0;
  22. transition: top .25s ease-in-out,opacity .25s;
  23. }
  24. @include e(list) {
  25. padding-left: getCssVar('anchor-padding-indent');
  26. }
  27. &.#{$namespace}-anchor--underline {
  28. &::before {
  29. position: absolute;
  30. left: 0;
  31. width: 2px;
  32. height: 100%;
  33. background-color: rgba(5, 5, 5, 0.06);
  34. content: '';
  35. }
  36. @include e(marker) {
  37. width: 2px;
  38. border-radius: unset;
  39. }
  40. }
  41. }
  42. &.#{$namespace}-anchor--horizontal {
  43. @include e(marker) {
  44. height: 2px;
  45. width: 20px;
  46. bottom: 0;
  47. transition: left 0.25sease-in-out, opacity 0.25s,
  48. width 0.25s;
  49. }
  50. @include e(list) {
  51. display: flex;
  52. padding-bottom: 4px;
  53. @include e(item) {
  54. padding-left: 16px;
  55. &:first-child {
  56. padding-left: 0;
  57. }
  58. }
  59. }
  60. &.#{$namespace}-anchor--underline {
  61. &::before {
  62. position: absolute;
  63. bottom: 0;
  64. width: 100%;
  65. height: 2px;
  66. background-color: rgba(5, 5, 5, 0.06);
  67. content: '';
  68. }
  69. @include e(marker) {
  70. height: 2px;
  71. border-radius: unset;
  72. }
  73. }
  74. }
  75. }