index.less 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. @import '../style/var';
  2. .van-notice-bar {
  3. display: flex;
  4. height: 40px;
  5. padding: 0 15px;
  6. font-size: 14px;
  7. line-height: 24px;
  8. position: relative;
  9. align-items: center;
  10. color: @orange-dark;
  11. background-color: @orange-light;
  12. &__left-icon {
  13. font-size: 16px;
  14. min-width: 22px;
  15. }
  16. &__right-icon {
  17. top: 50%;
  18. right: 15px;
  19. font-size: 16px;
  20. position: absolute;
  21. margin-top: -0.5em;
  22. }
  23. &__wrap {
  24. flex: 1;
  25. height: 24px;
  26. overflow: hidden;
  27. position: relative;
  28. }
  29. &__content {
  30. position: absolute;
  31. white-space: nowrap;
  32. &.van-ellipsis {
  33. max-width: 100%;
  34. }
  35. }
  36. &__play {
  37. animation: van-notice-bar-play linear both;
  38. &--infinite {
  39. animation: van-notice-bar-play-infinite linear infinite both;
  40. }
  41. }
  42. &--wrapable {
  43. height: auto;
  44. padding: 8px 15px;
  45. .van-notice-bar {
  46. &__wrap {
  47. height: auto;
  48. }
  49. &__content {
  50. position: relative;
  51. white-space: normal;
  52. }
  53. }
  54. }
  55. &--withicon {
  56. position: relative;
  57. padding-right: 40px;
  58. }
  59. }
  60. /**
  61. * Declare two same keyframes
  62. * In case that some mobile browsers can continue animation when className changed
  63. */
  64. @keyframes van-notice-bar-play {
  65. to { transform: translate3d(-100%, 0, 0); }
  66. }
  67. @keyframes van-notice-bar-play-infinite {
  68. to { transform: translate3d(-100%, 0, 0); }
  69. }