colorPicker.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. .color-picker-container {
  2. width: 320px;
  3. height: 300px;
  4. background-color: white;
  5. display: grid;
  6. grid-template-columns: 100%;
  7. grid-template-rows: 50% 50px 60px 40px 1fr;
  8. font-family: "acumin-pro-condensed";
  9. font-weight: normal;
  10. font-size: 14px;
  11. .color-picker-saturation {
  12. grid-row: 1;
  13. grid-column: 1;
  14. display: grid;
  15. grid-template-columns: 100%;
  16. grid-template-rows: 100%;
  17. position: relative;
  18. cursor: pointer;
  19. .color-picker-saturation-white {
  20. grid-row: 1;
  21. grid-column: 1;
  22. background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
  23. background: linear-gradient(to right, #fff, rgba(255,255,255,0));
  24. }
  25. .color-picker-saturation-black {
  26. grid-row: 1;
  27. grid-column: 1;
  28. background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
  29. background: linear-gradient(to top, #000, rgba(0,0,0,0));
  30. }
  31. .color-picker-saturation-cursor {
  32. pointer-events: none;
  33. width: 4px;
  34. height: 4px;
  35. box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3), 0 0 1px 2px rgba(0,0,0,.4);
  36. border-radius: 50%;
  37. transform: translate(-2px, -2px);
  38. position: absolute;
  39. }
  40. }
  41. .color-picker-hue {
  42. grid-row: 2;
  43. grid-column: 1;
  44. display: grid;
  45. margin: 10px;
  46. grid-template-columns: 24% 76%;
  47. grid-template-rows: 100%;
  48. .color-picker-hue-color {
  49. grid-row: 1;
  50. grid-column: 1;
  51. align-self: center;
  52. justify-self: center;
  53. width: 30px;
  54. height: 30px;
  55. border-radius: 15px;
  56. border: 1px solid black;
  57. }
  58. .color-picker-hue-slider {
  59. grid-row: 1;
  60. grid-column: 2;
  61. align-self: center;
  62. height: 16px;
  63. position: relative;
  64. cursor: pointer;
  65. background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
  66. 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  67. background: -webkit-linear-gradient(to right, #f00 0%, #ff0
  68. 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  69. .color-picker-hue-cursor {
  70. pointer-events: none;
  71. width: 8px;
  72. height: 18px;
  73. transform: translate(-4px, -2px);
  74. background-color: rgb(248, 248, 248);
  75. box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
  76. position: absolute;
  77. }
  78. }
  79. }
  80. .color-picker-component {
  81. display: grid;
  82. margin: 5px;
  83. grid-template-columns: 100%;
  84. grid-template-rows: 50% 50%;
  85. .color-picker-component-value {
  86. justify-self: center;
  87. align-self: center;
  88. grid-row: 1;
  89. grid-column: 1;
  90. margin-bottom: 4px;
  91. input {
  92. width: 50px;
  93. }
  94. }
  95. .color-picker-component-label {
  96. justify-self: center;
  97. align-self: center;
  98. grid-row: 2;
  99. grid-column: 1;
  100. color:black;
  101. }
  102. }
  103. .color-picker-rgb {
  104. grid-row: 3;
  105. grid-column: 1;
  106. display: grid;
  107. margin: 10px;
  108. grid-template-columns: 20% 6.66% 20% 6.66% 20% 6.66% 20%;
  109. grid-template-rows: 100%;
  110. }
  111. .red {
  112. grid-row: 1;
  113. grid-column: 1;
  114. }
  115. .green {
  116. grid-row: 1;
  117. grid-column: 3;
  118. }
  119. .blue {
  120. grid-row: 1;
  121. grid-column: 5;
  122. }
  123. .alpha {
  124. grid-row: 1;
  125. grid-column: 7;
  126. &.grayed {
  127. opacity: 0.5;
  128. }
  129. }
  130. .color-picker-hex {
  131. grid-row: 4;
  132. grid-column: 1;
  133. display: grid;
  134. grid-template-columns: 20% 80%;
  135. grid-template-rows: 100%;
  136. .color-picker-hex-label {
  137. justify-self: center;
  138. align-self: center;
  139. grid-row: 1;
  140. grid-column: 1;
  141. margin-left: 10px;
  142. color:black;
  143. }
  144. .color-picker-hex-value {
  145. justify-self: left;
  146. align-self: center;
  147. grid-row: 1;
  148. grid-column: 2;
  149. margin-left: 10px;
  150. margin-right: 10px;
  151. input {
  152. width: 70px;
  153. }
  154. }
  155. }
  156. }