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.

760 lines
17 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. /*
  2. * # Semantic - Form
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributor
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. /*******************************
  12. Theme
  13. *******************************/
  14. @type : 'collection';
  15. @element : 'form';
  16. @import '../../semantic.config';
  17. /*******************************
  18. Elements
  19. *******************************/
  20. /*--------------------
  21. Form
  22. ---------------------*/
  23. .ui.form {
  24. position: relative;
  25. max-width: 100%;
  26. }
  27. /*--------------------
  28. Content
  29. ---------------------*/
  30. .ui.form > p {
  31. margin: @paragraphMargin;
  32. }
  33. /*--------------------
  34. Field
  35. ---------------------*/
  36. .ui.form .field {
  37. clear: both;
  38. margin: @fieldMargin;
  39. }
  40. .ui.form :not(.fields) .field:last-child {
  41. margin-bottom: 0em;
  42. }
  43. /*--------------------
  44. Labels
  45. ---------------------*/
  46. .ui.form .grouped.fields > label,
  47. .ui.form .inline.fields > label,
  48. .ui.form .field > label {
  49. margin: 0em 0em @labelDistance 0em;
  50. display: block;
  51. color: @labelColor;
  52. font-size: @labelFontSize;
  53. font-weight: @labelFontWeight;
  54. text-transform: @labelTextTransform;
  55. }
  56. /*--------------------
  57. Standard Inputs
  58. ---------------------*/
  59. .ui.form textarea,
  60. .ui.form input[type="text"],
  61. .ui.form input[type="email"],
  62. .ui.form input[type="date"],
  63. .ui.form input[type="password"],
  64. .ui.form input[type="number"],
  65. .ui.form input[type="url"],
  66. .ui.form input[type="tel"],
  67. .ui.form .ui.input {
  68. width: 100%;
  69. }
  70. .ui.form input[type="text"],
  71. .ui.form input[type="email"],
  72. .ui.form input[type="date"],
  73. .ui.form input[type="password"],
  74. .ui.form input[type="number"],
  75. .ui.form input[type="url"],
  76. .ui.form input[type="tel"] {
  77. margin: 0em;
  78. outline: none;
  79. -webkit-appearance: none;
  80. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  81. line-height: @inputLineHeight;
  82. padding: @inputPadding;
  83. font-size: @inputFontSize;
  84. background: @inputBackground;
  85. border: @inputBorder;
  86. color: @inputColor;
  87. border-radius: @inputBorderRadius;
  88. box-shadow: @inputBoxShadow;
  89. box-sizing: border-box;
  90. transition: @inputTransition;
  91. }
  92. .ui.textarea,
  93. .ui.form textarea {
  94. margin: 0em;
  95. padding: @inputVerticalPadding @inputHorizontalPadding;
  96. font-size: @inputFontSize;
  97. background: @inputBackground;
  98. border: @inputBorder;
  99. outline: none;
  100. color: @inputColor;
  101. border-radius: @inputBorderRadius;
  102. box-shadow: @inputBoxShadow;
  103. -webkit-appearance: none;
  104. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  105. box-sizing: border-box;
  106. transition: @inputTransition;
  107. font-size: @textAreaFontSize;
  108. height: @textAreaHeight;
  109. min-height: @textAreaMinHeight;
  110. max-height: @textAreaMaxHeight;
  111. line-height: @textAreaLineHeight;
  112. resize: @textAreaResize;
  113. }
  114. .ui.form textarea,
  115. .ui.form input[type="checkbox"] {
  116. vertical-align: @checkboxVerticalAlign;
  117. }
  118. /*--------------------------
  119. Input w/ attached Button
  120. ---------------------------*/
  121. .ui.form input.attached {
  122. width: auto;
  123. }
  124. /*--------------------
  125. Dropdown
  126. ---------------------*/
  127. .ui.form .field > .selection.dropdown {
  128. width: 100%;
  129. }
  130. .ui.form .field > .selection.dropdown > .dropdown.icon {
  131. float: right;
  132. }
  133. .ui.form .inline.field > .selection.dropdown {
  134. width: auto;
  135. }
  136. .ui.form .inline.field > .selection.dropdown > .dropdown.icon {
  137. float: none;
  138. }
  139. /*--------------------
  140. Dividers
  141. ---------------------*/
  142. .ui.form .divider {
  143. clear: both;
  144. margin: @dividerMargin;
  145. }
  146. /*--------------------
  147. Types of Messages
  148. ---------------------*/
  149. .ui.form .info.message,
  150. .ui.form .success.message,
  151. .ui.form .warning.message,
  152. .ui.form .error.message {
  153. display: none;
  154. }
  155. /* Assumptions */
  156. .ui.form .message:first-child {
  157. margin-top: 0px;
  158. }
  159. /*--------------------
  160. Validation Prompt
  161. ---------------------*/
  162. .ui.form .field .prompt.label {
  163. white-space: nowrap;
  164. }
  165. .ui.form .inline.field .prompt {
  166. margin: @validationMargin;
  167. }
  168. .ui.form .inline.field .prompt:before {
  169. margin-top: @validationArrowOffset;
  170. bottom: auto;
  171. right: auto;
  172. top: 50%;
  173. left: 0em;
  174. }
  175. /*******************************
  176. States
  177. *******************************/
  178. /*--------------------
  179. Placeholder
  180. ---------------------*/
  181. /* browsers require these rules separate */
  182. .ui.form ::-webkit-input-placeholder {
  183. color: @inputPlaceholderColor;
  184. }
  185. .ui.form ::-moz-placeholder {
  186. color: @inputPlaceholderColor;
  187. }
  188. .ui.form :focus::-webkit-input-placeholder {
  189. color: @inputPlaceholderFocusColor;
  190. }
  191. .ui.form :focus::-moz-placeholder {
  192. color: @inputPlaceholderFocusColor;
  193. }
  194. /* Error Placeholder */
  195. .ui.form .error ::-webkit-input-placeholder {
  196. color: @inputErrorPlaceholderColor;
  197. }
  198. .ui.form .error ::-moz-placeholder {
  199. color: @inputErrorPlaceholderColor;
  200. }
  201. .ui.form .error :focus::-webkit-input-placeholder {
  202. color: @inputErrorPlaceholderFocusColor;
  203. }
  204. .ui.form .error :focus::-moz-placeholder {
  205. color: @inputErrorPlaceholderFocusColor;
  206. }
  207. /*--------------------
  208. Focus
  209. ---------------------*/
  210. .ui.form input[type="text"]:focus,
  211. .ui.form input[type="email"]:focus,
  212. .ui.form input[type="date"]:focus,
  213. .ui.form input[type="password"]:focus,
  214. .ui.form input[type="number"]:focus,
  215. .ui.form input[type="url"]:focus,
  216. .ui.form input[type="tel"]:focus,
  217. .ui.form textarea:focus{
  218. color: @inputFocusColor;
  219. border-color: @inputFocusBorderColor;
  220. border-radius: @inputFocusBorderRadius;
  221. background: @inputFocusBackground;
  222. box-shadow: @inputFocusBoxShadow;
  223. -webkit-appearance: none;
  224. }
  225. /*--------------------
  226. Success
  227. ---------------------*/
  228. /* On Form */
  229. .ui.form.success .success.message {
  230. display: block;
  231. }
  232. /*--------------------
  233. Error
  234. ---------------------*/
  235. /* On Form */
  236. .ui.form.warning .warning.message {
  237. display: block;
  238. }
  239. /*--------------------
  240. Warning
  241. ---------------------*/
  242. /* On Form */
  243. .ui.form.error .error.message {
  244. display: block;
  245. }
  246. /* On Field(s) */
  247. .ui.form .fields.error .field label,
  248. .ui.form .field.error label,
  249. .ui.form .fields.error .field .input,
  250. .ui.form .field.error .input {
  251. color: @formErrorColor;
  252. }
  253. .ui.form .fields.error .field .corner.label,
  254. .ui.form .field.error .corner.label {
  255. border-color: @formErrorColor;
  256. color: @white;
  257. }
  258. .ui.form .fields.error .field textarea,
  259. .ui.form .fields.error .field input[type="text"],
  260. .ui.form .fields.error .field input[type="email"],
  261. .ui.form .fields.error .field input[type="date"],
  262. .ui.form .fields.error .field input[type="password"],
  263. .ui.form .fields.error .field input[type="number"],
  264. .ui.form .fields.error .field input[type="url"],
  265. .ui.form .fields.error .field input[type="tel"],
  266. .ui.form .field.error textarea,
  267. .ui.form .field.error input[type="text"],
  268. .ui.form .field.error input[type="email"],
  269. .ui.form .field.error input[type="date"],
  270. .ui.form .field.error input[type="password"],
  271. .ui.form .field.error input[type="number"],
  272. .ui.form .field.error input[type="url"],
  273. .ui.form .field.error input[type="tel"] {
  274. background: @formErrorBackground;
  275. border-color: @formErrorBorder;
  276. color: @formErrorColor;
  277. border-radius: @inputErrorBorderRadius;
  278. box-shadow: @inputErrorBoxShadow;
  279. }
  280. .ui.form .field.error textarea:focus,
  281. .ui.form .field.error input[type="text"]:focus,
  282. .ui.form .field.error input[type="email"]:focus,
  283. .ui.form .field.error input[type="date"]:focus,
  284. .ui.form .field.error input[type="password"]:focus,
  285. .ui.form .field.error input[type="number"]:focus,
  286. .ui.form .field.error input[type="url"]:focus,
  287. .ui.form .field.error input[type="tel"]:focus{
  288. background: @inputErrorFocusBackground;
  289. border-color: @inputErrorFocusBorder;
  290. color: @inputErrorFocusColor;
  291. -webkit-appearance: none;
  292. box-shadow: @inputErrorFocusBoxShadow;
  293. }
  294. /*------------------
  295. Dropdown Error
  296. --------------------*/
  297. .ui.form .fields.error .field .ui.dropdown,
  298. .ui.form .fields.error .field .ui.dropdown .item,
  299. .ui.form .field.error .ui.dropdown,
  300. .ui.form .field.error .ui.dropdown .text,
  301. .ui.form .field.error .ui.dropdown .item {
  302. background: @formErrorBackground;
  303. color: @formErrorColor;
  304. }
  305. .ui.form .fields.error .field .ui.dropdown,
  306. .ui.form .field.error .ui.dropdown {
  307. box-shadow: 0px 0px 0px 1px @formErrorBorder !important;
  308. }
  309. .ui.form .fields.error .field .ui.dropdown:hover,
  310. .ui.form .field.error .ui.dropdown:hover {
  311. box-shadow: 0px 0px 0px 1px @formErrorBorder !important;
  312. }
  313. .ui.form .fields.error .field .ui.dropdown:hover .menu,
  314. .ui.form .field.error .ui.dropdown:hover .menu {
  315. box-shadow: 0px 1px 0px 1px @formErrorBorder;
  316. }
  317. /* Hover */
  318. .ui.form .fields.error .field .ui.dropdown .menu .item:hover,
  319. .ui.form .field.error .ui.dropdown .menu .item:hover {
  320. background-color: @dropdownErrorHoverBackground;
  321. }
  322. /* Active */
  323. .ui.form .fields.error .field .ui.dropdown .menu .active.item,
  324. .ui.form .field.error .ui.dropdown .menu .active.item {
  325. background-color: @dropdownErrorActiveBackground !important;
  326. }
  327. /*--------------------
  328. Checkbox Error
  329. ---------------------*/
  330. .ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) label,
  331. .ui.form .field.error .checkbox:not(.toggle):not(.slider) label,
  332. .ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) .box,
  333. .ui.form .field.error .checkbox:not(.toggle):not(.slider) .box {
  334. color: @formErrorColor;
  335. }
  336. .ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) label:before,
  337. .ui.form .field.error .checkbox:not(.toggle):not(.slider) label:before,
  338. .ui.form .fields.error .field .checkbox:not(.toggle):not(.slider) .box:before,
  339. .ui.form .field.error .checkbox:not(.toggle):not(.slider) .box:before {
  340. background: @formErrorBackground;
  341. border-color: @formErrorBorder;
  342. }
  343. .ui.form .fields.error .field .checkbox label:after,
  344. .ui.form .field.error .checkbox label:after,
  345. .ui.form .fields.error .field .checkbox .box:after,
  346. .ui.form .field.error .checkbox .box:after {
  347. color: @formErrorColor;
  348. }
  349. /*--------------------
  350. Disabled
  351. ---------------------*/
  352. .ui.form .field :disabled,
  353. .ui.form .field.disabled {
  354. opacity: 0.5;
  355. }
  356. .ui.form .field.disabled label {
  357. opacity: 0.5;
  358. }
  359. .ui.form .field.disabled :disabled {
  360. opacity: 1;
  361. }
  362. /*--------------------
  363. Loading State
  364. ---------------------*/
  365. /* On Form */
  366. .ui.form.loading {
  367. position: relative;
  368. }
  369. .ui.form.loading:after {
  370. position: absolute;
  371. top: 0%;
  372. left: 0%;
  373. content: '';
  374. width: 100%;
  375. height: 100%;
  376. background: @formLoaderDimmerColor url(@formLoaderPath) no-repeat @formLoaderPosition;
  377. visibility: visible;
  378. }
  379. /*******************************
  380. Element Types
  381. *******************************/
  382. /*--------------------
  383. Required Field
  384. ---------------------*/
  385. .ui.form .required.fields > .field > label:after,
  386. .ui.form .required.fields > .field > .checkbox:after,
  387. .ui.form .required.field > label:after,
  388. .ui.form .required.field > .checkbox:after {
  389. margin: -0.2em 0em 0em 0.2em;
  390. vertical-align: top;
  391. content: '*';
  392. color: @requiredColor;
  393. }
  394. /*--------------------
  395. Date Input
  396. ---------------------*/
  397. .ui.form .date.field > label {
  398. position: relative;
  399. }
  400. .ui.form .date.field > label:after {
  401. position: absolute;
  402. top: 2em;
  403. right: 0.5em;
  404. font-family: 'Icons';
  405. content: '\f133';
  406. font-size: 1.2em;
  407. font-weight: normal;
  408. color: #CCCCCC;
  409. }
  410. /*******************************
  411. Variations
  412. *******************************/
  413. /*--------------------
  414. Inverted Colors
  415. ---------------------*/
  416. .ui.inverted.form label,
  417. .ui.form .inverted.segment label,
  418. .ui.form .inverted.segment .ui.checkbox label,
  419. .ui.form .inverted.segment .ui.checkbox .box,
  420. .ui.inverted.form .ui.checkbox label,
  421. .ui.inverted.form .ui.checkbox .box {
  422. color: @invertedLabelColor;
  423. }
  424. .ui.inverted.form.loading:after {
  425. background: @formInvertedLoaderDimmerColor url(@formInvertedLoaderPath) no-repeat @formLoaderPosition;
  426. }
  427. /*--------------------
  428. Field Groups
  429. ---------------------*/
  430. /* Grouped Vertically */
  431. .ui.form .grouped.fields {
  432. margin: @groupedMargin;
  433. }
  434. .ui.form .grouped.fields:last-child {
  435. margin-bottom: 0em;
  436. }
  437. .ui.form .grouped.fields .field {
  438. display: block;
  439. float: none;
  440. margin: @groupedFieldMargin;
  441. padding: 0em;
  442. }
  443. .ui.form .inline.grouped.fields > label {
  444. margin-bottom: @inlineGroupedFieldLabelDistance;
  445. }
  446. /*--------------------
  447. Fields
  448. ---------------------*/
  449. /* Split fields */
  450. .ui.form .fields {
  451. clear: both;
  452. }
  453. .ui.form .fields:after {
  454. content: ' ';
  455. display: block;
  456. clear: both;
  457. visibility: hidden;
  458. line-height: 0;
  459. height: 0;
  460. }
  461. .ui.form .fields > .field {
  462. clear: none;
  463. float: left;
  464. box-sizing: border-box;
  465. padding-left: @gutterWidth;
  466. padding-right: @gutterWidth;
  467. }
  468. .ui.form .fields > .field:first-child {
  469. border-left: none;
  470. box-shadow: none;
  471. }
  472. /* Other Combinations */
  473. .ui.form .two.fields > .fields,
  474. .ui.form .two.fields > .field {
  475. width: @twoColumn;
  476. }
  477. .ui.form .three.fields > .fields,
  478. .ui.form .three.fields > .field {
  479. width: @threeColumn;
  480. }
  481. .ui.form .four.fields > .fields,
  482. .ui.form .four.fields > .field {
  483. width: @fourColumn;
  484. }
  485. .ui.form .five.fields > .fields,
  486. .ui.form .five.fields > .field {
  487. width: @fiveColumn;
  488. }
  489. /* Swap to full width on mobile */
  490. @media only screen and (max-width : 767px) {
  491. .ui.form .two.fields > .fields,
  492. .ui.form .two.fields > .field,
  493. .ui.form .three.fields > .fields,
  494. .ui.form .three.fields > .field,
  495. .ui.form .four.fields > .fields,
  496. .ui.form .four.fields > .field,
  497. .ui.form .five.fields > .fields,
  498. .ui.form .five.fields > .field {
  499. width: @oneColumn;
  500. padding-left: 0%;
  501. padding-right: 0%;
  502. }
  503. }
  504. .ui.form .fields .field:first-child {
  505. padding-left: 0%;
  506. }
  507. .ui.form .fields .field:last-child {
  508. padding-right: 0%;
  509. }
  510. /* Sizing Combinations */
  511. .ui.form .fields .wide.field {
  512. width: @oneWide;
  513. padding-left: @gutterWidth;
  514. padding-right: @gutterWidth;
  515. }
  516. .ui.form .fields .wide.field:first-child {
  517. padding-left: 0%;
  518. }
  519. .ui.form .fields .wide.field:last-child {
  520. padding-right: 0%;
  521. }
  522. .ui.form .one.wide.field {
  523. width: @oneWide !important;
  524. }
  525. .ui.form .two.wide.field {
  526. width: @twoWide !important;
  527. }
  528. .ui.form .three.wide.field {
  529. width: @threeWide !important;
  530. }
  531. .ui.form .four.wide.field {
  532. width: @fourWide !important;
  533. }
  534. .ui.form .five.wide.field {
  535. width: @fiveWide !important;
  536. }
  537. .ui.form .six.wide.field {
  538. width: @sixWide !important;
  539. }
  540. .ui.form .seven.wide.field {
  541. width: @sevenWide !important;
  542. }
  543. .ui.form .eight.wide.field {
  544. width: @eightWide !important;
  545. }
  546. .ui.form .nine.wide.field {
  547. width: @nineWide !important;
  548. }
  549. .ui.form .ten.wide.field {
  550. width: @tenWide !important;
  551. }
  552. .ui.form .eleven.wide.field {
  553. width: @elevenWide !important;
  554. }
  555. .ui.form .twelve.wide.field {
  556. width: @twelveWide !important;
  557. }
  558. .ui.form .thirteen.wide.field {
  559. width: @thirteenWide !important;
  560. }
  561. .ui.form .fourteen.wide.field {
  562. width: @fourteenWide !important;
  563. }
  564. .ui.form .fifteen.wide.field {
  565. width: @fifteenWide !important;
  566. }
  567. .ui.form .sixteen.wide.field {
  568. width: @sixteenWide !important;
  569. }
  570. /* Swap to full width on mobile */
  571. @media only screen and (max-width : 767px) {
  572. .ui.form .two.fields > .fields,
  573. .ui.form .two.fields > .field,
  574. .ui.form .three.fields > .fields,
  575. .ui.form .three.fields > .field,
  576. .ui.form .four.fields > .fields,
  577. .ui.form .four.fields > .field,
  578. .ui.form .five.fields > .fields,
  579. .ui.form .five.fields > .field,
  580. .ui.form .fields > .two.wide.field,
  581. .ui.form .fields > .three.wide.field,
  582. .ui.form .fields > .four.wide.field,
  583. .ui.form .fields > .five.wide.field,
  584. .ui.form .fields > .six.wide.field,
  585. .ui.form .fields > .seven.wide.field,
  586. .ui.form .fields > .eight.wide.field,
  587. .ui.form .fields > .nine.wide.field,
  588. .ui.form .fields > .ten.wide.field,
  589. .ui.form .fields > .eleven.wide.field,
  590. .ui.form .fields > .twelve.wide.field,
  591. .ui.form .fields > .thirteen.wide.field,
  592. .ui.form .fields > .fourteen.wide.field,
  593. .ui.form .fields > .fifteen.wide.field,
  594. .ui.form .fields > .sixteen.wide.field {
  595. width: @oneColumn;
  596. padding-left: 0%;
  597. padding-right: 0%;
  598. }
  599. }
  600. /*--------------------
  601. Inline Fields
  602. ---------------------*/
  603. .ui.form .inline.fields {
  604. margin: @fieldMargin;
  605. }
  606. .ui.form .inline.fields .field {
  607. display: inline-block;
  608. margin: @inlineFieldsMargin;
  609. padding: 0em;
  610. }
  611. .ui.form .inline.fields .field > label,
  612. .ui.form .inline.fields .field > p,
  613. .ui.form .inline.fields .field > input,
  614. .ui.form .inline.field > label,
  615. .ui.form .inline.field > p,
  616. .ui.form .inline.field > input {
  617. display: inline-block;
  618. width: auto;
  619. margin-top: 0em;
  620. margin-bottom: 0em;
  621. vertical-align: @inlineLabelVerticalAlign;
  622. font-size: @inlineLabelFontSize;
  623. }
  624. .ui.form .inline.fields .field > input,
  625. .ui.form .inline.field > input {
  626. font-size: @inlineLabelFontSize;
  627. }
  628. /* Label */
  629. .ui.form .inline.fields .field > :first-child,
  630. .ui.form .inline.field > :first-child {
  631. margin: 0em @labelDistance 0em 0em;
  632. }
  633. .ui.form .inline.fields .field > :only-child,
  634. .ui.form .inline.field > :only-child {
  635. margin: 0em;
  636. }
  637. /*--------------------
  638. Sizes
  639. ---------------------*/
  640. /* Standard */
  641. .ui.small.form {
  642. font-size: @small;
  643. }
  644. /* Medium */
  645. .ui.form {
  646. font-size: @medium;
  647. }
  648. /* Large */
  649. .ui.large.form {
  650. font-size: @large;
  651. }
  652. /* Huge */
  653. .ui.huge.form {
  654. font-size: @huge;
  655. }
  656. .loadUIOverrides();