You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_overlay.scss 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /**
  2. * The background color for overlay elements.
  3. *
  4. * @type color
  5. * @group overlay
  6. */
  7. $v-overlay-background-color: if(is-dark-color($v-background-color), darken($v-background-color, 3%), lighten($v-background-color, 2%)) !default;
  8. /**
  9. * The corner radius for overlay elements.
  10. *
  11. * @type size (px)
  12. * @group overlay
  13. */
  14. $v-overlay-border-radius: $v-border-radius !default;
  15. /**
  16. * The border width for overlay elements.
  17. *
  18. * @type size (px)
  19. * @group overlay
  20. */
  21. $v-overlay-border-width: first-number($v-border) !default;
  22. /**
  23. * The animation which is used when overlay elements are made visible.
  24. *
  25. * @type list
  26. * @group overlay
  27. */
  28. $v-overlay-animate-in: valo-overlay-animate-in 120ms !default;
  29. /**
  30. * The animation which is used when overlay elements are removed.
  31. *
  32. * @type list
  33. * @group overlay
  34. */
  35. $v-overlay-animate-out: valo-animate-out-fade 120ms !default;
  36. /**
  37. * The padding on each size of overlay elements.
  38. *
  39. * @type size
  40. * @group overlay
  41. */
  42. $v-overlay-padding: round($v-unit-size/9) !default;
  43. /**
  44. * The padding on the top and bottom edges of overlay elements.
  45. *
  46. * @type size
  47. * @group overlay
  48. */
  49. $v-overlay-padding-vertical: $v-overlay-padding !default;
  50. /**
  51. * The padding on the left and right edges of overlay elements.
  52. *
  53. * @type size
  54. * @group overlay
  55. */
  56. $v-overlay-padding-horizontal: $v-overlay-padding !default;
  57. /**
  58. * The shadow used for overlay elements.
  59. *
  60. * @type list
  61. * @group overlay
  62. */
  63. $v-overlay-shadow: 0 4px 10px 0 (v-shade 2), 0 3px 5px 0 v-shade, 0 0 0 $v-overlay-border-width (v-shade (2.5 - color-luminance($v-background-color)/255 + $v-bevel-depth/100%)) !default;
  64. /**
  65. * The background color for selection overlays, i.e. overlays which present a
  66. * list of options for the user to choose from, such as context menus and drop down
  67. * menus.
  68. *
  69. * @type color
  70. * @group overlay
  71. */
  72. $v-selection-overlay-background-color: $v-overlay-background-color !default;
  73. /**
  74. * The padding on each size of selection overlay elements.
  75. *
  76. * @type size
  77. * @group overlay
  78. */
  79. $v-selection-overlay-padding: $v-overlay-padding !default;
  80. /**
  81. * The padding on the top and bottom edges of selection overlay elements.
  82. *
  83. * @type size
  84. * @group overlay
  85. */
  86. $v-selection-overlay-padding-vertical: $v-selection-overlay-padding !default;
  87. /**
  88. * The padding on the left and right edges of selection overlay elements.
  89. *
  90. * @type size
  91. * @group overlay
  92. */
  93. $v-selection-overlay-padding-horizontal: $v-selection-overlay-padding !default;
  94. /**
  95. * The corner radius for selection overlay elements.
  96. *
  97. * @type size (px)
  98. * @group overlay
  99. */
  100. $v-selection-item-border-radius: $v-border-radius - 1px !default;
  101. /**
  102. * The height of individual selection overlay list items.
  103. *
  104. * @type size (px)
  105. * @group overlay
  106. */
  107. $v-selection-item-height: ceil($v-unit-size/1.4) !default;
  108. /**
  109. * The horizontal padding for individual selection overlay list items.
  110. *
  111. * @type size
  112. * @group overlay
  113. */
  114. $v-selection-item-padding-horizontal: ceil($v-unit-size/4) !default;
  115. /**
  116. * The font weight for individual selection overlay list items.
  117. *
  118. * @type number | identifier
  119. * @group overlay
  120. */
  121. $v-selection-item-font-weight: max(400, $v-font-weight);
  122. /**
  123. * The font color for individual selection overlay list items.
  124. *
  125. * @type color
  126. * @group overlay
  127. */
  128. $v-selection-item-selection-color: $v-selection-color !default;
  129. /**
  130. * Outputs styles for overlay elements
  131. *
  132. * @group overlay
  133. *
  134. * @param {color} $background-color ($v-overlay-background-color) - the background color for the overlay
  135. * @param {list} $shadow ($v-overlay-shadow) - the shadow for the overlay
  136. * @param {list} $animate-in ($v-overlay-animate-in) - the animation used when the overlay is made visible
  137. * @param {list} $animate-out ($v-overlay-animate-out) - the animation used when the overlay is removed
  138. */
  139. @mixin valo-overlay-style (
  140. $background-color: $v-overlay-background-color,
  141. $shadow: $v-overlay-shadow,
  142. $animate-in: $v-overlay-animate-in,
  143. $animate-out: $v-overlay-animate-out
  144. ) {
  145. padding: $v-overlay-padding-vertical $v-overlay-padding-horizontal;
  146. border-radius: $v-overlay-border-radius;
  147. background-color: $background-color;
  148. color: valo-font-color($background-color);
  149. @include box-shadow( valo-bevel-and-shadow($bevel: null, $shadow: $shadow));
  150. @if $v-animations-enabled {
  151. @if $animate-in {
  152. &[class*="animate-in"] {
  153. @include animation($animate-in);
  154. }
  155. }
  156. @if $animate-out {
  157. &[class*="animate-out"] {
  158. @include animation($animate-out);
  159. }
  160. }
  161. }
  162. -webkit-backface-visibility: hidden;
  163. -moz-backface-visibility: hidden;
  164. -ms-backface-visibility: hidden;
  165. backface-visibility: hidden;
  166. }
  167. /**
  168. * Outputs styles for selection overlay elements.
  169. *
  170. * @group overlay
  171. *
  172. * @param {color} $background-color ($v-selection-overlay-background-color) - the background color for the overlay
  173. * @param {list} $animate-in ($v-overlay-animate-in) - the animation used when the selection overlay is made visible
  174. * @param {list} $animate-out ($v-overlay-animate-out) - the animation used when the selection overlay is removed
  175. */
  176. @mixin valo-selection-overlay-style ($background-color: $v-selection-overlay-background-color, $animate-in: $v-overlay-animate-in, $animate-out: $v-overlay-animate-out) {
  177. @include valo-overlay-style($background-color: $background-color, $animate-in: $animate-in, $animate-out: $animate-out);
  178. padding: $v-selection-overlay-padding-vertical $v-selection-overlay-padding-horizontal;
  179. }
  180. /**
  181. * Outputs the styles for selection item elements (i.e. individual items in context menus and drop down menus).
  182. *
  183. * @group overlay
  184. */
  185. @mixin valo-selection-item-style {
  186. cursor: pointer;
  187. line-height: $v-selection-item-height;
  188. padding: 0 $v-selection-item-padding-horizontal*2 0 $v-selection-item-padding-horizontal;
  189. @if $v-selection-item-border-radius > 0 {
  190. border-radius: $v-selection-item-border-radius;
  191. }
  192. font-weight: $v-selection-item-font-weight;
  193. white-space: nowrap;
  194. position: relative;
  195. &:active:before {
  196. content: "";
  197. position: absolute;
  198. top: 0;
  199. right: 0;
  200. bottom: 0;
  201. left: 0;
  202. $sat: if(saturation($v-selection-item-selection-color) > 0, 50%, 0%);
  203. background: scale-color($v-selection-item-selection-color, $lightness: -30%, $saturation: $sat);
  204. @include opacity(.15);
  205. pointer-events: none;
  206. border-radius: inherit;
  207. }
  208. .v-icon {
  209. max-height: $v-selection-item-height;
  210. margin-right: round($v-selection-item-padding-horizontal/2);
  211. min-width: 1em;
  212. }
  213. }
  214. /**
  215. * Outputs the styles for selected selection item elements.
  216. *
  217. * @group overlay
  218. */
  219. @mixin valo-selection-item-selected-style {
  220. @include valo-gradient($v-selection-item-selection-color);
  221. $font-color: valo-font-color($v-selection-item-selection-color, 0.9);
  222. color: $font-color;
  223. text-shadow: valo-text-shadow($font-color: $font-color, $background-color: $v-selection-item-selection-color);
  224. }
  225. /**
  226. * Outputs the selectors and styles for generic dragging ghost elements.
  227. *
  228. * @group drag-n-drop
  229. */
  230. @mixin valo-drag-element {
  231. .v-drag-element {
  232. @include valo-drag-element-style;
  233. }
  234. }
  235. @mixin valo-draggable {
  236. .v-draggable {
  237. user-select: none !important;
  238. }
  239. }
  240. /**
  241. * Outputs the styles for generic dragging ghost elements.
  242. *
  243. * @group drag-n-drop
  244. *
  245. * @param {color} $background-color ($v-app-background-color) - the background color for the ghost element
  246. */
  247. @mixin valo-drag-element-style ($background-color: $v-app-background-color) {
  248. background: $background-color;
  249. color: valo-font-color($background-color);
  250. @include box-shadow(0 2px 10px rgba(#000, .2));
  251. border-radius: $v-border-radius;
  252. overflow: hidden;
  253. @include opacity(.5);
  254. // This has the unfortunate side-effect of selecting an the table row where the drag is dropped
  255. //pointer-events: none;
  256. }