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.

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