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.

539 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="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-appearance: none;
  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-appearance: none;
  173. -webkit-box-shadow: 0.3em 0em 0em 0em rgba(0, 0, 0, 0.2) inset;
  174. -moz-box-shadow: 0.3em 0em 0em 0em rgba(0, 0, 0, 0.2) inset;
  175. box-shadow: 0.3em 0em 0em 0em rgba(0, 0, 0, 0.2) inset;
  176. }
  177. /*--------------------
  178. Error
  179. ---------------------*/
  180. /* On Form */
  181. .ui.form.warning .warning.message {
  182. display: block;
  183. }
  184. /*--------------------
  185. Warning
  186. ---------------------*/
  187. /* On Form */
  188. .ui.form.error .error.message {
  189. display: block;
  190. }
  191. /* On Field(s) */
  192. .ui.form .fields.error .field label,
  193. .ui.form .field.error label {
  194. color: #D95C5C;
  195. }
  196. .ui.form .fields.error .field textarea,
  197. .ui.form .fields.error .field input[type="text"],
  198. .ui.form .fields.error .field input[type="date"],
  199. .ui.form .fields.error .field input[type="password"],
  200. .ui.form .field.error textarea,
  201. .ui.form .field.error input[type="text"],
  202. .ui.form .field.error input[type="date"],
  203. .ui.form .field.error input[type="password"] {
  204. background-color: #FFFAFA;
  205. border-color: #E7BEBE;
  206. border-left: none;
  207. color: #D95C5C;
  208. padding-left: 1.2em;
  209. border-bottom-left-radius: 0;
  210. border-top-left-radius: 0;
  211. -webkit-box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
  212. -moz-box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
  213. box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
  214. }
  215. .ui.form .field.error textarea:focus,
  216. .ui.form .field.error input[type="text"]:focus,
  217. .ui.form .field.error input[type="password"]:focus {
  218. border-color: rgba(255, 80, 80, 1);
  219. color: rgba(255, 80, 80, 1);
  220. -webkit-appearance: none;
  221. -webkit-box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
  222. -moz-box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
  223. box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
  224. }
  225. /*--------------------
  226. Empty (Placeholder)
  227. ---------------------*/
  228. /* browsers require these rules separate */
  229. .ui.form ::-webkit-input-placeholder {
  230. color: #E0E0E0;
  231. }
  232. .ui.form ::-moz-placeholder {
  233. color: #E0E0E0;
  234. }
  235. .ui.form :focus::-webkit-input-placeholder {
  236. color: #AAAAAA;
  237. }
  238. .ui.form :focus::-moz-placeholder {
  239. color: #AAAAAA;
  240. }
  241. /* Error Placeholder */
  242. .ui.form .error ::-webkit-input-placeholder {
  243. color: rgba(255, 80, 80, 0.4);
  244. }
  245. .ui.form .error ::-moz-placeholder {
  246. color: rgba(255, 80, 80, 0.4);
  247. }
  248. .ui.form .error :focus::-webkit-input-placeholder {
  249. color: rgba(255, 80, 80, 0.7);
  250. }
  251. .ui.form .error :focus::-moz-placeholder {
  252. color: rgba(255, 80, 80, 0.7);
  253. }
  254. /*--------------------
  255. Disabled
  256. ---------------------*/
  257. .ui.form .field :disabled,
  258. .ui.form .field.disabled {
  259. opacity: 0.5;
  260. }
  261. .ui.form .field.disabled label {
  262. opacity: 0.5;
  263. }
  264. .ui.form .field.disabled :disabled {
  265. opacity: 1;
  266. }
  267. /*--------------------
  268. Loading State
  269. ---------------------*/
  270. /* On Form */
  271. .ui.form.loading {
  272. position: relative;
  273. }
  274. .ui.form.loading:after {
  275. position: absolute;
  276. top: 0%;
  277. left: 0%;
  278. content: '';
  279. width: 100%;
  280. height: 100%;
  281. background: rgba(255, 255, 255, 0.8) url(../images/loader-large.gif) no-repeat 50% 50%;
  282. visibility: visible;
  283. }
  284. /*******************************
  285. Variations
  286. *******************************/
  287. /*--------------------
  288. Fluid Width
  289. ---------------------*/
  290. .ui.form.fluid {
  291. width: 100%;
  292. -webkit-box-sizing: border-box;
  293. -moz-box-sizing: border-box;
  294. -ms-box-sizing: border-box;
  295. box-sizing: border-box;
  296. }
  297. /*--------------------------
  298. Input w/ attached Button
  299. ---------------------------*/
  300. .ui.form input.attached {
  301. width: auto;
  302. }
  303. /*--------------------
  304. Date Input
  305. ---------------------*/
  306. .ui.form .date.field > label {
  307. position: relative;
  308. }
  309. .ui.form .date.field > label:after {
  310. position: absolute;
  311. top: 1.4em;
  312. right: 0.5em;
  313. font-family: 'Icons';
  314. content: '📅'; /* '\1f4c5' */
  315. font-size: 1.5em;
  316. font-weight: normal;
  317. color: #CCCCCC;
  318. }
  319. /*--------------------
  320. Inverted Colors
  321. ---------------------*/
  322. .ui.inverted.form label {
  323. color: #FFFFFF;
  324. }
  325. .ui.inverted.form .field.error textarea,
  326. .ui.inverted.form .field.error input[type="text"] {
  327. background-color: #FFCCCC;
  328. }
  329. /*--------------------
  330. Field Groups
  331. ---------------------*/
  332. /* Grouped Vertically */
  333. .ui.form .grouped.fields {
  334. margin: 0em 0em 1em;
  335. }
  336. .ui.form .grouped.fields .field {
  337. display: block;
  338. float: none;
  339. margin: 0.5em 0em;
  340. padding: 0em;
  341. }
  342. /*--------------------
  343. Fields
  344. ---------------------*/
  345. /* Split fields */
  346. .ui.form .fields {
  347. clear: both;
  348. }
  349. .ui.form .fields:after {
  350. content: ' ';
  351. display: block;
  352. clear: both;
  353. visibility: hidden;
  354. line-height: 0;
  355. height: 0;
  356. }
  357. .ui.form .fields .field {
  358. clear: none;
  359. float: left;
  360. -webkit-box-sizing: border-box;
  361. -moz-box-sizing: border-box;
  362. -ms-box-sizing: border-box;
  363. box-sizing: border-box;
  364. }
  365. .ui.form .fields .field:first-child {
  366. border-left: none;
  367. box-shadow: none;
  368. }
  369. /* Other Combinations */
  370. .ui.form .two.fields .field {
  371. width: 50%;
  372. padding-left: 1%;
  373. padding-right: 1%;
  374. }
  375. .ui.form .three.fields .field {
  376. width: 33.333%;
  377. padding-left: 1%;
  378. padding-right: 1%;
  379. }
  380. .ui.form .four.fields .field {
  381. width: 25%;
  382. padding-left: 1%;
  383. padding-right: 1%;
  384. }
  385. .ui.form .five.fields .field {
  386. width: 20%;
  387. padding-left: 1%;
  388. padding-right: 1%;
  389. }
  390. /* override sides, ie8 no last-child */
  391. .ui.form .fields .field:first-child {
  392. padding-left: 0%;
  393. }
  394. .ui.form .fields .field:last-child {
  395. padding-right: 0%;
  396. }
  397. /*--------------------
  398. Inline Fields
  399. ---------------------*/
  400. .ui.form .inline.fields .field {
  401. min-height: 1.3em;
  402. margin-right: 0.5em;
  403. }
  404. .ui.form .inline.fields .field > label,
  405. .ui.form .inline.fields .field > p,
  406. .ui.form .inline.fields .field > input,
  407. .ui.form .inline.fields .field > select,
  408. .ui.form .inline.field > label,
  409. .ui.form .inline.field > p,
  410. .ui.form .inline.field > input,
  411. .ui.form .inline.field > select {
  412. display: inline-block;
  413. width: auto;
  414. margin-top: 0em;
  415. margin-bottom: 0em;
  416. vertical-align: middle;
  417. font-size: 1em;
  418. }
  419. .ui.form .inline.fields .field > input,
  420. .ui.form .inline.field > input {
  421. font-size: 0.875em;
  422. }
  423. .ui.form .inline.fields .field > :first-child,
  424. .ui.form .inline.field > :first-child {
  425. margin: 0em 0.5em 0em 0em;
  426. }
  427. .ui.form .inline.fields .field > :only-child,
  428. .ui.form .inline.field > :only-child {
  429. margin: 0em;
  430. }
  431. /*--------------------
  432. Sizes
  433. ---------------------*/
  434. /* Standard */
  435. .ui.small.form {
  436. font-size: 0.875em;
  437. }
  438. .ui.small.form textarea,
  439. .ui.small.form input[type="text"],
  440. .ui.small.form input[type="password"],
  441. .ui.small.form label {
  442. font-size: 1em;
  443. }
  444. /* Large */
  445. .ui.large.form {
  446. font-size: 1.125em;
  447. }