_forms.scss 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  1. // placeholder spacific scss
  2. .form-control{
  3. &::placeholder{
  4. font-size: 0.85rem;
  5. color: rgba($black, 0.4);
  6. transition: all .2s ease;
  7. }
  8. &:-ms-input-placeholder {
  9. color: darken($body-bg, 20%);
  10. }
  11. &:focus{
  12. &::placeholder{
  13. transform: translate(5px);
  14. transition: all .2s ease;
  15. }
  16. ~.form-control-position{
  17. i{
  18. color: $primary;
  19. }
  20. }
  21. }
  22. }
  23. /* Form specific Scss */
  24. // Form Label Scscc
  25. label{
  26. color: darken($body-bg, 70%);
  27. font-size: 0.85rem;
  28. margin-bottom: 0;
  29. padding-left: 0.2rem;
  30. }
  31. // Text area fontsize and line height
  32. textarea.form-control{
  33. line-height: 1.6rem;
  34. font-size: 1rem;
  35. }
  36. // Form group Scscc
  37. .form-group{
  38. margin-bottom: 1.5rem;
  39. }
  40. // Form control Scscc
  41. .form-control{
  42. border: 1px solid darken($body-bg, 12%);
  43. color: darken($body-bg, 60%);
  44. }
  45. // Used for Card - Check it and remove if not used
  46. .form-section{
  47. color: $gray-600;
  48. line-height: 3rem;
  49. margin-bottom: 20px;
  50. border-bottom: 1px solid $gray-600;
  51. i{
  52. font-size: 20px;
  53. margin-left: 5px;
  54. margin-right: 10px;
  55. }
  56. }
  57. /* .form-body{
  58. overflow: hidden;
  59. } */
  60. // Used for Card - Check it and remove if not used
  61. .form-actions{
  62. border-top: 1px solid darken($body-bg, 10%);
  63. padding: 20px 0;
  64. margin-top: 20px;
  65. &.filled{
  66. background-color: $body-bg;
  67. }
  68. &.center{
  69. text-align: center;
  70. }
  71. &.right{
  72. text-align: right;
  73. }
  74. &.top{
  75. border-top: 0;
  76. border-bottom: 1px solid darken($body-bg, 10%);
  77. margin-top: 0;
  78. margin-bottom: 20px;
  79. }
  80. @include media-breakpoint-down(sm) {
  81. .buttons-group{
  82. float: left !important;
  83. margin-bottom: 10px;
  84. }
  85. }
  86. }
  87. // Form-horizotnal layout
  88. .form-horizontal{
  89. .form-group{
  90. @include media-breakpoint-up(sm) {
  91. .label-control{
  92. text-align: right;
  93. }
  94. }
  95. }
  96. }
  97. // Form Control Large
  98. .form-control.form-control-lg{
  99. padding: 1rem;
  100. &::placeholder{
  101. font-size: 1.25rem;
  102. }
  103. }
  104. // Form Control Small
  105. .form-control.form-control-sm{
  106. padding: 0.6rem;
  107. &::placeholder{
  108. font-size: 0.7rem;
  109. }
  110. }
  111. // Custom-File-Input
  112. .custom-file-label{
  113. padding: 0.4rem $custom-file-padding-x;
  114. &::after{
  115. padding: 0.4rem $custom-file-padding-x;
  116. height: auto;
  117. }
  118. }
  119. // Select Inputs Specific SCSS
  120. select.form-control {
  121. &:not([multiple="multiple"]){
  122. background-image:
  123. url("../images/pages/arrow-down.png");
  124. background-position:
  125. calc(100% - 12px) 13px,
  126. calc(100% - 20px) 13px,
  127. 100% 0;
  128. background-size:
  129. 12px 12px,
  130. 10px 10px;
  131. background-repeat: no-repeat;
  132. -webkit-appearance: none;
  133. -moz-appearance: none;
  134. padding-right: 1.5rem;
  135. }
  136. }
  137. // For customs-select remove double arrow
  138. .custom-select{
  139. -moz-appearance: none; // For firefox
  140. -webkit-appearance: none; // for chorme
  141. }
  142. // input group addon
  143. .input-group-addon {
  144. background-color: #ECEFF1;
  145. border-color: #BABFC7;
  146. }
  147. // Custom Checkbox
  148. .custom-control-label::before, .custom-control-label::after{
  149. width: 1.143rem;
  150. height: 1.143rem;
  151. top: 0.08rem;
  152. }
  153. // Custom-checkbox when not disabled and active
  154. .custom-control-input:not(:disabled){
  155. &:active ~ .custom-control-label{
  156. &::before {
  157. background-color: $primary;
  158. border-color: $primary;
  159. }
  160. }
  161. }
  162. /* Floating label Group */
  163. .form-label-group{
  164. position: relative;
  165. margin-bottom: 1.5rem;
  166. // Form-Control-Large in Floating Label Group
  167. .form-control-lg{
  168. ~ label{
  169. font-size: 1.25rem;
  170. padding: 1rem;
  171. }
  172. }
  173. // Form-Control-Small in Floating Label Group
  174. .form-control-sm{
  175. ~ label{
  176. font-size: 0.7rem;
  177. }
  178. }
  179. // Form-label
  180. > label {
  181. position: absolute;
  182. top: 0;
  183. left: 0;
  184. display: block;
  185. transition: all .25s ease-in-out;
  186. padding: .6rem;
  187. pointer-events: none;
  188. cursor: text;
  189. color: rgba($black, 0.4);
  190. font-size: .85rem;
  191. opacity: 0;
  192. }
  193. // form-input
  194. > input, textarea{
  195. padding: .6rem;
  196. // from-input on focus change label color
  197. &:focus, &:not(:active){
  198. &:not(:placeholder-shown) ~ label {
  199. color: rgba($primary, 1) !important;
  200. transition: all .25s ease-in-out;
  201. opacity: 1;
  202. }
  203. }
  204. &:not(:focus){
  205. &:not(:placeholder-shown) ~ label {
  206. color: rgba($black, 0.4) !important;
  207. }
  208. }
  209. // form-label after entering text in input box
  210. &:not(:placeholder-shown) ~ label {
  211. padding : .25rem 0;
  212. font-size: .7rem;
  213. top: -20px;
  214. left: 3px;
  215. }
  216. }
  217. // has-icon left with input
  218. &.has-icon-left{
  219. > label{
  220. left: 36px;
  221. }
  222. }
  223. }
  224. /* Vuexy Custom Checkbox */
  225. .vs-checkbox-con{
  226. position: relative;
  227. display: flex;
  228. align-items:center;
  229. justify-content: flex-start;
  230. margin: .25rem 0;
  231. input {
  232. position: absolute;
  233. width: 100%;
  234. height: 100%;
  235. opacity: 0;
  236. z-index: 200;
  237. cursor: pointer;
  238. top: 0;
  239. &:checked{
  240. ~.vs-checkbox{
  241. transform: rotate(0deg);
  242. border-color: $primary;
  243. .vs-checkbox--check{
  244. transform: translate(0);
  245. background-color: $primary;
  246. .vs-icon{
  247. transform: translate(0);
  248. line-height: 1.2;
  249. opacity: 1;
  250. }
  251. }
  252. &.vs-checkbox-sm{
  253. .vs-checkbox--check .vs-icon{
  254. font-size: 0.75rem;
  255. }
  256. }
  257. &.vs-checkbox-lg{
  258. .vs-checkbox--check .vs-icon{
  259. font-size: 1.2rem;
  260. }
  261. }
  262. }
  263. }
  264. &:active:checked+.vs-checkbox{
  265. .vs-checkbox--check{
  266. transform: translate(3px);
  267. background-color: $primary;
  268. .vs-icon{
  269. opacity: 1;
  270. transform: translate(6px);
  271. }
  272. }
  273. }
  274. &:disabled{
  275. cursor: default;
  276. pointer-events: none;
  277. +.vs-checkbox {
  278. cursor: default;
  279. opacity: .5;
  280. }
  281. }
  282. }
  283. .vs-checkbox{
  284. cursor: pointer;
  285. position: relative;
  286. width: $vs-checkbox-box;
  287. height: $vs-checkbox-box;
  288. border-width: $vs-checkbox-radio-border-width;
  289. border-style: solid;
  290. border-color: $vs-checkbox-radio-border-color;
  291. border-radius: 2px;
  292. transform: rotate(-90deg);
  293. transition: all .2s ease;
  294. overflow: hidden;
  295. margin-right: .5rem;
  296. &.vs-checkbox-sm{
  297. width: $vs-checkbox-box-sm;
  298. height: $vs-checkbox-box-sm;
  299. }
  300. &.vs-checkbox-lg{
  301. width: $vs-checkbox-box-lg;
  302. height: $vs-checkbox-box-lg;
  303. }
  304. .vs-checkbox--check{
  305. width: 100%;
  306. height: 100%;
  307. position: absolute;
  308. left: 0;
  309. transform: translate(100%);
  310. transform-origin: right;
  311. transition: all .2s ease;
  312. z-index: 10;
  313. .vs-icon{
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. color: $white;
  318. }
  319. }
  320. }
  321. }
  322. /* Vuexy Custom Radio */
  323. .vs-radio-con{
  324. position: relative;
  325. display: flex;
  326. align-items:center;
  327. justify-content: flex-start;
  328. margin: .25rem 0;
  329. input {
  330. position: absolute;
  331. width: 100%;
  332. height: 100%;
  333. opacity: 0;
  334. z-index: 200;
  335. cursor: pointer;
  336. &:checked{
  337. ~.vs-radio{
  338. transform: rotate(0deg);
  339. outline: 0;
  340. .vs-radio--circle{
  341. background: rgba($primary,1);
  342. box-shadow: 0 3px 12px 0 rgba($primary,.4);
  343. opacity: 1;
  344. transform: scale(1);
  345. }
  346. .vs-radio--border{
  347. opacity: 0;
  348. transform: scale(0.3);
  349. }
  350. }
  351. }
  352. &:disabled{
  353. cursor: default;
  354. pointer-events: none;
  355. +.vs-radio {
  356. cursor: default;
  357. opacity: .5;
  358. }
  359. }
  360. &:active{
  361. ~.vs-radio{
  362. transform: scale(1.1);
  363. }
  364. }
  365. }
  366. .vs-radio{
  367. cursor: pointer;
  368. position: relative;
  369. width: $vs-radio-box;
  370. height: $vs-radio-box;
  371. transition: all .2s ease;
  372. margin-right: .5rem;
  373. &.vs-radio-sm{
  374. width: $vs-radio-box-sm;
  375. height: $vs-radio-box-sm;
  376. }
  377. &.vs-radio-lg{
  378. width: $vs-radio-box-lg;
  379. height: $vs-radio-box-lg;
  380. }
  381. .vs-radio--border, .vs-radio--circle {
  382. width: 100%;
  383. height: 100%;
  384. position: absolute;
  385. left: 0;
  386. transition: all .25s ease;
  387. top: 0;
  388. border-radius: 50%;
  389. }
  390. .vs-radio--border{
  391. background: transparent;
  392. border: $vs-checkbox-radio-border-width solid $vs-checkbox-radio-border-color;
  393. }
  394. .vs-radio--circle{
  395. opacity: 0;
  396. transform: scale(0.1);
  397. }
  398. }
  399. }
  400. /* Switches */
  401. .custom-switch{
  402. padding-left: 0;
  403. .custom-control-label{
  404. height: 1.571rem;
  405. width: 3.1rem;
  406. padding: 0;
  407. /* For bg color of switch*/
  408. &::before{
  409. border: none;
  410. background-color: $switch-bg-color;
  411. height: 1.571rem;
  412. left: -.2857rem;
  413. box-shadow: none !important;
  414. transition: all .25s ease;
  415. cursor: pointer;
  416. user-select: none;
  417. top: 0;
  418. left: 0;
  419. }
  420. /*For Switch handle*/
  421. &:after{
  422. position: absolute;
  423. top: 2px;
  424. left: 2px;
  425. box-shadow: none;
  426. background-color: $switch-indicator-color;
  427. transition:all .25s ease;
  428. cursor: pointer;
  429. user-select: none;
  430. }
  431. /*For Switch text*/
  432. .switch-text-left,.switch-text-right,
  433. .switch-icon-left,.switch-icon-right{
  434. position: absolute;
  435. top: 5px;
  436. font-size: .7rem;
  437. cursor: pointer;
  438. user-select: none;
  439. }
  440. .switch-text-left,.switch-icon-left{
  441. left: 7px;
  442. color: $white
  443. }
  444. .switch-text-right,.switch-icon-right{
  445. right: 7px
  446. }
  447. &:focus{
  448. outline: 0;
  449. }
  450. }
  451. /*For Switch label*/
  452. .switch-label{
  453. padding-left: 1rem;
  454. }
  455. // after its checked
  456. .custom-control-input:checked ~ .custom-control-label::before{
  457. box-shadow: none;
  458. }
  459. /*For Switch Handle Animation*/
  460. .custom-control-input:checked ~ .custom-control-label::after{
  461. transform: translateX(1.4rem);
  462. }
  463. .custom-control-input:not(:checked) ~ .custom-control-label{
  464. .switch-text-left{
  465. opacity: 0;
  466. }
  467. .switch-text-right{
  468. opacity: 1;
  469. }
  470. }
  471. .custom-control-input:checked ~ .custom-control-label{
  472. .switch-text-right{
  473. opacity: 0;
  474. }
  475. .switch-text-left{
  476. opacity: 1;
  477. }
  478. }
  479. .custom-control-input:not(:disabled):active ~ .custom-control-label::before{
  480. background-color: $switch-bg-color;
  481. }
  482. // For Switch Sizes
  483. // switch md
  484. &.switch-md{
  485. .custom-control-label{
  486. width: $switch-md-size;
  487. height: 1.571rem;
  488. &::before{
  489. width: $switch-md-size;
  490. border: none;
  491. background-color: $switch-bg-color;
  492. height: 1.571rem;
  493. left: -.2857rem;
  494. box-shadow: none !important;
  495. transition: all .25s ease;
  496. cursor: pointer;
  497. user-select: none;
  498. }
  499. &:after{
  500. box-shadow: none;
  501. background-color: $switch-indicator-color;
  502. transition:all .25s ease;
  503. cursor: pointer;
  504. user-select: none;
  505. position: absolute;
  506. top: 2px;
  507. left:-2px;
  508. }
  509. .switch-text-right,.switch-icon-right{
  510. right: 9px;
  511. }
  512. .switch-text-left,.switch-icon-left{
  513. left: 5px;
  514. }
  515. }
  516. .custom-control-input:checked ~ .custom-control-label::after{
  517. transform: translateX(2.3rem);
  518. }
  519. }
  520. // switch lg
  521. &.switch-lg{
  522. .custom-control-label{
  523. width: $switch-lg-size;
  524. height: 1.571rem;
  525. &::before{
  526. width: $switch-lg-size;
  527. border: none;
  528. background-color: $switch-bg-color;
  529. height: 1.571rem;
  530. left: -.2857rem;
  531. box-shadow: none !important;
  532. transition: all .25s ease;
  533. cursor: pointer;
  534. user-select: none;
  535. }
  536. &:after{
  537. position: absolute;
  538. top: 2px;
  539. left: -2px;
  540. box-shadow: none;
  541. background-color: $switch-indicator-color;
  542. transition:all .25s ease;
  543. cursor: pointer;
  544. user-select: none;
  545. }
  546. .switch-text-right,.switch-icon-right{
  547. right: 10px;
  548. }
  549. }
  550. .custom-control-input:checked ~ .custom-control-label::after{
  551. transform: translateX(3.8rem);
  552. }
  553. }
  554. }
  555. /* Textarea with Counter */
  556. .counter-value{
  557. background-color: $primary;
  558. color: $white;
  559. padding: 1px 6px;
  560. font-size: .6rem;
  561. border-radius: 0 0 5px 5px;
  562. margin-right: 1rem;
  563. }
  564. /* Input box with icon divider */
  565. .form-group{
  566. &.input-divider-left{
  567. .form-control-position{
  568. i{
  569. padding: 0.2rem 0.5rem;
  570. border-right: 1px solid darken($body-bg, 12%);
  571. }
  572. }
  573. }
  574. &.input-divider-right{
  575. .form-control-position{
  576. i{
  577. padding: 0.2rem 0.5rem;
  578. border-left: 1px solid darken($body-bg, 12%);
  579. }
  580. }
  581. }
  582. }
  583. /* input-groups-lg and input-groups-sm */
  584. .input-group-lg, .input-group-sm{
  585. .form-control{
  586. padding: 0.7rem;
  587. }
  588. }
  589. /* Bootstrap touchspin */
  590. .bootstrap-touchspin{
  591. &.input-group{
  592. width: 8.4rem;
  593. align-items: center;
  594. .form-control{
  595. padding: 5px;
  596. height: auto;
  597. border: 0;
  598. background-color: $body-bg;
  599. border-radius: 5px !important;
  600. text-align: center;
  601. font-weight: 500;
  602. &:focus{
  603. z-index: 1;
  604. box-shadow: none;
  605. }
  606. }
  607. }
  608. .bootstrap-touchspin-injected{
  609. margin: 0 !important;
  610. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  611. padding: 0;
  612. min-width: 22px;
  613. min-height: 22px;
  614. border-radius: 5px !important;
  615. position: relative;
  616. i{
  617. font-size: 0.8rem;
  618. position: relative;
  619. top: -1px;
  620. }
  621. }
  622. .bootstrap-touchspin-down{
  623. left: 12px;
  624. }
  625. .bootstrap-touchspin-up{
  626. right: 12px;
  627. }
  628. }
  629. // Disabled Touchspin
  630. &.disabled-touchspin{
  631. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  632. background-color: rgba(0,0,0,.5) !important;
  633. cursor: default;
  634. opacity: .5;
  635. }
  636. }
  637. // Touchspin Large
  638. &.input-group-lg{
  639. width: 9.375rem;
  640. .touchspin{
  641. &.form-control{
  642. height: auto !important;
  643. }
  644. }
  645. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  646. i{
  647. font-size: 1rem;
  648. }
  649. }
  650. }
  651. // Touchspin Small
  652. &.input-group-sm{
  653. width: 6.25rem;
  654. .touchspin{
  655. &.form-control{
  656. height: auto !important;
  657. }
  658. }
  659. .bootstrap-touchspin-injected{
  660. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  661. min-width: 16px;
  662. min-height: 16px;
  663. padding-top: 2.2px;
  664. i{
  665. font-size: 0.6rem;
  666. }
  667. }
  668. }
  669. }
  670. }
  671. .btn.disabled-max-min{
  672. background-color: rgba(0,0,0,.5) !important;
  673. cursor: default;
  674. }
  675. /* Number Type Input Box Scss for - Remove arrow on hover */
  676. input[type=number]::-webkit-inner-spin-button,
  677. input[type=number]::-webkit-outer-spin-button{
  678. -webkit-appearance: none;
  679. }
  680. /* Number Type Input Box Scss for Touchspin - Remove arrow for firefox */
  681. .bootstrap-touchspin{
  682. &.input-group{
  683. input[type=number] {-moz-appearance: textfield;}
  684. }
  685. }
  686. // IE Specific CSS
  687. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  688. // floating Label Group
  689. .form-label-group{
  690. label {
  691. display: none;
  692. }
  693. }
  694. // Bootstrap Select
  695. select.form-control {
  696. &:not([multiple="multiple"]){
  697. background: none;
  698. }
  699. }
  700. // Custom-File-Input
  701. .custom-file-label{
  702. &::after{
  703. padding: 1.34rem 0.7rem 1.25rem;
  704. }
  705. }
  706. }
  707. // Date & Time Picker - Form Control Bg color
  708. .picker__input{
  709. &.form-control {
  710. background-color: $white;
  711. }
  712. }
  713. // input Groups specific SCSS
  714. .input-group {
  715. .form-control{
  716. height: auto;
  717. }
  718. .input-group-prepend, .input-group-append {
  719. // dropdown arrow position
  720. .dropdown-toggle{
  721. &::after{
  722. left: 0;
  723. }
  724. }
  725. // checkbox and radio margin
  726. .vs-checkbox-con, .vs-checkbox, .vs-radio-con, .vs-radio{
  727. margin: 0;
  728. }
  729. }
  730. &.input-group-lg{
  731. .form-control{
  732. &::placeholder{
  733. font-size: 1.25rem;
  734. }
  735. }
  736. .input-group-prepend, .input-group-append{
  737. .btn{
  738. line-height: 1.3;
  739. font-size: 1.3rem;
  740. }
  741. }
  742. }
  743. &.input-group-sm{
  744. .form-control{
  745. &::placeholder{
  746. font-size: 0.7rem;
  747. }
  748. }
  749. }
  750. }