8
0

anchor.scss 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 0.25s ease-in-out, opacity 0.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.25s ease-in-out, opacity 0.25s, width 0.25s;
  48. }
  49. @include e(list) {
  50. display: flex;
  51. padding-bottom: 4px;
  52. @include e(item) {
  53. padding-left: 16px;
  54. &:first-child {
  55. padding-left: 0;
  56. }
  57. }
  58. }
  59. &.#{$namespace}-anchor--underline {
  60. &::before {
  61. position: absolute;
  62. bottom: 0;
  63. width: 100%;
  64. height: 2px;
  65. background-color: rgba(5, 5, 5, 0.06);
  66. content: '';
  67. }
  68. @include e(marker) {
  69. height: 2px;
  70. border-radius: unset;
  71. }
  72. }
  73. }
  74. }