_form.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. // IOS OVERRIDE
  2. // -----------------------------------------------------------------------------
  3. /* Form - iOS Override */
  4. input[type="text"],
  5. input[type="password"],
  6. input[type="datetime"],
  7. input[type="datetime-local"],
  8. input[type="date"],
  9. input[type="month"],
  10. input[type="time"],
  11. input[type="week"],
  12. input[type="number"],
  13. input[type="email"],
  14. input[type="url"],
  15. input[type="search"],
  16. input[type="tel"],
  17. input[type="color"],
  18. textarea {
  19. -webkit-appearance: none;
  20. }
  21. // PLACEHOLDERS
  22. // -----------------------------------------------------------------------------
  23. .form-control,
  24. input[type="text"],
  25. input[type="password"],
  26. input[type="datetime"],
  27. input[type="datetime-local"],
  28. input[type="date"],
  29. input[type="month"],
  30. input[type="time"],
  31. input[type="week"],
  32. input[type="number"],
  33. input[type="email"],
  34. input[type="url"],
  35. input[type="search"],
  36. input[type="tel"],
  37. input[type="color"],
  38. textarea {
  39. @include placeholder-color(#bdbdbd);
  40. }
  41. // DARK - FORM
  42. // -----------------------------------------------------------------------------
  43. html.dark {
  44. .form-control {
  45. background-color: $dark-color-3;
  46. border-color: $dark-color-3;
  47. color: #EEE;
  48. }
  49. .form-control[disabled],
  50. .form-control[readonly],
  51. fieldset[disabled] .form-control {
  52. background-color: $dark-color-2;
  53. }
  54. .input-group-addon {
  55. background-color: $dark-color-2;
  56. border-color: $dark-color-2;
  57. color: #EEE;
  58. }
  59. }
  60. // BOOTSTRAP OVERRIDE
  61. // -----------------------------------------------------------------------------
  62. /* Form - Bootstrap Override */
  63. .btn-lg,
  64. .btn-group-lg > .btn {
  65. line-height: 1.334;
  66. }
  67. select {
  68. &.input-sm,
  69. &.input-lg {
  70. line-height: 1;
  71. }
  72. }
  73. // CUSTOM FIELDS
  74. // -----------------------------------------------------------------------------
  75. /* Form - Custom Fields */
  76. .required {
  77. display: inline-block;
  78. color: $color-danger;
  79. font-size: 0.8em;
  80. font-weight: bold;
  81. position: relative;
  82. top: -0.2em;
  83. }
  84. label.error {
  85. color: #B94A48;
  86. margin-top: 2px;
  87. }
  88. // FORM GROUP (OVERRIDE)
  89. // -----------------------------------------------------------------------------
  90. /* Form - Group Override */
  91. .form-group {
  92. &:after {
  93. clear: both;
  94. display: block;
  95. content: '';
  96. }
  97. &:last-child,
  98. &:last-of-type {
  99. margin-bottom: 0;
  100. }
  101. }
  102. // BORDERED FORM
  103. // -----------------------------------------------------------------------------
  104. /* Form - Bordered */
  105. .form-bordered {
  106. .form-group {
  107. border-bottom: 1px solid #eff2f7;
  108. padding-bottom: 15px;
  109. margin-bottom: 15px;
  110. &:last-child,
  111. &:last-of-type {
  112. border-bottom: none !important;
  113. padding-bottom: 0px !important;
  114. margin-bottom: 0px !important;
  115. }
  116. }
  117. }
  118. // DARK - BORDERED FORM
  119. // -----------------------------------------------------------------------------
  120. /* Dark - Form - Bordered */
  121. html.dark {
  122. .form-bordered {
  123. .form-group {
  124. border-bottom: 1px solid darken($dark-color-4, 5%);
  125. padding-bottom: 15px;
  126. margin-bottom: 15px;
  127. }
  128. }
  129. }
  130. // VERTICAL GROUP / STACKED
  131. // -----------------------------------------------------------------------------
  132. /* Form - Vertical Group / Stacked */
  133. .form-group-vertical {
  134. position: relative;
  135. white-space: nowrap;
  136. .form-control {
  137. border-radius: 0;
  138. margin-top: -1px;
  139. z-index: 1;
  140. &:first-child,
  141. &:first-of-type {
  142. border-radius: 4px 4px 0 0;
  143. }
  144. &:last-child,
  145. &:last-of-type {
  146. border-radius: 0 0 4px 4px;
  147. }
  148. &:focus {
  149. position: relative;
  150. z-index: 2;
  151. }
  152. }
  153. .input-group {
  154. margin-top: -1px;
  155. .form-control {
  156. margin-top: 0;
  157. }
  158. &:first-child,
  159. &:first-of-type {
  160. .input-group-addon {
  161. border-radius: 4px 0 0 0;
  162. }
  163. .form-control {
  164. border-radius: 0 4px 0 0;
  165. }
  166. }
  167. &:last-child,
  168. &:last-of-type {
  169. .input-group-addon {
  170. border-radius: 0 0 0 4px;
  171. }
  172. .form-control {
  173. border-radius: 0 0 4px 0;
  174. }
  175. }
  176. &.input-group-icon {
  177. &:first-child,
  178. &:first-of-type {
  179. .input-group-addon {
  180. border-radius: 4px 4px 0 0;
  181. }
  182. .form-control {
  183. border-radius: 4px 4px 0 0;
  184. }
  185. }
  186. &:last-child,
  187. &:last-of-type {
  188. .input-group-addon {
  189. border-radius: 0 0 4px 4px;
  190. }
  191. .form-control {
  192. border-radius: 0 0 4px 4px;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. // INPUT (OVERRIDE)
  199. // -----------------------------------------------------------------------------
  200. /* Form - Input Override */
  201. .input-lg {
  202. border-radius: 4px;
  203. }
  204. // INPUT ICON
  205. // -----------------------------------------------------------------------------
  206. /* Form - Input Icon */
  207. .input-group-icon,
  208. .input-search {
  209. width: 100%;
  210. table-layout: fixed;
  211. input.form-control {
  212. @include font-size(12);
  213. padding-right: 36px;
  214. &:first-child,
  215. &:last-child {
  216. border-radius: 4px;
  217. }
  218. }
  219. .input-group-btn {
  220. border-radius: 500px;
  221. width: 0;
  222. &:first-child,
  223. &:last-child {
  224. border-radius: 500px;
  225. }
  226. button {
  227. position: absolute;
  228. top: 0;
  229. left: 0;
  230. bottom: 0;
  231. border: 0;
  232. z-index: 3;
  233. background:transparent;
  234. &:active {
  235. -webkit-box-shadow: none;
  236. box-shadow: none;
  237. }
  238. }
  239. &:last-child {
  240. button {
  241. left: auto;
  242. right: 0;
  243. }
  244. }
  245. & + input.form-control {
  246. padding-right: 12px;
  247. padding-left: 36px;
  248. }
  249. }
  250. .input-group-addon {
  251. position: relative;
  252. padding: 0;
  253. border: 0 none;
  254. width: 0;
  255. span.icon {
  256. position: absolute;
  257. top: 0;
  258. bottom: 0;
  259. left: 0;
  260. border: 0;
  261. z-index: 3;
  262. width: auto;
  263. display: inline-block;
  264. vertical-align: middle;
  265. text-align: center;
  266. padding: 6px 12px;
  267. background: transparent;
  268. line-height: 1.42857143;
  269. -webkit-box-sizing: content-box;
  270. -moz-box-sizing: content-box;
  271. box-sizing: content-box;
  272. pointer-events: none;
  273. &.icon-lg {
  274. padding: 10px 14px;
  275. font-size: 18px;
  276. }
  277. }
  278. &:last-child {
  279. span.icon {
  280. left: auto;
  281. right: 0;
  282. }
  283. }
  284. & + input.form-control {
  285. padding-right: 12px;
  286. padding-left: 36px;
  287. }
  288. }
  289. }
  290. // INPUT SEARCH
  291. // -----------------------------------------------------------------------------
  292. /* Form - Input Search */
  293. .input-search {
  294. width: 100%;
  295. input.form-control {
  296. &:focus {
  297. border-color: #ccc;
  298. -webkit-box-shadow: none;
  299. box-shadow: none;
  300. }
  301. }
  302. .input-group-btn {
  303. color: #ccc;
  304. .btn {
  305. padding-left: 15px;
  306. }
  307. .btn-default {
  308. color: #ccc;
  309. }
  310. }
  311. }
  312. /* Dark */
  313. .input-search {
  314. width: 100%;
  315. input.form-control {
  316. &:focus {
  317. border-color: $dark-color-1;
  318. }
  319. }
  320. .input-group-btn {
  321. .btn {
  322. background: transparent !important;
  323. }
  324. }
  325. }
  326. // ROUND INPUT
  327. // -----------------------------------------------------------------------------
  328. /* Form - Round Input */
  329. input.input-rounded {
  330. -webkit-border-radius: 500px;
  331. border-radius: 500px;
  332. }
  333. .input-group-rounded,
  334. .input-search {
  335. input.form-control {
  336. -webkit-border-radius: 500px;
  337. border-radius: 500px;
  338. &:first-child,
  339. &:last-child {
  340. border-radius: 500px;
  341. }
  342. }
  343. .input-group-addon {
  344. &:first-child {
  345. border-radius: 500px 0 0 500px;
  346. }
  347. &:last-child {
  348. border-radius: 0 500px 500px 0;
  349. }
  350. }
  351. }
  352. // CUSTOM CHECKBOX
  353. // -----------------------------------------------------------------------------
  354. /* Form - Custom Checkbox */
  355. .checkbox-custom {
  356. position: relative;
  357. padding: 0 0 0 25px;
  358. margin-bottom: 7px;
  359. margin-top: 0;
  360. &.checkbox-inline {
  361. display: inline-block;
  362. vertical-align: middle;
  363. .form-group & {
  364. margin-top: 7px;
  365. padding-top: 0;
  366. }
  367. }
  368. &:last-child,
  369. &:last-of-type {
  370. margin-bottom: 0;
  371. }
  372. input[type="checkbox"] {
  373. opacity: 0;
  374. position: absolute;
  375. top: 50%;
  376. left: 3px;
  377. margin: -6px 0 0 0;
  378. z-index: 2;
  379. cursor: pointer;
  380. &:checked {
  381. & + label:after {
  382. position: absolute;
  383. display: inline-block;
  384. font-family: 'FontAwesome';
  385. content: '\F00C';
  386. top: 50%;
  387. left: 4px;
  388. margin-top: -5px;
  389. font-size: 11px;
  390. line-height: 1;
  391. width: 16px;
  392. height: 16px;
  393. color: #333;
  394. }
  395. }
  396. &:disabled {
  397. cursor: not-allowed;
  398. &:checked + label:after {
  399. color: #999;
  400. }
  401. & + label {
  402. cursor: not-allowed;
  403. }
  404. & + label:before {
  405. background-color: #eee;
  406. }
  407. }
  408. }
  409. label {
  410. cursor: pointer;
  411. margin-bottom: 0;
  412. text-align: left;
  413. line-height: 1.2;
  414. &:before {
  415. content: '';
  416. position: absolute;
  417. top: 50%;
  418. left: 0;
  419. margin-top: -9px;
  420. width: 19px;
  421. height: 18px;
  422. display: inline-block;
  423. border-radius: 2px;
  424. border: 1px solid #bbb;
  425. background: #fff;
  426. }
  427. & + label.error {
  428. display: block;
  429. }
  430. }
  431. }
  432. html.dark {
  433. .checkbox-custom {
  434. label {
  435. &:before {
  436. background: $dark-color-3;
  437. border-color: $dark-color-2;
  438. }
  439. }
  440. input[type="checkbox"] {
  441. &:checked + label:after {
  442. color: #fff;
  443. }
  444. &:disabled + label:before {
  445. background: $dark-color-5;
  446. border-color: $dark-color-5;
  447. }
  448. }
  449. }
  450. }
  451. @each $state in $states {
  452. html.dark .checkbox-#{nth($state,1)},
  453. .checkbox-#{nth($state,1)} {
  454. input[type="checkbox"]:checked + label:after {
  455. color: #fff;
  456. }
  457. label:before {
  458. background: #{nth($state,2)};
  459. border-color: darken( nth($state,2), 5% );
  460. }
  461. }
  462. html.dark .checkbox-text-#{nth($state,1)},
  463. .checkbox-text-#{nth($state,1)} {
  464. input[type="checkbox"]:checked + label:after {
  465. color: #{nth($state, 2)};
  466. }
  467. }
  468. }
  469. // CUSTOM RADIO
  470. // -----------------------------------------------------------------------------
  471. /* Form - Custom Radio */
  472. .radio-custom {
  473. position: relative;
  474. padding: 0 0 0 25px;
  475. margin-bottom: 7px;
  476. margin-top: 0;
  477. &.radio-inline {
  478. display: inline-block;
  479. vertical-align: middle;
  480. .form-group & {
  481. margin-top: 7px;
  482. padding-top: 0;
  483. }
  484. }
  485. &:last-child,
  486. &:last-of-type {
  487. margin-bottom: 0;
  488. }
  489. input[type="radio"] {
  490. opacity: 0;
  491. position: absolute;
  492. top: 50%;
  493. left: 3px;
  494. margin: -6px 0 0 0;
  495. z-index: 2;
  496. cursor: pointer;
  497. &:checked {
  498. & + label:after {
  499. content: '';
  500. position: absolute;
  501. top: 50%;
  502. left: 4px;
  503. margin-top: -5px;
  504. display: inline-block;
  505. font-size: 11px;
  506. line-height: 1;
  507. width: 10px;
  508. height: 10px;
  509. background-color: #444;
  510. border-radius: 50px;
  511. -webkit-box-shadow: 0px 0px 1px #444;
  512. box-shadow: 0px 0px 1px #444;
  513. }
  514. }
  515. &:disabled {
  516. cursor: not-allowed;
  517. &:checked + label:after {
  518. color: #999;
  519. }
  520. & + label {
  521. cursor: not-allowed;
  522. }
  523. & + label:before {
  524. background-color: #eee;
  525. }
  526. }
  527. }
  528. label {
  529. cursor: pointer;
  530. margin-bottom: 0;
  531. text-align: left;
  532. line-height: 1.2;
  533. &:before {
  534. content: '';
  535. position: absolute;
  536. top: 50%;
  537. left: 0;
  538. margin-top: -9px;
  539. width: 18px;
  540. height: 18px;
  541. display: inline-block;
  542. border-radius: 50px;
  543. border: 1px solid #bbb;
  544. background: #fff;
  545. }
  546. & + label.error {
  547. display: block;
  548. }
  549. }
  550. }
  551. html.dark {
  552. .radio-custom {
  553. label {
  554. &:before {
  555. background: $dark-color-3;
  556. border-color: $dark-color-2;
  557. }
  558. }
  559. input[type="radio"]{
  560. &:checked + label:after {
  561. background-color: #fff;
  562. }
  563. &:disabled + label:before {
  564. background: $dark-color-5;
  565. border-color: $dark-color-5;
  566. }
  567. }
  568. }
  569. }
  570. @each $state in $states {
  571. html.dark .radio-#{nth($state,1)},
  572. .radio-#{nth($state,1)} {
  573. input[type="radio"]:checked + label:after {
  574. background: #{nth($state,2)};
  575. -webkit-box-shadow: 0px 0px 1px #{nth($state,2)};
  576. box-shadow: 0px 0px 1px #{nth($state,2)};
  577. }
  578. }
  579. }
  580. // ERROR CONTAINER
  581. // -----------------------------------------------------------------------------
  582. /* Form - Error Container */
  583. div.validation-message ul {
  584. display: none;
  585. list-style: none;
  586. margin: -15px -15px 15px -15px;
  587. padding: 15px;
  588. border-bottom: 1px solid #FFCBCB;
  589. background: #FFEFEF;
  590. label.error {
  591. display: block;
  592. padding-left: 22px;
  593. position: relative;
  594. &:before {
  595. font-family: 'FontAwesome';
  596. content: '\f00d';
  597. position: absolute;
  598. top: 0;
  599. left: 0;
  600. font-size: 16px;
  601. color: #D9534F;
  602. display: inline-block;
  603. }
  604. }
  605. }
  606. // DARK - FILE UPLOAD
  607. // -----------------------------------------------------------------------------
  608. html.dark {
  609. .fileupload .uneditable-input {
  610. background-color: $dark-color-3;
  611. border-color: $dark-color-3;
  612. }
  613. .fileupload-new .input-append .btn-file {
  614. border-color: $dark-color-2;
  615. }
  616. }