spectrum.css 14 KB

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