8
0

tour.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. outline: none;
  19. $content-selector: &;
  20. $sides: (
  21. 'top': 'bottom',
  22. 'bottom': 'top',
  23. 'left': 'right',
  24. 'right': 'left',
  25. );
  26. @include e(arrow) {
  27. position: absolute;
  28. background: getCssVar('tour-bg-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: 0;
  57. right: 0;
  58. padding: 0;
  59. width: 40px;
  60. height: 40px;
  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-close-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-bottom: getCssVar('tour-padding-primary');
  82. &.show-close {
  83. padding-right: calc(
  84. getCssVar('tour-padding-primary') +
  85. var(
  86. #{getCssVarName('message-close-size')},
  87. map.get($message, 'close-size')
  88. )
  89. );
  90. }
  91. }
  92. @include e(title) {
  93. line-height: getCssVar('tour-font-line-height');
  94. font-size: getCssVar('tour-title-font-size');
  95. color: getCssVar('tour-title-text-color');
  96. font-weight: getCssVar('tour-title-font-weight');
  97. }
  98. @include e(body) {
  99. color: getCssVar('tour-text-color');
  100. font-size: getCssVar('tour-font-size');
  101. img,
  102. video {
  103. max-width: 100%;
  104. }
  105. }
  106. @include e(footer) {
  107. padding-top: getCssVar('tour-padding-primary');
  108. box-sizing: border-box;
  109. display: flex;
  110. justify-content: space-between;
  111. }
  112. @include b(tour-indicators) {
  113. display: inline-block;
  114. flex: 1;
  115. }
  116. @include b(tour-indicator) {
  117. width: 6px;
  118. height: 6px;
  119. display: inline-block;
  120. border-radius: 50%;
  121. background: getCssVar('color', 'info-light-9');
  122. margin-right: 6px;
  123. @include when(active) {
  124. background: getCssVar('color', 'primary');
  125. }
  126. }
  127. }
  128. &.#{$namespace}-tour--primary {
  129. @include set-css-var-value('tour-title-text-color', #fff);
  130. @include set-css-var-value('tour-text-color', #fff);
  131. @include set-css-var-value('tour-bg-color', getCssVar('color', 'primary'));
  132. @include set-css-var-value('tour-close-color', #fff);
  133. .#{$namespace}-tour__closebtn {
  134. &:focus,
  135. &:hover {
  136. .#{$namespace}-tour__close {
  137. color: getCssVar('tour-title-text-color');
  138. }
  139. }
  140. }
  141. .#{$namespace}-button--default {
  142. color: getCssVar('color', 'primary');
  143. border-color: getCssVar('color', 'primary');
  144. background: #fff;
  145. }
  146. .#{$namespace}-button--primary {
  147. border-color: #fff;
  148. }
  149. @include b(tour-indicator) {
  150. background: rgba(255, 255, 255, 0.15);
  151. @include when(active) {
  152. background: #fff;
  153. }
  154. }
  155. }
  156. }
  157. @include b(tour-parent) {
  158. @include m(hidden) {
  159. overflow: hidden;
  160. }
  161. }