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.

536 lines
10 KiB

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