_monolith.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. /*! Pickr 1.8.2 MIT | https://github.com/Simonwep/pickr */
  2. .pickr {
  3. position: relative;
  4. overflow: visible;
  5. transform: translateY(0);
  6. * {
  7. box-sizing: border-box;
  8. outline: none;
  9. border: none;
  10. -webkit-appearance: none;
  11. }
  12. .pcr-button {
  13. position: relative;
  14. height: 2em;
  15. width: 2em;
  16. padding: 0.5em;
  17. cursor: pointer;
  18. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  19. border-radius: 0.15em;
  20. background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" stroke="%2342445A" stroke-width="5px" stroke-linecap="round"><path d="M45,45L5,5"></path><path d="M45,5L5,45"></path></svg>')
  21. no-repeat center;
  22. background-size: 0;
  23. transition: all 0.3s;
  24. &::before {
  25. position: absolute;
  26. content: "";
  27. inset-block-start: 0;
  28. inset-inline-start: 0;
  29. width: 100%;
  30. height: 100%;
  31. background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');
  32. background-size: 0.5em;
  33. border-radius: 0.15em;
  34. z-index: -1;
  35. z-index: initial;
  36. }
  37. &::after {
  38. position: absolute;
  39. content: "";
  40. inset-block-start: 0;
  41. inset-inline-start: 0;
  42. height: 100%;
  43. width: 100%;
  44. transition: background 0.3s;
  45. background: var(--pcr-color);
  46. border-radius: 0.15em;
  47. }
  48. &.clear {
  49. background-size: 70%;
  50. &::before {
  51. opacity: 0;
  52. }
  53. &:focus {
  54. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px var(--pcr-color);
  55. }
  56. }
  57. &.disabled {
  58. cursor: not-allowed;
  59. }
  60. }
  61. * {
  62. box-sizing: border-box;
  63. outline: none;
  64. border: none;
  65. -webkit-appearance: none;
  66. }
  67. }
  68. .pcr-app * {
  69. box-sizing: border-box;
  70. outline: none;
  71. border: none;
  72. -webkit-appearance: none;
  73. }
  74. .pickr {
  75. input {
  76. &:focus,
  77. &.pcr-active {
  78. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px var(--pcr-color);
  79. }
  80. }
  81. button {
  82. &:focus,
  83. &.pcr-active {
  84. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px var(--pcr-color);
  85. }
  86. }
  87. }
  88. .pcr-app {
  89. input {
  90. &:focus,
  91. &.pcr-active {
  92. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px var(--pcr-color);
  93. }
  94. }
  95. button {
  96. &:focus,
  97. &.pcr-active {
  98. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px var(--pcr-color);
  99. }
  100. }
  101. }
  102. .pickr {
  103. .pcr-palette,
  104. .pcr-slider {
  105. transition: box-shadow 0.3s;
  106. }
  107. }
  108. .pcr-app {
  109. .pcr-palette,
  110. .pcr-slider {
  111. transition: box-shadow 0.3s;
  112. }
  113. }
  114. .pickr {
  115. .pcr-palette:focus,
  116. .pcr-slider:focus {
  117. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(0, 0, 0, 0.25);
  118. }
  119. }
  120. .pcr-app {
  121. .pcr-palette:focus,
  122. .pcr-slider:focus {
  123. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(0, 0, 0, 0.25);
  124. }
  125. position: fixed;
  126. display: flex;
  127. flex-direction: column;
  128. z-index: 10000;
  129. border-radius: 0.1em;
  130. background: #fff;
  131. opacity: 0;
  132. visibility: hidden;
  133. transition: opacity 0.3s, visibility 0s 0.3s;
  134. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  135. box-shadow: 0 0.15em 1.5em 0 rgba(0, 0, 0, 0.1), 0 0 1em 0 rgba(0, 0, 0, 0.03);
  136. inset-inline-start: 0;
  137. inset-block-start: 0;
  138. &.visible {
  139. transition: opacity 0.3s;
  140. visibility: visible;
  141. opacity: 1;
  142. }
  143. .pcr-swatches {
  144. display: flex;
  145. flex-wrap: wrap;
  146. margin-block-start: 0.75em;
  147. &.pcr-last {
  148. margin: 0;
  149. }
  150. > button {
  151. font-size: 1em;
  152. position: relative;
  153. width: calc(1.75em - 5px);
  154. height: calc(1.75em - 5px);
  155. border-radius: 0.15em;
  156. cursor: pointer;
  157. margin: 2.5px;
  158. flex-shrink: 0;
  159. justify-self: center;
  160. transition: all 0.15s;
  161. overflow: hidden;
  162. background: transparent;
  163. z-index: 1;
  164. &::before {
  165. position: absolute;
  166. content: "";
  167. inset-block-start: 0;
  168. inset-inline-start: 0;
  169. width: 100%;
  170. height: 100%;
  171. background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');
  172. background-size: 6px;
  173. border-radius: 0.15em;
  174. z-index: -1;
  175. }
  176. &::after {
  177. content: "";
  178. position: absolute;
  179. inset-block-start: 0;
  180. inset-inline-start: 0;
  181. width: 100%;
  182. height: 100%;
  183. background: var(--pcr-color);
  184. border: 1px solid rgba(0, 0, 0, 0.05);
  185. border-radius: 0.15em;
  186. box-sizing: border-box;
  187. }
  188. &:hover {
  189. filter: brightness(1.05);
  190. }
  191. &:not(.pcr-active) {
  192. box-shadow: none;
  193. }
  194. }
  195. }
  196. .pcr-interaction {
  197. display: flex;
  198. flex-wrap: wrap;
  199. align-items: center;
  200. margin: 0 -0.2em 0 -0.2em;
  201. > * {
  202. margin: 0 0.2em;
  203. }
  204. input {
  205. letter-spacing: 0.07em;
  206. font-size: 0.75em;
  207. text-align: center;
  208. cursor: pointer;
  209. color: #75797e;
  210. background: #f1f3f4;
  211. border-radius: 0.15em;
  212. transition: all 0.15s;
  213. padding: 0.45em 0.5em;
  214. margin-block-start: 0.75em;
  215. &:hover {
  216. filter: brightness(0.975);
  217. }
  218. &:focus {
  219. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(66, 133, 244, 0.75);
  220. }
  221. }
  222. .pcr-result {
  223. color: #75797e;
  224. text-align: start;
  225. flex: 1 1 8em;
  226. min-width: 8em;
  227. transition: all 0.2s;
  228. border-radius: 0.15em;
  229. background: #f1f3f4;
  230. cursor: text;
  231. &::-moz-selection,
  232. &::selection {
  233. background: #4285f4;
  234. color: #fff;
  235. }
  236. }
  237. .pcr-type.active {
  238. color: #fff;
  239. background: #4285f4;
  240. }
  241. .pcr-save,
  242. .pcr-cancel,
  243. .pcr-clear {
  244. color: #fff;
  245. width: auto;
  246. }
  247. .pcr-save,
  248. .pcr-cancel,
  249. .pcr-clear {
  250. color: #fff;
  251. }
  252. .pcr-save:hover,
  253. .pcr-cancel:hover,
  254. .pcr-clear:hover {
  255. filter: brightness(0.925);
  256. }
  257. .pcr-save {
  258. background: #4285f4;
  259. }
  260. .pcr-clear,
  261. .pcr-cancel {
  262. background: #f44250;
  263. }
  264. .pcr-clear:focus,
  265. .pcr-cancel:focus {
  266. box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0 3px rgba(244, 66, 80, 0.75);
  267. }
  268. }
  269. .pcr-selection {
  270. .pcr-picker {
  271. position: absolute;
  272. height: 18px;
  273. width: 18px;
  274. border: 2px solid #fff;
  275. border-radius: 100%;
  276. -webkit-user-select: none;
  277. -moz-user-select: none;
  278. -ms-user-select: none;
  279. user-select: none;
  280. }
  281. .pcr-color-palette,
  282. .pcr-color-chooser,
  283. .pcr-color-opacity {
  284. position: relative;
  285. -webkit-user-select: none;
  286. -moz-user-select: none;
  287. -ms-user-select: none;
  288. user-select: none;
  289. display: flex;
  290. flex-direction: column;
  291. cursor: grab;
  292. cursor: -webkit-grab;
  293. }
  294. .pcr-color-palette:active,
  295. .pcr-color-chooser:active,
  296. .pcr-color-opacity:active {
  297. cursor: grabbing;
  298. cursor: -webkit-grabbing;
  299. }
  300. }
  301. &[data-theme="monolith"] {
  302. width: 14.25em;
  303. max-width: 95vw;
  304. padding: 0.8em;
  305. .pcr-selection {
  306. display: flex;
  307. flex-direction: column;
  308. justify-content: space-between;
  309. flex-grow: 1;
  310. .pcr-color-preview {
  311. position: relative;
  312. z-index: 1;
  313. width: 100%;
  314. height: 1em;
  315. display: flex;
  316. flex-direction: row;
  317. justify-content: space-between;
  318. margin-block-end: 0.5em;
  319. &::before {
  320. position: absolute;
  321. content: "";
  322. inset-block-start: 0;
  323. inset-inline-start: 0;
  324. width: 100%;
  325. height: 100%;
  326. background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');
  327. background-size: 0.5em;
  328. border-radius: 0.15em;
  329. z-index: -1;
  330. }
  331. .pcr-last-color {
  332. cursor: pointer;
  333. transition: background-color 0.3s, box-shadow 0.3s;
  334. border-radius: 0.15em 0 0 0.15em;
  335. z-index: 2;
  336. }
  337. .pcr-current-color {
  338. border-radius: 0 0.15em 0.15em 0;
  339. }
  340. .pcr-last-color,
  341. .pcr-current-color {
  342. background: var(--pcr-color);
  343. width: 50%;
  344. height: 100%;
  345. }
  346. }
  347. .pcr-color-palette {
  348. width: 100%;
  349. height: 8em;
  350. z-index: 1;
  351. .pcr-palette {
  352. border-radius: 0.15em;
  353. width: 100%;
  354. height: 100%;
  355. &::before {
  356. position: absolute;
  357. content: "";
  358. inset-block-start: 0;
  359. inset-inline-start: 0;
  360. width: 100%;
  361. height: 100%;
  362. background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');
  363. background-size: 0.5em;
  364. border-radius: 0.15em;
  365. z-index: -1;
  366. }
  367. }
  368. }
  369. .pcr-color-chooser,
  370. .pcr-color-opacity {
  371. height: 0.5em;
  372. margin-block-start: 0.75em;
  373. }
  374. .pcr-color-chooser .pcr-picker,
  375. .pcr-color-opacity .pcr-picker {
  376. inset-block-start: 50%;
  377. transform: translateY(-50%);
  378. }
  379. .pcr-color-chooser .pcr-slider,
  380. .pcr-color-opacity .pcr-slider {
  381. flex-grow: 1;
  382. border-radius: 50em;
  383. }
  384. .pcr-color-chooser .pcr-slider {
  385. background: linear-gradient(to right, red, #ff0, lime, cyan, blue, #f0f, red);
  386. }
  387. .pcr-color-opacity .pcr-slider {
  388. background: linear-gradient(to right, transparent, black),
  389. url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="white" d="M1,0H2V1H1V0ZM0,1H1V2H0V1Z"/><path fill="gray" d="M0,0H1V1H0V0ZM1,1H2V2H1V1Z"/></svg>');
  390. background-size: 100%, 0.25em;
  391. }
  392. }
  393. }
  394. }
  395. @supports (display: grid) {
  396. .pcr-app .pcr-swatches {
  397. display: grid;
  398. align-items: center;
  399. grid-template-columns: repeat(auto-fit, 1.75em);
  400. }
  401. }