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.

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