tour.scss 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/var' as *;
  4. @use 'common/var' as *;
  5. @include b(tour) {
  6. @include set-component-css-var('tour', $tour);
  7. @include e(hollow) {
  8. transition: all getCssVar('transition-duration') ease;
  9. }
  10. @include e(content) {
  11. padding: 0;
  12. border-radius: getCssVar('tour-border-radius');
  13. border: 1px solid getCssVar('tour-border-color');
  14. width: var(#{getCssVarName('tour-width')});
  15. background: getCssVar('tour-bg-color');
  16. box-shadow: getCssVar('box-shadow-light');
  17. box-sizing: border-box;
  18. $content-selector: &;
  19. $sides: (
  20. 'top': 'bottom',
  21. 'bottom': 'top',
  22. 'left': 'right',
  23. 'right': 'left',
  24. );
  25. @include e(arrow) {
  26. position: absolute;
  27. background: getCssVar('tour-bg-color');
  28. border: 1px solid getCssVar('tour-border-color');
  29. width: 10px;
  30. height: 10px;
  31. pointer-events: none;
  32. transform: rotate(45deg);
  33. box-sizing: border-box;
  34. @each $side,
  35. $adjacency
  36. in (
  37. 'top': 'left',
  38. 'bottom': 'right',
  39. 'left': 'bottom',
  40. 'right': 'top'
  41. )
  42. {
  43. #{$content-selector}[data-side^='#{$side}'] & {
  44. border-#{$side}-color: transparent;
  45. border-#{$adjacency}-color: transparent;
  46. }
  47. }
  48. @each $side, $opposite in $sides {
  49. #{$content-selector}[data-side^='#{$side}'] & {
  50. #{$opposite}: -5px;
  51. }
  52. }
  53. }
  54. @include e(closebtn) {
  55. position: absolute;
  56. top: 6px;
  57. right: 0;
  58. padding: 0;
  59. width: 44px;
  60. height: 44px;
  61. background: transparent;
  62. border: none;
  63. outline: none;
  64. cursor: pointer;
  65. font-size: var(
  66. #{getCssVarName('message-close-size')},
  67. map.get($message, 'close-size')
  68. );
  69. .#{$namespace}-tour__close {
  70. color: getCssVar('tour-title-text-color');
  71. font-size: inherit;
  72. }
  73. &:focus,
  74. &:hover {
  75. .#{$namespace}-tour__close {
  76. color: getCssVar('color', 'primary');
  77. }
  78. }
  79. }
  80. @include e(header) {
  81. padding: getCssVar('tour', 'padding-primary');
  82. padding-bottom: 10px;
  83. margin-right: 16px;
  84. }
  85. @include e(title) {
  86. line-height: getCssVar('tour-font-line-height');
  87. font-size: getCssVar('tour-title-font-size');
  88. color: getCssVar('tour-title-text-color');
  89. font-weight: getCssVar('tour-title-font-weight');
  90. }
  91. @include e(body) {
  92. padding: 0 getCssVar('tour-padding-primary');
  93. color: getCssVar('tour-text-color');
  94. font-size: getCssVar('tour-font-size');
  95. img,
  96. video {
  97. max-width: 100%;
  98. }
  99. }
  100. @include e(footer) {
  101. padding: getCssVar('tour-padding-primary');
  102. padding-top: 10px;
  103. box-sizing: border-box;
  104. display: flex;
  105. justify-content: space-between;
  106. }
  107. @include b(tour-indicators) {
  108. display: inline-block;
  109. flex: 1;
  110. }
  111. @include b(tour-indicator) {
  112. width: 6px;
  113. height: 6px;
  114. display: inline-block;
  115. border-radius: 50%;
  116. background: getCssVar('color', 'info-light-9');
  117. margin-right: 6px;
  118. @include when(active) {
  119. background: getCssVar('color', 'primary');
  120. }
  121. }
  122. }
  123. &.#{$namespace}-tour--primary {
  124. @include set-css-var-value('tour-title-text-color', #fff);
  125. @include set-css-var-value('tour-text-color', #fff);
  126. @include set-css-var-value('tour-bg-color', getCssVar('color', 'primary'));
  127. .#{$namespace}-tour__closebtn {
  128. &:focus,
  129. &:hover {
  130. .#{$namespace}-tour__close {
  131. color: getCssVar('tour-title-text-color');
  132. }
  133. }
  134. }
  135. .#{$namespace}-button--default {
  136. color: getCssVar('color', 'primary');
  137. border-color: getCssVar('color', 'primary');
  138. background: #fff;
  139. }
  140. .#{$namespace}-button--primary {
  141. border-color: #fff;
  142. }
  143. @include b(tour-indicator) {
  144. background: rgba(255, 255, 255, 0.15);
  145. @include when(active) {
  146. background: #fff;
  147. }
  148. }
  149. }
  150. }
  151. @include b(tour-parent) {
  152. @include m(hidden) {
  153. overflow: hidden;
  154. }
  155. }