spectrum.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. /***
  2. Spectrum Colorpicker v1.3.0
  3. https://github.com/bgrins/spectrum
  4. Author: Brian Grinstead
  5. License: MIT
  6. ***/
  7. .sp-container {
  8. position:absolute;
  9. top:0;
  10. left:0;
  11. display:inline-block;
  12. *display: inline;
  13. *zoom: 1;
  14. /* https://github.com/bgrins/spectrum/issues/40 */
  15. z-index: 9999994;
  16. overflow: hidden;
  17. }
  18. .sp-container.sp-flat {
  19. position: relative;
  20. }
  21. /* Fix for * { box-sizing: border-box; } */
  22. .sp-container,
  23. .sp-container * {
  24. -webkit-box-sizing: content-box;
  25. -moz-box-sizing: content-box;
  26. box-sizing: content-box;
  27. }
  28. /* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
  29. .sp-top {
  30. position:relative;
  31. width: 100%;
  32. display:inline-block;
  33. }
  34. .sp-top-inner {
  35. position:absolute;
  36. top:0;
  37. left:0;
  38. bottom:0;
  39. right:0;
  40. }
  41. .sp-color {
  42. position: absolute;
  43. top:0;
  44. left:0;
  45. bottom:0;
  46. right:20%;
  47. }
  48. .sp-hue {
  49. position: absolute;
  50. top:0;
  51. right:0;
  52. bottom:0;
  53. left:84%;
  54. height: 100%;
  55. }
  56. .sp-clear-enabled .sp-hue {
  57. top:33px;
  58. height: 77.5%;
  59. }
  60. .sp-fill {
  61. padding-top: 80%;
  62. }
  63. .sp-sat, .sp-val {
  64. position: absolute;
  65. top:0;
  66. left:0;
  67. right:0;
  68. bottom:0;
  69. }
  70. .sp-alpha-enabled .sp-top {
  71. margin-bottom: 18px;
  72. }
  73. .sp-alpha-enabled .sp-alpha {
  74. display: block;
  75. }
  76. .sp-alpha-handle {
  77. position:absolute;
  78. top:-4px;
  79. bottom: -4px;
  80. width: 6px;
  81. left: 50%;
  82. cursor: pointer;
  83. border: 1px solid black;
  84. background: white;
  85. opacity: .8;
  86. }
  87. .sp-alpha {
  88. display: none;
  89. position: absolute;
  90. bottom: -14px;
  91. right: 0;
  92. left: 0;
  93. height: 8px;
  94. }
  95. .sp-alpha-inner {
  96. border: solid 1px #333;
  97. }
  98. .sp-clear {
  99. display: none;
  100. }
  101. .sp-clear.sp-clear-display {
  102. background-position: center;
  103. }
  104. .sp-clear-enabled .sp-clear {
  105. display: block;
  106. position:absolute;
  107. top:0px;
  108. right:0;
  109. bottom:0;
  110. left:84%;
  111. height: 28px;
  112. }
  113. /* Don't allow text selection */
  114. .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
  115. -webkit-user-select:none;
  116. -moz-user-select: -moz-none;
  117. -o-user-select:none;
  118. user-select: none;
  119. }
  120. .sp-container.sp-input-disabled .sp-input-container {
  121. display: none;
  122. }
  123. .sp-container.sp-buttons-disabled .sp-button-container {
  124. display: none;
  125. }
  126. .sp-palette-only .sp-picker-container {
  127. display: none;
  128. }
  129. .sp-palette-disabled .sp-palette-container {
  130. display: none;
  131. }
  132. .sp-initial-disabled .sp-initial {
  133. display: none;
  134. }
  135. /* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
  136. .sp-sat {
  137. background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
  138. background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
  139. background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
  140. background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
  141. background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
  142. background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
  143. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
  144. filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
  145. }
  146. .sp-val {
  147. background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
  148. background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
  149. background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
  150. background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
  151. background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
  152. background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
  153. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
  154. filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
  155. }
  156. .sp-hue {
  157. background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  158. background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  159. background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  160. background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
  161. background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  162. }
  163. /* IE filters do not support multiple color stops.
  164. Generate 6 divs, line them up, and do two color gradients for each.
  165. Yes, really.
  166. */
  167. .sp-1 {
  168. height:17%;
  169. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
  170. }
  171. .sp-2 {
  172. height:16%;
  173. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
  174. }
  175. .sp-3 {
  176. height:17%;
  177. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
  178. }
  179. .sp-4 {
  180. height:17%;
  181. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
  182. }
  183. .sp-5 {
  184. height:16%;
  185. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
  186. }
  187. .sp-6 {
  188. height:17%;
  189. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
  190. }
  191. .sp-hidden {
  192. display: none !important;
  193. }
  194. /* Clearfix hack */
  195. .sp-cf:before, .sp-cf:after { content: ""; display: table; }
  196. .sp-cf:after { clear: both; }
  197. .sp-cf { *zoom: 1; }
  198. /* Mobile devices, make hue slider bigger so it is easier to slide */
  199. @media (max-device-width: 480px) {
  200. .sp-color { right: 40%; }
  201. .sp-hue { left: 63%; }
  202. .sp-fill { padding-top: 60%; }
  203. }
  204. .sp-dragger {
  205. border-radius: 5px;
  206. height: 5px;
  207. width: 5px;
  208. border: 1px solid #fff;
  209. background: #000;
  210. cursor: pointer;
  211. position:absolute;
  212. top:0;
  213. left: 0;
  214. }
  215. .sp-slider {
  216. position: absolute;
  217. top:0;
  218. cursor:pointer;
  219. height: 3px;
  220. left: -1px;
  221. right: -1px;
  222. border: 1px solid #000;
  223. background: white;
  224. opacity: .8;
  225. }
  226. /*
  227. Theme authors:
  228. Here are the basic themeable display options (colors, fonts, global widths).
  229. See http://bgrins.github.io/spectrum/themes/ for instructions.
  230. */
  231. .sp-container {
  232. border-radius: 0;
  233. background-color: #ECECEC;
  234. border: solid 1px #f0c49B;
  235. padding: 0;
  236. }
  237. .sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear
  238. {
  239. font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  240. -webkit-box-sizing: border-box;
  241. -moz-box-sizing: border-box;
  242. -ms-box-sizing: border-box;
  243. box-sizing: border-box;
  244. }
  245. .sp-top
  246. {
  247. margin-bottom: 3px;
  248. }
  249. .sp-color, .sp-hue, .sp-clear
  250. {
  251. border: solid 1px #666;
  252. }
  253. /* Input */
  254. .sp-input-container {
  255. float:right;
  256. width: 100px;
  257. margin-bottom: 4px;
  258. }
  259. .sp-initial-disabled .sp-input-container {
  260. width: 100%;
  261. }
  262. .sp-input {
  263. font-size: 12px !important;
  264. border: 1px inset;
  265. padding: 4px 5px;
  266. margin: 0;
  267. width: 100%;
  268. background:transparent;
  269. border-radius: 3px;
  270. color: #222;
  271. }
  272. .sp-input:focus {
  273. border: 1px solid orange;
  274. }
  275. .sp-input.sp-validation-error
  276. {
  277. border: 1px solid red;
  278. background: #fdd;
  279. }
  280. .sp-picker-container , .sp-palette-container
  281. {
  282. float:left;
  283. position: relative;
  284. padding: 10px;
  285. padding-bottom: 300px;
  286. margin-bottom: -290px;
  287. }
  288. .sp-picker-container
  289. {
  290. width: 172px;
  291. border-left: solid 1px #fff;
  292. }
  293. /* Palettes */
  294. .sp-palette-container
  295. {
  296. border-right: solid 1px #ccc;
  297. }
  298. .sp-palette .sp-thumb-el {
  299. display: block;
  300. position:relative;
  301. float:left;
  302. width: 24px;
  303. height: 15px;
  304. margin: 3px;
  305. cursor: pointer;
  306. border:solid 2px transparent;
  307. }
  308. .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
  309. border-color: orange;
  310. }
  311. .sp-thumb-el
  312. {
  313. position:relative;
  314. }
  315. /* Initial */
  316. .sp-initial
  317. {
  318. float: left;
  319. border: solid 1px #333;
  320. }
  321. .sp-initial span {
  322. width: 30px;
  323. height: 25px;
  324. border:none;
  325. display:block;
  326. float:left;
  327. margin:0;
  328. }
  329. .sp-initial .sp-clear-display {
  330. background-position: center;
  331. }
  332. /* Buttons */
  333. .sp-button-container {
  334. float: right;
  335. }
  336. /* Replacer (the little preview div that shows up instead of the <input>) */
  337. .sp-replacer {
  338. margin:0;
  339. overflow:hidden;
  340. cursor:pointer;
  341. padding: 4px;
  342. display:inline-block;
  343. *zoom: 1;
  344. *display: inline;
  345. border: solid 1px #91765d;
  346. background: #eee;
  347. color: #333;
  348. vertical-align: middle;
  349. }
  350. .sp-replacer:hover, .sp-replacer.sp-active {
  351. border-color: #F0C49B;
  352. color: #111;
  353. }
  354. .sp-replacer.sp-disabled {
  355. cursor:default;
  356. border-color: silver;
  357. color: silver;
  358. }
  359. .sp-dd {
  360. padding: 2px 0;
  361. height: 16px;
  362. line-height: 16px;
  363. float:left;
  364. font-size:10px;
  365. }
  366. .sp-preview
  367. {
  368. position:relative;
  369. width:25px;
  370. height: 20px;
  371. border: solid 1px #222;
  372. margin-right: 5px;
  373. float:left;
  374. z-index: 0;
  375. }
  376. .sp-palette
  377. {
  378. *width: 220px;
  379. max-width: 220px;
  380. }
  381. .sp-palette .sp-thumb-el
  382. {
  383. width:16px;
  384. height: 16px;
  385. margin:2px 1px;
  386. border: solid 1px #d0d0d0;
  387. }
  388. .sp-container
  389. {
  390. padding-bottom:0;
  391. }
  392. /* Buttons: http://hellohappy.org/css3-buttons/ */
  393. .sp-container button {
  394. background-color: #eeeeee;
  395. background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
  396. background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  397. background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
  398. background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
  399. background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
  400. border: 1px solid #ccc;
  401. border-bottom: 1px solid #bbb;
  402. border-radius: 3px;
  403. color: #333;
  404. font-size: 14px;
  405. line-height: 1;
  406. padding: 5px 4px;
  407. text-align: center;
  408. text-shadow: 0 1px 0 #eee;
  409. vertical-align: middle;
  410. }
  411. .sp-container button:hover {
  412. background-color: #dddddd;
  413. background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
  414. background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
  415. background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
  416. background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
  417. background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
  418. border: 1px solid #bbb;
  419. border-bottom: 1px solid #999;
  420. cursor: pointer;
  421. text-shadow: 0 1px 0 #ddd;
  422. }
  423. .sp-container button:active {
  424. border: 1px solid #aaa;
  425. border-bottom: 1px solid #888;
  426. -webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
  427. -moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
  428. -ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
  429. -o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
  430. box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
  431. }
  432. .sp-cancel
  433. {
  434. font-size: 11px;
  435. color: #d93f3f !important;
  436. margin:0;
  437. padding:2px;
  438. margin-right: 5px;
  439. vertical-align: middle;
  440. text-decoration:none;
  441. }
  442. .sp-cancel:hover
  443. {
  444. color: #d93f3f !important;
  445. text-decoration: underline;
  446. }
  447. .sp-palette span:hover, .sp-palette span.sp-thumb-active
  448. {
  449. border-color: #000;
  450. }
  451. .sp-preview, .sp-alpha, .sp-thumb-el
  452. {
  453. position:relative;
  454. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
  455. }
  456. .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner
  457. {
  458. display:block;
  459. position:absolute;
  460. top:0;left:0;bottom:0;right:0;
  461. }
  462. .sp-palette .sp-thumb-inner
  463. {
  464. background-position: 50% 50%;
  465. background-repeat: no-repeat;
  466. }
  467. .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner
  468. {
  469. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
  470. }
  471. .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner
  472. {
  473. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
  474. }
  475. .sp-clear-display {
  476. background-repeat:no-repeat;
  477. background-position: center;
  478. background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
  479. }