spectrum.css 11 KB

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