_forms.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  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. .vs-checkbox-con{
  225. position: relative;
  226. display: flex;
  227. align-items:center;
  228. justify-content: flex-start;
  229. margin: .25rem 0;
  230. input {
  231. position: absolute;
  232. width: 100%;
  233. height: 100%;
  234. opacity: 0;
  235. z-index: 200;
  236. cursor: pointer;
  237. top: 0;
  238. &:checked{
  239. ~.vs-checkbox{
  240. transform: rotate(0deg);
  241. border-color: $primary;
  242. .vs-checkbox--check{
  243. transform: translate(0);
  244. background-color: $primary;
  245. .vs-icon{
  246. transform: translate(0);
  247. line-height: 1.2;
  248. opacity: 1;
  249. }
  250. }
  251. &.vs-checkbox-sm{
  252. .vs-checkbox--check .vs-icon{
  253. font-size: 0.75rem;
  254. }
  255. }
  256. &.vs-checkbox-lg{
  257. .vs-checkbox--check .vs-icon{
  258. font-size: 1.2rem;
  259. }
  260. }
  261. }
  262. }
  263. &:active:checked+.vs-checkbox{
  264. .vs-checkbox--check{
  265. transform: translate(3px);
  266. background-color: $primary;
  267. .vs-icon{
  268. opacity: 1;
  269. transform: translate(6px);
  270. }
  271. }
  272. }
  273. &:disabled{
  274. cursor: default;
  275. pointer-events: none;
  276. +.vs-checkbox {
  277. cursor: default;
  278. opacity: .5;
  279. }
  280. }
  281. }
  282. .vs-checkbox{
  283. cursor: pointer;
  284. position: relative;
  285. width: $vs-checkbox-box;
  286. height: $vs-checkbox-box;
  287. border-width: $vs-checkbox-radio-border-width;
  288. border-style: solid;
  289. border-color: $vs-checkbox-radio-border-color;
  290. border-radius: 2px;
  291. transform: rotate(-90deg);
  292. transition: all .2s ease;
  293. overflow: hidden;
  294. margin-right: .5rem;
  295. &.vs-checkbox-sm{
  296. width: $vs-checkbox-box-sm;
  297. height: $vs-checkbox-box-sm;
  298. }
  299. &.vs-checkbox-lg{
  300. width: $vs-checkbox-box-lg;
  301. height: $vs-checkbox-box-lg;
  302. }
  303. .vs-checkbox--check{
  304. width: 100%;
  305. height: 100%;
  306. position: absolute;
  307. left: 0;
  308. transform: translate(100%);
  309. transform-origin: right;
  310. transition: all .2s ease;
  311. z-index: 10;
  312. .vs-icon{
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. color: $white;
  317. }
  318. }
  319. }
  320. }
  321. .vs-radio-con{
  322. position: relative;
  323. display: flex;
  324. align-items:center;
  325. justify-content: flex-start;
  326. margin: .25rem 0;
  327. input {
  328. position: absolute;
  329. width: 100%;
  330. height: 100%;
  331. opacity: 0;
  332. z-index: 200;
  333. cursor: pointer;
  334. &:checked{
  335. ~.vs-radio{
  336. transform: rotate(0deg);
  337. outline: 0;
  338. .vs-radio--circle{
  339. background: rgba($primary,1);
  340. box-shadow: 0 3px 12px 0 rgba($primary,.4);
  341. opacity: 1;
  342. transform: scale(1);
  343. }
  344. .vs-radio--border{
  345. opacity: 0;
  346. transform: scale(0.3);
  347. }
  348. }
  349. }
  350. &:disabled{
  351. cursor: default;
  352. pointer-events: none;
  353. +.vs-radio {
  354. cursor: default;
  355. opacity: .5;
  356. }
  357. }
  358. &:active{
  359. ~.vs-radio{
  360. transform: scale(1.1);
  361. }
  362. }
  363. }
  364. .vs-radio{
  365. cursor: pointer;
  366. position: relative;
  367. width: $vs-radio-box;
  368. height: $vs-radio-box;
  369. transition: all .2s ease;
  370. margin-right: .5rem;
  371. &.vs-radio-sm{
  372. width: $vs-radio-box-sm;
  373. height: $vs-radio-box-sm;
  374. }
  375. &.vs-radio-lg{
  376. width: $vs-radio-box-lg;
  377. height: $vs-radio-box-lg;
  378. }
  379. .vs-radio--border, .vs-radio--circle {
  380. width: 100%;
  381. height: 100%;
  382. position: absolute;
  383. left: 0;
  384. transition: all .25s ease;
  385. top: 0;
  386. border-radius: 50%;
  387. }
  388. .vs-radio--border{
  389. background: transparent;
  390. border: $vs-checkbox-radio-border-width solid $vs-checkbox-radio-border-color;
  391. }
  392. .vs-radio--circle{
  393. opacity: 0;
  394. transform: scale(0.1);
  395. }
  396. }
  397. }
  398. /* Textarea with Counter */
  399. .counter-value{
  400. background-color: $primary;
  401. color: $white;
  402. padding: 1px 6px;
  403. font-size: .6rem;
  404. border-radius: 0 0 5px 5px;
  405. margin-right: 1rem;
  406. }
  407. /* Input box with icon divider */
  408. .form-group{
  409. &.input-divider-left{
  410. .form-control-position{
  411. i{
  412. padding: 0.2rem 0.5rem;
  413. border-right: 1px solid darken($body-bg, 12%);
  414. }
  415. }
  416. }
  417. &.input-divider-right{
  418. .form-control-position{
  419. i{
  420. padding: 0.2rem 0.5rem;
  421. border-left: 1px solid darken($body-bg, 12%);
  422. }
  423. }
  424. }
  425. }
  426. /* input-groups-lg and input-groups-sm */
  427. .input-group-lg, .input-group-sm{
  428. .form-control{
  429. padding: 0.7rem;
  430. }
  431. }
  432. /* Bootstrap touchspin */
  433. .bootstrap-touchspin{
  434. &.input-group{
  435. width: 8.4rem;
  436. align-items: center;
  437. .form-control{
  438. padding: 5px;
  439. height: auto;
  440. border: 0;
  441. background-color: $body-bg;
  442. border-radius: 5px !important;
  443. text-align: center;
  444. font-weight: 500;
  445. &:focus{
  446. z-index: 1;
  447. box-shadow: none;
  448. }
  449. }
  450. }
  451. .bootstrap-touchspin-injected{
  452. margin: 0 !important;
  453. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  454. padding: 0;
  455. min-width: 22px;
  456. min-height: 22px;
  457. border-radius: 5px !important;
  458. position: relative;
  459. i{
  460. font-size: 0.8rem;
  461. position: relative;
  462. top: -1px;
  463. }
  464. }
  465. .bootstrap-touchspin-down{
  466. left: 12px;
  467. }
  468. .bootstrap-touchspin-up{
  469. right: 12px;
  470. }
  471. }
  472. // Disabled Touchspin
  473. &.disabled-touchspin{
  474. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  475. background-color: rgba(0,0,0,.5) !important;
  476. cursor: default;
  477. opacity: .5;
  478. }
  479. }
  480. // Touchspin Large
  481. &.input-group-lg{
  482. width: 9.375rem;
  483. .touchspin{
  484. &.form-control{
  485. height: auto !important;
  486. }
  487. }
  488. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  489. i{
  490. font-size: 1rem;
  491. }
  492. }
  493. }
  494. // Touchspin Small
  495. &.input-group-sm{
  496. width: 6.25rem;
  497. .touchspin{
  498. &.form-control{
  499. height: auto !important;
  500. }
  501. }
  502. .bootstrap-touchspin-injected{
  503. .bootstrap-touchspin-down, .bootstrap-touchspin-up{
  504. min-width: 16px;
  505. min-height: 16px;
  506. padding-top: 2.2px;
  507. i{
  508. font-size: 0.6rem;
  509. }
  510. }
  511. }
  512. }
  513. }
  514. .btn.disabled-max-min{
  515. background-color: rgba(0,0,0,.5) !important;
  516. cursor: default;
  517. }
  518. /* Number Type Input Box Scss for - Remove arrow on hover */
  519. input[type=number]::-webkit-inner-spin-button,
  520. input[type=number]::-webkit-outer-spin-button{
  521. -webkit-appearance: none;
  522. }
  523. /* Number Type Input Box Scss for Touchspin - Remove arrow for firefox */
  524. .bootstrap-touchspin{
  525. &.input-group{
  526. input[type=number] {-moz-appearance: textfield;}
  527. }
  528. }
  529. // IE Specific CSS
  530. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  531. // floating Label Group
  532. .form-label-group{
  533. label {
  534. display: none;
  535. }
  536. }
  537. // Bootstrap Select
  538. select.form-control {
  539. &:not([multiple="multiple"]){
  540. background: none;
  541. }
  542. }
  543. // Custom-File-Input
  544. .custom-file-label{
  545. &::after{
  546. padding: 1.34rem 0.7rem 1.25rem;
  547. }
  548. }
  549. }
  550. // Date & Time Picker - Form Control Bg color
  551. .picker__input{
  552. &.form-control {
  553. background-color: $white;
  554. }
  555. }
  556. // input Groups specific SCSS
  557. .input-group {
  558. .form-control{
  559. height: auto;
  560. }
  561. .input-group-prepend, .input-group-append {
  562. // dropdown arrow position
  563. .dropdown-toggle{
  564. &::after{
  565. left: 0;
  566. }
  567. }
  568. // checkbox and radio margin
  569. .vs-checkbox-con, .vs-checkbox, .vs-radio-con, .vs-radio{
  570. margin: 0;
  571. }
  572. }
  573. &.input-group-lg{
  574. .form-control{
  575. &::placeholder{
  576. font-size: 1.25rem;
  577. }
  578. }
  579. .input-group-prepend, .input-group-append{
  580. .btn{
  581. line-height: 1.3;
  582. font-size: 1.3rem;
  583. }
  584. }
  585. }
  586. &.input-group-sm{
  587. .form-control{
  588. &::placeholder{
  589. font-size: 0.7rem;
  590. }
  591. }
  592. }
  593. }