_forms.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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. /* Textarea with Counter */
  401. .counter-value{
  402. background-color: $primary;
  403. color: $white;
  404. padding: 1px 6px;
  405. font-size: .6rem;
  406. border-radius: 0 0 5px 5px;
  407. margin-right: 1rem;
  408. }
  409. /* Input box with icon divider */
  410. .form-group{
  411. &.input-divider-left{
  412. .form-control-position{
  413. i{
  414. padding: 0.2rem 0.5rem;
  415. border-right: 1px solid darken($body-bg, 12%);
  416. }
  417. }
  418. }
  419. &.input-divider-right{
  420. .form-control-position{
  421. i{
  422. padding: 0.2rem 0.5rem;
  423. border-left: 1px solid darken($body-bg, 12%);
  424. }
  425. }
  426. }
  427. }
  428. /* input-groups-lg and input-groups-sm */
  429. .input-group-lg, .input-group-sm{
  430. .form-control{
  431. padding: 0.7rem;
  432. }
  433. }
  434. /* Bootstrap touchspin */
  435. .bootstrap-touchspin{
  436. &.input-group{
  437. width: 8.4rem;
  438. align-items: center;
  439. .form-control{
  440. padding: 5px;
  441. height: auto;
  442. border: 0;
  443. background-color: $body-bg;
  444. border-radius: 5px !important;
  445. text-align: center;
  446. font-weight: 500;
  447. &:focus{
  448. z-index: 1;
  449. box-shadow: none;
  450. }
  451. }
  452. }
  453. .bootstrap-touchspin-injected{
  454. margin: 0 !important;
  455. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  456. padding: 0;
  457. min-width: 22px;
  458. min-height: 22px;
  459. border-radius: 5px !important;
  460. position: relative;
  461. i{
  462. font-size: 0.8rem;
  463. position: relative;
  464. top: -1px;
  465. }
  466. }
  467. .bootstrap-touchspin-down{
  468. left: 12px;
  469. }
  470. .bootstrap-touchspin-up{
  471. right: 12px;
  472. }
  473. }
  474. // Disabled Touchspin
  475. &.disabled-touchspin{
  476. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  477. background-color: rgba(0,0,0,.5) !important;
  478. cursor: default;
  479. opacity: .5;
  480. }
  481. }
  482. // Touchspin Large
  483. &.input-group-lg{
  484. width: 9.375rem;
  485. .touchspin{
  486. &.form-control{
  487. height: auto !important;
  488. }
  489. }
  490. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  491. i{
  492. font-size: 1rem;
  493. }
  494. }
  495. }
  496. // Touchspin Small
  497. &.input-group-sm{
  498. width: 6.25rem;
  499. .touchspin{
  500. &.form-control{
  501. height: auto !important;
  502. }
  503. }
  504. .bootstrap-touchspin-injected{
  505. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  506. min-width: 16px;
  507. min-height: 16px;
  508. padding-top: 2.2px;
  509. i{
  510. font-size: 0.6rem;
  511. }
  512. }
  513. }
  514. }
  515. }
  516. .btn.disabled-max-min{
  517. background-color: rgba(0,0,0,.5) !important;
  518. cursor: default;
  519. }
  520. /* Number Type Input Box Scss for - Remove arrow on hover */
  521. input[type=number]::-webkit-inner-spin-button,
  522. input[type=number]::-webkit-outer-spin-button{
  523. -webkit-appearance: none;
  524. }
  525. /* Number Type Input Box Scss for Touchspin - Remove arrow for firefox */
  526. .bootstrap-touchspin{
  527. &.input-group{
  528. input[type=number] {-moz-appearance: textfield;}
  529. }
  530. }
  531. // IE Specific CSS
  532. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  533. // floating Label Group
  534. .form-label-group{
  535. label {
  536. display: none;
  537. }
  538. }
  539. // Bootstrap Select
  540. select.form-control {
  541. &:not([multiple="multiple"]){
  542. background: none;
  543. }
  544. }
  545. // Custom-File-Input
  546. .custom-file-label{
  547. &::after{
  548. padding: 1.34rem 0.7rem 1.25rem;
  549. }
  550. }
  551. }
  552. // Date & Time Picker - Form Control Bg color
  553. .picker__input{
  554. &.form-control {
  555. background-color: $white;
  556. }
  557. }
  558. // input Groups specific SCSS
  559. .input-group {
  560. .form-control{
  561. height: auto;
  562. }
  563. .input-group-prepend, .input-group-append {
  564. // dropdown arrow position
  565. .dropdown-toggle{
  566. &::after{
  567. left: 0;
  568. }
  569. }
  570. // checkbox and radio margin
  571. .vs-checkbox-con, .vs-checkbox, .vs-radio-con, .vs-radio{
  572. margin: 0;
  573. }
  574. }
  575. &.input-group-lg{
  576. .form-control{
  577. &::placeholder{
  578. font-size: 1.25rem;
  579. }
  580. }
  581. .input-group-prepend, .input-group-append{
  582. .btn{
  583. line-height: 1.3;
  584. font-size: 1.3rem;
  585. }
  586. }
  587. }
  588. &.input-group-sm{
  589. .form-control{
  590. &::placeholder{
  591. font-size: 0.7rem;
  592. }
  593. }
  594. }
  595. }