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.

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