index.less 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. @import '../style/var';
  2. .van-sidebar-item {
  3. position: relative;
  4. display: block;
  5. box-sizing: border-box;
  6. padding: @sidebar-padding;
  7. overflow: hidden;
  8. color: @sidebar-text-color;
  9. font-size: @sidebar-font-size;
  10. line-height: @sidebar-line-height;
  11. background-color: @sidebar-background-color;
  12. cursor: pointer;
  13. user-select: none;
  14. &:active {
  15. background-color: @sidebar-active-color;
  16. }
  17. &__text {
  18. position: relative;
  19. display: inline-block;
  20. // https://github.com/vant-ui/vant/issues/7455
  21. word-break: break-all;
  22. }
  23. &:not(:last-child)::after {
  24. border-bottom-width: 1px;
  25. }
  26. &--select {
  27. color: @sidebar-selected-text-color;
  28. font-weight: @sidebar-selected-font-weight;
  29. &,
  30. &:active {
  31. background-color: @sidebar-selected-background-color;
  32. }
  33. &::before {
  34. position: absolute;
  35. top: 50%;
  36. left: 0;
  37. width: @sidebar-selected-border-width;
  38. height: @sidebar-selected-border-height;
  39. background-color: @sidebar-selected-border-color;
  40. transform: translateY(-50%);
  41. content: '';
  42. }
  43. }
  44. &--disabled {
  45. color: @sidebar-disabled-text-color;
  46. cursor: not-allowed;
  47. &:active {
  48. background-color: @sidebar-background-color;
  49. }
  50. }
  51. }