tour.scss 4.2 KB

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