You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

559 lines
11 KiB

11 years ago
11 years ago
11 years ago
11 years ago
  1. /*
  2. * # Semantic - Form
  3. * http://github.com/jlukic/semantic-ui/
  4. *
  5. *
  6. * Copyright 2013 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. /*******************************
  12. Standard
  13. *******************************/
  14. /*--------------------
  15. Form
  16. ---------------------*/
  17. .ui.form {
  18. position: relative;
  19. max-width: 100%;
  20. }
  21. .ui.form :first-child {
  22. margin-top: 0em;
  23. }
  24. .ui.form :last-child {
  25. margin-bottom: 0em;
  26. }
  27. /*--------------------
  28. Content
  29. ---------------------*/
  30. .ui.form > p {
  31. margin: 1em 0;
  32. }
  33. /*--------------------
  34. Field
  35. ---------------------*/
  36. .ui.form .field {
  37. clear: both;
  38. margin: 0em 0em 1em;
  39. }
  40. /*--------------------
  41. Labels
  42. ---------------------*/
  43. .ui.form .field > label {
  44. margin: 0em 0em 0.3em;
  45. display: block;
  46. color: #555555;
  47. font-size: 0.875em;
  48. }
  49. /*--------------------
  50. Standard Inputs
  51. ---------------------*/
  52. .ui.form textarea,
  53. .ui.form input[type="text"],
  54. .ui.form input[type="email"],
  55. .ui.form input[type="date"],
  56. .ui.form input[type="password"],
  57. .ui.form input[type="number"],
  58. .ui.form input[type="url"],
  59. .ui.form input[type="tel"],
  60. .ui.form .ui.input {
  61. width: 100%;
  62. }
  63. .ui.form textarea,
  64. .ui.form input[type="text"],
  65. .ui.form input[type="email"],
  66. .ui.form input[type="date"],
  67. .ui.form input[type="password"],
  68. .ui.form input[type="number"],
  69. .ui.form input[type="url"],
  70. .ui.form input[type="tel"] {
  71. margin: 0em;
  72. padding: 0.85em 1.2em;
  73. font-size: 0.875em;
  74. background-color: #FFFFFF;
  75. border: 1px solid rgba(0, 0, 0, 0.15);
  76. outline: none;
  77. color: rgba(0, 0, 0, 0.7);
  78. border-radius: 0.3125em;
  79. -webkit-transition: background-color 0.3s ease-out, -webkit-box-shadow 0.2s ease, border-color 0.2s ease;
  80. transition: background-color 0.3s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
  81. -webkit-box-shadow: 0em 0em 0em 0em rgba(0, 0, 0, 0.3) inset;
  82. box-shadow: 0em 0em 0em 0em rgba(0, 0, 0, 0.3) inset;
  83. -webkit-appearance: none;
  84. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  85. -webkit-box-sizing: border-box;
  86. -moz-box-sizing: border-box;
  87. -ms-box-sizing: border-box;
  88. box-sizing: border-box;
  89. }
  90. .ui.textarea,
  91. .ui.form textarea {
  92. line-height: 1.33;
  93. min-height: 8em;
  94. height: 12em;
  95. max-height: 24em;
  96. resize: vertical;
  97. }
  98. .ui.form textarea,
  99. .ui.form input[type="checkbox"] {
  100. vertical-align: top;
  101. }
  102. /*--------------------
  103. Dividers
  104. ---------------------*/
  105. .ui.form .divider {
  106. clear: both;
  107. margin: 1em 0em;
  108. }
  109. /*--------------------
  110. Types of Messages
  111. ---------------------*/
  112. .ui.form .info.message,
  113. .ui.form .warning.message,
  114. .ui.form .error.message {
  115. display: none;
  116. }
  117. /* Assumptions */
  118. .ui.form .message:first-child {
  119. margin-top: 0px;
  120. }
  121. /*--------------------
  122. Validation Prompt
  123. ---------------------*/
  124. .ui.form .field .prompt.label {
  125. white-space: nowrap;
  126. }
  127. .ui.form .inline.field .prompt {
  128. margin-top: 0em;
  129. margin-right: 1em;
  130. }
  131. .ui.form .inline.field .prompt:before {
  132. margin-top: -0.3em;
  133. bottom: auto;
  134. left: auto;
  135. top: 50%;
  136. right: 0em;
  137. }
  138. /*******************************
  139. States
  140. *******************************/
  141. /*--------------------
  142. Focus
  143. ---------------------*/
  144. .ui.form input[type="text"]:focus,
  145. .ui.form input[type="email"]:focus,
  146. .ui.form input[type="date"]:focus,
  147. .ui.form input[type="password"]:focus,
  148. .ui.form input[type="number"]:focus,
  149. .ui.form input[type="url"]:focus,
  150. .ui.form input[type="tel"]:focus,
  151. .ui.form textarea:focus {
  152. color: rgba(0, 0, 0, 0.85);
  153. border-color: rgba(0, 0, 0, 0.2);
  154. border-bottom-right-radius: 0;
  155. border-top-right-radius: 0;
  156. -webkit-appearance: none;
  157. -webkit-box-shadow: 0.3em 0em 0em 0em rgba(0, 0, 0, 0.2) inset;
  158. box-shadow: 0.3em 0em 0em 0em rgba(0, 0, 0, 0.2) inset;
  159. }
  160. /*--------------------
  161. Error
  162. ---------------------*/
  163. /* On Form */
  164. .ui.form.warning .warning.message {
  165. display: block;
  166. }
  167. /*--------------------
  168. Warning
  169. ---------------------*/
  170. /* On Form */
  171. .ui.form.error .error.message {
  172. display: block;
  173. }
  174. /* On Field(s) */
  175. .ui.form .fields.error .field label,
  176. .ui.form .field.error label,
  177. .ui.form .fields.error .field .input,
  178. .ui.form .field.error .input {
  179. color: #D95C5C;
  180. }
  181. .ui.form .fields.error .field .corner.label,
  182. .ui.form .field.error .corner.label {
  183. border-color: #D95C5C;
  184. color: #FFFFFF;
  185. }
  186. .ui.form .fields.error .field textarea,
  187. .ui.form .fields.error .field input[type="text"],
  188. .ui.form .fields.error .field input[type="email"],
  189. .ui.form .fields.error .field input[type="date"],
  190. .ui.form .fields.error .field input[type="password"],
  191. .ui.form .fields.error .field input[type="number"],
  192. .ui.form .fields.error .field input[type="url"],
  193. .ui.form .fields.error .field input[type="tel"],
  194. .ui.form .field.error textarea,
  195. .ui.form .field.error input[type="text"],
  196. .ui.form .field.error input[type="email"],
  197. .ui.form .field.error input[type="date"],
  198. .ui.form .field.error input[type="password"],
  199. .ui.form .field.error input[type="number"],
  200. .ui.form .field.error input[type="url"],
  201. .ui.form .field.error input[type="tel"] {
  202. background-color: #FFFAFA;
  203. border-color: #E7BEBE;
  204. border-right: none;
  205. color: #D95C5C;
  206. padding-right: 1.2em;
  207. border-bottom-right-radius: 0;
  208. border-top-right-radius: 0;
  209. -webkit-box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
  210. box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
  211. }
  212. .ui.form .field.error textarea:focus,
  213. .ui.form .field.error input[type="text"]:focus,
  214. .ui.form .field.error input[type="email"]:focus,
  215. .ui.form .field.error input[type="date"]:focus,
  216. .ui.form .field.error input[type="password"]:focus,
  217. .ui.form .field.error input[type="number"]:focus,
  218. .ui.form .field.error input[type="url"]:focus,
  219. .ui.form .field.error input[type="tel"]:focus {
  220. border-color: #ff5050;
  221. color: #ff5050;
  222. -webkit-appearance: none;
  223. -webkit-box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
  224. box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
  225. }
  226. /*--------------------
  227. Empty (Placeholder)
  228. ---------------------*/
  229. /* browsers require these rules separate */
  230. .ui.form ::-webkit-input-placeholder {
  231. color: #AAAAAA;
  232. }
  233. .ui.form ::-moz-placeholder {
  234. color: #AAAAAA;
  235. }
  236. .ui.form :focus::-webkit-input-placeholder {
  237. color: #999999;
  238. }
  239. .ui.form :focus::-moz-placeholder {
  240. color: #999999;
  241. }
  242. /* Error Placeholder */
  243. .ui.form .error ::-webkit-input-placeholder {
  244. color: rgba(255, 80, 80, 0.4);
  245. }
  246. .ui.form .error ::-moz-placeholder {
  247. color: rgba(255, 80, 80, 0.4);
  248. }
  249. .ui.form .error :focus::-webkit-input-placeholder {
  250. color: rgba(255, 80, 80, 0.7);
  251. }
  252. .ui.form .error :focus::-moz-placeholder {
  253. color: rgba(255, 80, 80, 0.7);
  254. }
  255. /*--------------------
  256. Disabled
  257. ---------------------*/
  258. .ui.form .field :disabled,
  259. .ui.form .field.disabled {
  260. opacity: 0.5;
  261. }
  262. .ui.form .field.disabled label {
  263. opacity: 0.5;
  264. }
  265. .ui.form .field.disabled :disabled {
  266. opacity: 1;
  267. }
  268. /*--------------------
  269. Loading State
  270. ---------------------*/
  271. /* On Form */
  272. .ui.form.loading {
  273. position: relative;
  274. }
  275. .ui.form.loading:after {
  276. position: absolute;
  277. top: 0%;
  278. right: 0%;
  279. content: '';
  280. width: 100%;
  281. height: 100%;
  282. background: rgba(255, 255, 255, 0.8) url(../images/loader-large.gif) no-repeat 50% 50%;
  283. visibility: visible;
  284. }
  285. /*******************************
  286. Variations
  287. *******************************/
  288. /*--------------------
  289. Fluid Width
  290. ---------------------*/
  291. .ui.form.fluid {
  292. width: 100%;
  293. -webkit-box-sizing: border-box;
  294. -moz-box-sizing: border-box;
  295. -ms-box-sizing: border-box;
  296. box-sizing: border-box;
  297. }
  298. /*--------------------------
  299. Input w/ attached Button
  300. ---------------------------*/
  301. .ui.form input.attached {
  302. width: auto;
  303. }
  304. /*--------------------
  305. Date Input
  306. ---------------------*/
  307. .ui.form .date.field > label {
  308. position: relative;
  309. }
  310. .ui.form .date.field > label:after {
  311. position: absolute;
  312. top: 2em;
  313. left: 0.5em;
  314. font-family: 'Icons';
  315. content: '\f133';
  316. font-size: 1.2em;
  317. font-weight: normal;
  318. color: #CCCCCC;
  319. }
  320. /*--------------------
  321. Inverted Colors
  322. ---------------------*/
  323. .ui.inverted.form label {
  324. color: #FFFFFF;
  325. }
  326. .ui.inverted.form .field.error textarea,
  327. .ui.inverted.form .field.error input[type="text"],
  328. .ui.inverted.form .field.error input[type="email"],
  329. .ui.inverted.form .field.error input[type="date"],
  330. .ui.inverted.form .field.error input[type="password"],
  331. .ui.inverted.form .field.error input[type="number"],
  332. .ui.inverted.form .field.error input[type="url"],
  333. .ui.inverted.form .field.error input[type="tel"] {
  334. background-color: #FFCCCC;
  335. }
  336. /*--------------------
  337. Field Groups
  338. ---------------------*/
  339. /* Grouped Vertically */
  340. .ui.form .grouped.fields {
  341. margin: 0em 0em 1em;
  342. }
  343. .ui.form .grouped.fields .field {
  344. display: block;
  345. float: none;
  346. margin: 0.5em 0em;
  347. padding: 0em;
  348. }
  349. /*--------------------
  350. Fields
  351. ---------------------*/
  352. /* Split fields */
  353. .ui.form .fields {
  354. clear: both;
  355. }
  356. .ui.form .fields:after {
  357. content: ' ';
  358. display: block;
  359. clear: both;
  360. visibility: hidden;
  361. line-height: 0;
  362. height: 0;
  363. }
  364. .ui.form .fields > .field {
  365. clear: none;
  366. float: right;
  367. -webkit-box-sizing: border-box;
  368. -moz-box-sizing: border-box;
  369. -ms-box-sizing: border-box;
  370. box-sizing: border-box;
  371. }
  372. .ui.form .fields > .field:first-child {
  373. border-right: none;
  374. -webkit-box-shadow: none;
  375. box-shadow: none;
  376. }
  377. /* Other Combinations */
  378. .ui.form .two.fields > .fields,
  379. .ui.form .two.fields > .field {
  380. width: 50%;
  381. padding-right: 1%;
  382. padding-left: 1%;
  383. }
  384. .ui.form .three.fields > .fields,
  385. .ui.form .three.fields > .field {
  386. width: 33.333%;
  387. padding-right: 1%;
  388. padding-left: 1%;
  389. }
  390. .ui.form .four.fields > .fields,
  391. .ui.form .four.fields > .field {
  392. width: 25%;
  393. padding-right: 1%;
  394. padding-left: 1%;
  395. }
  396. .ui.form .five.fields > .fields,
  397. .ui.form .five.fields > .field {
  398. width: 20%;
  399. padding-right: 1%;
  400. padding-left: 1%;
  401. }
  402. .ui.form .fields .field:first-child {
  403. padding-right: 0%;
  404. }
  405. .ui.form .fields .field:last-child {
  406. padding-left: 0%;
  407. }
  408. /*--------------------
  409. Inline Fields
  410. ---------------------*/
  411. .ui.form .inline.fields .field {
  412. min-height: 1.3em;
  413. margin-left: 0.5em;
  414. }
  415. .ui.form .inline.fields .field > label,
  416. .ui.form .inline.fields .field > p,
  417. .ui.form .inline.fields .field > input,
  418. .ui.form .inline.field > label,
  419. .ui.form .inline.field > p,
  420. .ui.form .inline.field > input {
  421. display: inline-block;
  422. width: auto;
  423. margin-top: 0em;
  424. margin-bottom: 0em;
  425. vertical-align: middle;
  426. font-size: 1em;
  427. }
  428. .ui.form .inline.fields .field > input,
  429. .ui.form .inline.field > input {
  430. font-size: 0.875em;
  431. }
  432. .ui.form .inline.fields .field > :first-child,
  433. .ui.form .inline.field > :first-child {
  434. margin: 0em 0em 0em 0.5em;
  435. }
  436. .ui.form .inline.fields .field > :only-child,
  437. .ui.form .inline.field > :only-child {
  438. margin: 0em;
  439. }
  440. /*--------------------
  441. Sizes
  442. ---------------------*/
  443. /* Standard */
  444. .ui.small.form {
  445. font-size: 0.875em;
  446. }
  447. .ui.small.form textarea,
  448. .ui.small.form input[type="text"],
  449. .ui.small.form input[type="email"],
  450. .ui.small.form input[type="date"],
  451. .ui.small.form input[type="password"],
  452. .ui.small.form input[type="number"],
  453. .ui.small.form input[type="url"],
  454. .ui.small.form input[type="tel"],
  455. .ui.small.form label {
  456. font-size: 1em;
  457. }
  458. /* Large */
  459. .ui.large.form {
  460. font-size: 1.125em;
  461. }