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.

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