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.

535 lines
9.9 KiB

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