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.

_colorpicker.scss 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /**
  2. * Outputs the global selectors and properties for the ColorPicker component - styles which are
  3. * considered mandatory for the component to work properly.
  4. *
  5. * @param {string} $primary-stylename (v-colorpicker) - the primary style name for the selectors
  6. *
  7. * @group colorpicker
  8. */
  9. @mixin valo-colorpicker-global ($primary-stylename: v-colorpicker) {
  10. $valo-colorpicker-pathPrefix: null;
  11. @if $v-relative-paths == false {
  12. $valo-colorpicker-pathPrefix: "../valo/components/";
  13. }
  14. .#{$primary-stylename}-popup.v-window {
  15. min-width: 220px !important;
  16. }
  17. .#{$primary-stylename}-gradient-container {
  18. overflow: visible !important;
  19. }
  20. .#{$primary-stylename}-gradient-clicklayer {
  21. @include opacity(0);
  22. }
  23. .rgb-gradient .#{$primary-stylename}-gradient-background {
  24. background: url(#{$valo-colorpicker-pathPrefix}img/colorpicker/gradient2.png);
  25. }
  26. .hsv-gradient .#{$primary-stylename}-gradient-foreground {
  27. background: url(#{$valo-colorpicker-pathPrefix}img/colorpicker/gradient.png);
  28. }
  29. .#{$primary-stylename}-gradient-higherbox {
  30. &:before {
  31. content: "";
  32. width: 11px;
  33. height: 11px;
  34. border-radius: 7px;
  35. border: 1px solid #fff;
  36. @include box-shadow(0 0 0 1px rgba(0,0,0,.3), inset 0 0 0 1px rgba(0,0,0,.3));
  37. position: absolute;
  38. bottom: -6px;
  39. left: -6px;
  40. }
  41. }
  42. .#{$primary-stylename}-popup .v-slider.v-slider-red:before {
  43. background-color: red;
  44. }
  45. .#{$primary-stylename}-popup .v-slider.v-slider-green:before {
  46. background-color: green;
  47. }
  48. .#{$primary-stylename}-popup .v-slider.v-slider-blue:before {
  49. background-color: blue;
  50. }
  51. .#{$primary-stylename}-popup .v-slider.hue-slider:before {
  52. background: url(#{$valo-colorpicker-pathPrefix}img/colorpicker/slider_hue_bg.png);
  53. }
  54. .#{$primary-stylename}-popup input.v-textfield-dark {
  55. color: #fff;
  56. }
  57. .#{$primary-stylename}-popup input.v-textfield-light {
  58. color: #000;
  59. }
  60. // TODO magic numbers
  61. .#{$primary-stylename}-grid {
  62. height: 319px;
  63. }
  64. .#{$primary-stylename}-popup .colorselect td {
  65. line-height: 15px;
  66. }
  67. }
  68. /**
  69. * Outputs the selectors and properties for the ColorPicker component.
  70. *
  71. * @param {string} $primary-stylename (v-colorpicker) - the primary style name for the selectors
  72. *
  73. * @group colorpicker
  74. */
  75. @mixin valo-colorpicker ($primary-stylename: v-colorpicker) {
  76. .#{$primary-stylename}-popup.v-window {
  77. min-width: 220px !important;
  78. }
  79. .#{$primary-stylename}-popup {
  80. .v-tabsheet-tabs {
  81. padding: 0 round($v-unit-size/4);
  82. }
  83. [class$="sliders"] {
  84. padding: round($v-unit-size/3);
  85. .v-widget {
  86. width: 100% !important;
  87. vertical-align: middle;
  88. }
  89. .v-has-caption {
  90. white-space: nowrap;
  91. padding-left: $v-font-size * 3;
  92. }
  93. .v-caption {
  94. display: inline-block;
  95. margin-left: $v-font-size * -3;
  96. width: $v-font-size * 3;
  97. }
  98. // Saturation caption needs more space
  99. .v-slot-hue-slider + .v-slot {
  100. .v-has-caption {
  101. padding-left: $v-font-size * 5;
  102. }
  103. .v-caption {
  104. margin-left: $v-font-size * -5;
  105. width: $v-font-size * 5;
  106. }
  107. }
  108. }
  109. .v-slider-red .v-slider-base:after {
  110. background: red;
  111. border: none;
  112. @include box-shadow(none);
  113. }
  114. .v-slider-green .v-slider-base:after {
  115. background: green;
  116. border: none;
  117. @include box-shadow(none);
  118. }
  119. .v-slider-blue .v-slider-base:after {
  120. background: blue;
  121. border: none;
  122. @include box-shadow(none);
  123. }
  124. .v-margin-bottom {
  125. padding-bottom: 0;
  126. }
  127. .resize-button {
  128. width: 100% !important;
  129. height: auto !important;
  130. text-align: center;
  131. outline: none;
  132. &:before {
  133. font-family: ThemeIcons;
  134. content: "\f141";
  135. }
  136. }
  137. .resize-button-caption {
  138. display: none;
  139. }
  140. .v-horizontallayout {
  141. height: auto !important;
  142. padding: round($v-unit-size/4) 0;
  143. background-color: $v-background-color;
  144. border-top: first-number($v-border) solid scale-color($v-background-color, $lightness: -5%);
  145. .v-expand {
  146. overflow: visible;
  147. }
  148. .v-button {
  149. width: 80% !important;
  150. }
  151. }
  152. }
  153. .#{$primary-stylename}-preview {
  154. width: 100% !important;
  155. height: auto !important;
  156. padding: round($v-unit-size/4);
  157. }
  158. .#{$primary-stylename}-preview-textfield {
  159. height: auto !important;
  160. text-align: center;
  161. border: none;
  162. }
  163. .#{$primary-stylename} {
  164. width: auto;
  165. }
  166. .#{$primary-stylename}-button-color {
  167. position: absolute;
  168. top: round($v-unit-size/6);
  169. right: round($v-unit-size/6);
  170. bottom: round($v-unit-size/6);
  171. left: round($v-unit-size/6);
  172. border-radius: $v-border-radius - 1px;
  173. border: 1px solid hsla(0, 0%, 0%, .5);
  174. max-width: $v-unit-size - round($v-unit-size/3) - 2px;
  175. + .v-button-caption:not(:empty) {
  176. margin-left: round($v-unit-size/2);
  177. }
  178. .v-ie8 & {
  179. position: relative;
  180. top: auto;
  181. right: auto;
  182. bottom: auto;
  183. left: auto;
  184. width: $v-font-size;
  185. height: $v-font-size;
  186. display: inline-block;
  187. vertical-align: middle;
  188. margin: 0 round($v-font-size / -2);
  189. + .v-button-caption {
  190. margin-left: round($v-unit-size/2);
  191. }
  192. }
  193. }
  194. }