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.

625 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.65em 1em;
  73. font-size: 1em;
  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. Dropdown Selection Warning
  228. -----------------------------*/
  229. .ui.form .fields.error .field .ui.dropdown,
  230. .ui.form .fields.error .field .ui.dropdown .item,
  231. .ui.form .field.error .ui.dropdown,
  232. .ui.form .field.error .ui.dropdown .item {
  233. background-color: #FFFAFA;
  234. color: #D95C5C;
  235. }
  236. .ui.form .fields.error .field .ui.dropdown,
  237. .ui.form .field.error .ui.dropdown {
  238. -webkit-box-shadow: 0px 0px 0px 1px #E7BEBE !important;
  239. box-shadow: 0px 0px 0px 1px #E7BEBE !important;
  240. }
  241. .ui.form .fields.error .field .ui.dropdown:hover,
  242. .ui.form .field.error .ui.dropdown:hover {
  243. -webkit-box-shadow: 0px 0px 0px 1px #E7BEBE !important;
  244. box-shadow: 0px 0px 0px 1px #E7BEBE !important;
  245. }
  246. .ui.form .fields.error .field .ui.dropdown:hover .menu,
  247. .ui.form .field.error .ui.dropdown:hover .menu {
  248. -webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
  249. box-shadow: 0px 1px 0px 1px #E7BEBE;
  250. }
  251. .ui.form .fields.error .field .ui.dropdown .menu .item:hover,
  252. .ui.form .field.error .ui.dropdown .menu .item:hover {
  253. background-color: #FFF2F2;
  254. }
  255. .ui.form .fields.error .field .ui.dropdown .menu .active.item,
  256. .ui.form .field.error .ui.dropdown .menu .active.item {
  257. background-color: #FDCFCF !important;
  258. }
  259. /*--------------------
  260. Empty (Placeholder)
  261. ---------------------*/
  262. /* browsers require these rules separate */
  263. .ui.form ::-webkit-input-placeholder {
  264. color: #AAAAAA;
  265. }
  266. .ui.form ::-moz-placeholder {
  267. color: #AAAAAA;
  268. }
  269. .ui.form :focus::-webkit-input-placeholder {
  270. color: #999999;
  271. }
  272. .ui.form :focus::-moz-placeholder {
  273. color: #999999;
  274. }
  275. /* Error Placeholder */
  276. .ui.form .error ::-webkit-input-placeholder {
  277. color: rgba(255, 80, 80, 0.4);
  278. }
  279. .ui.form .error ::-moz-placeholder {
  280. color: rgba(255, 80, 80, 0.4);
  281. }
  282. .ui.form .error :focus::-webkit-input-placeholder {
  283. color: rgba(255, 80, 80, 0.7);
  284. }
  285. .ui.form .error :focus::-moz-placeholder {
  286. color: rgba(255, 80, 80, 0.7);
  287. }
  288. /*--------------------
  289. Disabled
  290. ---------------------*/
  291. .ui.form .field :disabled,
  292. .ui.form .field.disabled {
  293. opacity: 0.5;
  294. }
  295. .ui.form .field.disabled label {
  296. opacity: 0.5;
  297. }
  298. .ui.form .field.disabled :disabled {
  299. opacity: 1;
  300. }
  301. /*--------------------
  302. Loading State
  303. ---------------------*/
  304. /* On Form */
  305. .ui.form.loading {
  306. position: relative;
  307. }
  308. .ui.form.loading:after {
  309. position: absolute;
  310. top: 0%;
  311. right: 0%;
  312. content: '';
  313. width: 100%;
  314. height: 100%;
  315. background: rgba(255, 255, 255, 0.8) url(../images/loader-large.gif) no-repeat 50% 50%;
  316. visibility: visible;
  317. }
  318. /*******************************
  319. Variations
  320. *******************************/
  321. /*--------------------
  322. Fluid Width
  323. ---------------------*/
  324. .ui.form.fluid {
  325. width: 100%;
  326. -webkit-box-sizing: border-box;
  327. -moz-box-sizing: border-box;
  328. -ms-box-sizing: border-box;
  329. box-sizing: border-box;
  330. }
  331. /*--------------------------
  332. Input w/ attached Button
  333. ---------------------------*/
  334. .ui.form input.attached {
  335. width: auto;
  336. }
  337. /*--------------------
  338. Date Input
  339. ---------------------*/
  340. .ui.form .date.field > label {
  341. position: relative;
  342. }
  343. .ui.form .date.field > label:after {
  344. position: absolute;
  345. top: 2em;
  346. left: 0.5em;
  347. font-family: 'Icons';
  348. content: '\f133';
  349. font-size: 1.2em;
  350. font-weight: normal;
  351. color: #CCCCCC;
  352. }
  353. /*--------------------
  354. Inverted Colors
  355. ---------------------*/
  356. .ui.inverted.form label {
  357. color: #FFFFFF;
  358. }
  359. .ui.inverted.form .field.error textarea,
  360. .ui.inverted.form .field.error input[type="text"],
  361. .ui.inverted.form .field.error input[type="email"],
  362. .ui.inverted.form .field.error input[type="date"],
  363. .ui.inverted.form .field.error input[type="password"],
  364. .ui.inverted.form .field.error input[type="number"],
  365. .ui.inverted.form .field.error input[type="url"],
  366. .ui.inverted.form .field.error input[type="tel"] {
  367. background-color: #FFCCCC;
  368. }
  369. .ui.inverted.form .ui.checkbox label {
  370. color: rgba(255, 255, 255, 0.8);
  371. }
  372. .ui.inverted.form .ui.checkbox label:hover,
  373. .ui.inverted.form .ui.checkbox .box:hover {
  374. color: #FFFFFF;
  375. }
  376. /*--------------------
  377. Field Groups
  378. ---------------------*/
  379. /* Grouped Vertically */
  380. .ui.form .grouped.fields {
  381. margin: 0em 0em 1em;
  382. }
  383. .ui.form .grouped.fields .field {
  384. display: block;
  385. float: none;
  386. margin: 0.5em 0em;
  387. padding: 0em;
  388. }
  389. /*--------------------
  390. Fields
  391. ---------------------*/
  392. /* Split fields */
  393. .ui.form .fields {
  394. clear: both;
  395. }
  396. .ui.form .fields:after {
  397. content: ' ';
  398. display: block;
  399. clear: both;
  400. visibility: hidden;
  401. line-height: 0;
  402. height: 0;
  403. }
  404. .ui.form .fields > .field {
  405. clear: none;
  406. float: right;
  407. -webkit-box-sizing: border-box;
  408. -moz-box-sizing: border-box;
  409. -ms-box-sizing: border-box;
  410. box-sizing: border-box;
  411. }
  412. .ui.form .fields > .field:first-child {
  413. border-right: none;
  414. -webkit-box-shadow: none;
  415. box-shadow: none;
  416. }
  417. /* Other Combinations */
  418. .ui.form .two.fields > .fields,
  419. .ui.form .two.fields > .field {
  420. width: 50%;
  421. padding-right: 1%;
  422. padding-left: 1%;
  423. }
  424. .ui.form .three.fields > .fields,
  425. .ui.form .three.fields > .field {
  426. width: 33.333%;
  427. padding-right: 1%;
  428. padding-left: 1%;
  429. }
  430. .ui.form .four.fields > .fields,
  431. .ui.form .four.fields > .field {
  432. width: 25%;
  433. padding-right: 1%;
  434. padding-left: 1%;
  435. }
  436. .ui.form .five.fields > .fields,
  437. .ui.form .five.fields > .field {
  438. width: 20%;
  439. padding-right: 1%;
  440. padding-left: 1%;
  441. }
  442. /* Swap to full width on mobile */
  443. @media only screen and (max-width: 767px) {
  444. .ui.form .two.fields > .fields,
  445. .ui.form .two.fields > .field,
  446. .ui.form .three.fields > .fields,
  447. .ui.form .three.fields > .field,
  448. .ui.form .four.fields > .fields,
  449. .ui.form .four.fields > .field,
  450. .ui.form .five.fields > .fields,
  451. .ui.form .five.fields > .field {
  452. width: 100%;
  453. padding-right: 0%;
  454. padding-left: 0%;
  455. }
  456. }
  457. .ui.form .fields .field:first-child {
  458. padding-right: 0%;
  459. }
  460. .ui.form .fields .field:last-child {
  461. padding-left: 0%;
  462. }
  463. /*--------------------
  464. Inline Fields
  465. ---------------------*/
  466. .ui.form .inline.fields .field {
  467. min-height: 1.3em;
  468. margin-left: 0.5em;
  469. }
  470. .ui.form .inline.fields .field > label,
  471. .ui.form .inline.fields .field > p,
  472. .ui.form .inline.fields .field > input,
  473. .ui.form .inline.field > label,
  474. .ui.form .inline.field > p,
  475. .ui.form .inline.field > input {
  476. display: inline-block;
  477. width: auto;
  478. margin-top: 0em;
  479. margin-bottom: 0em;
  480. vertical-align: middle;
  481. font-size: 1em;
  482. }
  483. .ui.form .inline.fields .field > input,
  484. .ui.form .inline.field > input {
  485. font-size: 0.875em;
  486. }
  487. .ui.form .inline.fields .field > :first-child,
  488. .ui.form .inline.field > :first-child {
  489. margin: 0em 0em 0em 0.5em;
  490. }
  491. .ui.form .inline.fields .field > :only-child,
  492. .ui.form .inline.field > :only-child {
  493. margin: 0em;
  494. }
  495. /*--------------------
  496. Sizes
  497. ---------------------*/
  498. /* Standard */
  499. .ui.small.form {
  500. font-size: 0.875em;
  501. }
  502. .ui.small.form textarea,
  503. .ui.small.form input[type="text"],
  504. .ui.small.form input[type="email"],
  505. .ui.small.form input[type="date"],
  506. .ui.small.form input[type="password"],
  507. .ui.small.form input[type="number"],
  508. .ui.small.form input[type="url"],
  509. .ui.small.form input[type="tel"],
  510. .ui.small.form label {
  511. font-size: 1em;
  512. }
  513. /* Large */
  514. .ui.large.form {
  515. font-size: 1.125em;
  516. }