fileinput.scss 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. /*!
  2. * bootstrap-fileinput v5.2.3
  3. * http://plugins.krajee.com/file-input
  4. *
  5. * Krajee default styling for bootstrap-fileinput.
  6. *
  7. * Author: Kartik Visweswaran
  8. * Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com
  9. *
  10. * Licensed under the BSD-3-Clause
  11. * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
  12. */
  13. //colors
  14. $mountain-mist: #999 !default;
  15. $apple-blossom: #a94442 !default;
  16. $vanilla-ice: #f2dede !default;
  17. $oyster-pink: #ebccd1 !default;
  18. $gallery: #eee !default;
  19. $alto: #ddd !default;
  20. $celeste: #ccc !default;
  21. $green: #008000 !default;
  22. $mine-shaft: #333 !default;
  23. $boston-blue: #428bca !default;
  24. $pelorous: #17a2b8 !default;
  25. $tapa: #777 !default;
  26. $black: #000 !default;
  27. $white: #fff !default;
  28. $black-20: rgba(0, 0, 0, 0.2) !default;
  29. $black-30: rgba(0, 0, 0, 0.3) !default;
  30. $black-40: rgba(0, 0, 0, 0.4) !default;
  31. $mystic: #e1edf7 !default;
  32. $perano: #a1abff !default;
  33. $silver-chalice: #aaa !default;
  34. $viking: #5acde2 !default;
  35. $curious-blue: #1c94c4 !default;
  36. $link-water: #d9edf7 !default;
  37. $gray-1=
  38. #5c636a
  39. !default
  40. ;
  41. $gray-2=
  42. #6c757d
  43. !default
  44. ;
  45. //fonts
  46. $font-0: Impact !default;
  47. $font-1: Charcoal !default;
  48. $font-2: sans-serif !default;
  49. $font-3: Menlo !default;
  50. $font-4: Monaco !default;
  51. $font-5: Consolas !default;
  52. $font-6: "Courier New" !default;
  53. $font-7: monospace !default;
  54. //urls
  55. $url-0: url(../img/loading.gif) !default;
  56. $url-1: url(../img/loading-sm.gif) !default;
  57. //standard measures
  58. $radius: 4px !default;
  59. $pad: 5px !default;
  60. $border: 1px !default;
  61. //operations
  62. @function multiply($pixels, $multiplier) {
  63. @return $pixels * $multiplier;
  64. }
  65. //@extend-elements
  66. %set-invisible {
  67. width: 0;
  68. height: 0;
  69. }
  70. %set-hidden {
  71. display: none;
  72. }
  73. %set-absolute {
  74. position: absolute;
  75. }
  76. %set-relative {
  77. position: relative;
  78. }
  79. %set-text-left {
  80. text-align: left;
  81. }
  82. %set-error {
  83. @extend %set-text-left;
  84. margin: 0;
  85. }
  86. %set-indicator {
  87. float: left;
  88. margin-top: multiply($pad, 2);
  89. width: multiply($pad, 3.2);
  90. height: multiply($pad, 3.2);
  91. }
  92. %set-progress {
  93. height: multiply($pad, 2.2);
  94. font-size: multiply($pad, 1.8);
  95. }
  96. %set-caption {
  97. display: block;
  98. white-space: nowrap;
  99. overflow: hidden;
  100. text-overflow: ellipsis;
  101. width: multiply($pad, 32);
  102. height: multiply($pad, 3);
  103. margin: auto;
  104. }
  105. %set-object {
  106. max-width: 100%;
  107. max-height: 100%;
  108. width: auto;
  109. }
  110. %set-object-video {
  111. @extend %set-object;
  112. height: 100%;
  113. }
  114. %set-object-default {
  115. width: 100%;
  116. }
  117. .kv-hidden {
  118. @extend %set-hidden;
  119. }
  120. .hide-content .kv-file-content {
  121. @extend %set-hidden;
  122. }
  123. .file-input {
  124. @extend %set-relative;
  125. }
  126. .file-no-browse {
  127. @extend %set-absolute;
  128. left: 50%;
  129. bottom: 20%;
  130. width: 1px;
  131. height: 1px;
  132. font-size: 0;
  133. opacity: 0;
  134. border: none;
  135. background: none;
  136. outline: none;
  137. box-shadow: none;
  138. }
  139. .file-loading {
  140. input[type=file] {
  141. @extend %set-invisible;
  142. }
  143. &:before {
  144. @extend %set-relative;
  145. content: " Loading...";
  146. display: inline-block;
  147. padding-left: multiply($pad, 4);
  148. line-height: multiply($pad, 3.2);
  149. font-size: multiply($pad, 2.6);
  150. font-variant: small-caps;
  151. color: $mountain-mist;
  152. background: transparent $url-0 top left no-repeat;
  153. }
  154. }
  155. input[type=file].file-loading {
  156. @extend %set-invisible;
  157. }
  158. .file-object {
  159. margin: 0 0 (-$pad) 0;
  160. padding: 0;
  161. }
  162. .btn-file {
  163. @extend %set-relative;
  164. overflow: hidden;
  165. input[type=file] {
  166. @extend %set-absolute;
  167. top: 0;
  168. left: 0;
  169. min-width: 100%;
  170. min-height: 100%;
  171. text-align: right;
  172. opacity: 0;
  173. background: none repeat scroll 0 0 transparent;
  174. cursor: inherit;
  175. display: block;
  176. }
  177. ::-ms-browse {
  178. font-size: multiply($pad, 2000);
  179. width: 100%;
  180. height: 100%;
  181. }
  182. }
  183. .file-caption {
  184. @extend %set-relative;
  185. .file-caption-name {
  186. width: 100%;
  187. margin: 0;
  188. padding: 0;
  189. box-shadow: none;
  190. border: none;
  191. background: none;
  192. outline: none;
  193. }
  194. &.icon-visible {
  195. .file-caption-icon {
  196. display: inline-block;
  197. }
  198. .file-caption-name {
  199. padding-left: multiply($pad, 3);
  200. }
  201. }
  202. }
  203. .file-caption-icon {
  204. @extend %set-hidden;
  205. @extend %set-absolute;
  206. left: multiply($pad, 1.6);
  207. padding: 0.5rem;
  208. }
  209. .input-group-lg .file-caption-icon {
  210. font-size: 1.25rem;
  211. padding: 0.9rem 0.9rem 0 0.2rem;
  212. }
  213. .input-group-sm .file-caption-icon {
  214. font-size: 0.875rem;
  215. }
  216. .file-error-message {
  217. color: $apple-blossom;
  218. background-color: $vanilla-ice;
  219. margin: $pad;
  220. border: $border solid $oyster-pink;
  221. border-radius: $radius;
  222. padding: multiply($pad, 3);
  223. pre {
  224. @extend %set-error;
  225. margin: $pad 0;
  226. }
  227. ul {
  228. @extend %set-error;
  229. }
  230. }
  231. .file-caption-disabled {
  232. background-color: $gallery;
  233. cursor: not-allowed;
  234. opacity: 1;
  235. }
  236. .file-preview {
  237. @extend %set-relative;
  238. border-radius: multiply($radius, 1.25);
  239. border: $border solid $alto;
  240. padding: multiply($pad, 1.6);
  241. width: 100%;
  242. margin-bottom: $pad;
  243. .btn-xs {
  244. padding: multiply($pad, 0.2) $pad;
  245. font-size: multiply($pad, 2.4);
  246. line-height: 1.5;
  247. border-radius: multiply($radius, 0.75);
  248. }
  249. .fileinput-remove {
  250. @extend %set-absolute;
  251. top: multiply($pad, 0.2);
  252. right: multiply($pad, 0.2);
  253. line-height: multiply($pad, 2);
  254. }
  255. .clickable {
  256. cursor: pointer;
  257. }
  258. .kv-zoom-cache {
  259. display: none;
  260. }
  261. }
  262. .file-preview-image {
  263. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  264. color: $green;
  265. width: auto;
  266. height: auto;
  267. max-width: 100%;
  268. max-height: 100%;
  269. }
  270. .krajee-default {
  271. &.file-preview-frame {
  272. @extend %set-relative;
  273. margin: multiply($pad, 1.6);
  274. border: $border solid $black-20;
  275. box-shadow: 0 0 multiply($pad, 2) 0 $black-20;
  276. padding: multiply($pad, 1.2);
  277. float: left;
  278. text-align: center;
  279. .kv-file-content {
  280. width: multiply($pad, 42.6);
  281. height: multiply($pad, 32);
  282. &.kv-pdf-rendered {
  283. width: 400px;
  284. }
  285. }
  286. .file-thumbnail-footer {
  287. height: multiply($pad, 14);
  288. }
  289. &:not(.file-preview-error):hover {
  290. border: $border solid $black-30;
  291. box-shadow: 0 0 multiply($pad, 2) 0 $black-40;
  292. }
  293. &[data-template="audio"] .kv-file-content {
  294. width: 240px;
  295. height: 55px;
  296. }
  297. }
  298. .file-preview-other-frame {
  299. display: flex;
  300. align-items: center;
  301. justify-content: center;
  302. }
  303. .file-preview-text {
  304. display: block;
  305. color: $boston-blue;
  306. border: $border solid $alto;
  307. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  308. outline: none;
  309. padding: multiply($pad, 1.6);
  310. resize: none;
  311. }
  312. .file-preview-html {
  313. border: $border solid $alto;
  314. padding: multiply($pad, 1.6);
  315. overflow: auto;
  316. }
  317. .file-actions {
  318. @extend %set-text-left;
  319. }
  320. .file-other-error {
  321. @extend %set-text-left;
  322. }
  323. .file-other-icon {
  324. font-size: 6em;
  325. line-height: 1;
  326. }
  327. .file-footer-buttons {
  328. float: right;
  329. }
  330. .file-footer-caption {
  331. display: block;
  332. text-align: center;
  333. padding-top: multiply($pad, 0.8);
  334. font-size: multiply($pad, 2.2);
  335. color: $tapa;
  336. margin-bottom: multiply($pad, 3);
  337. }
  338. .file-preview-error {
  339. opacity: 0.65;
  340. box-shadow: none;
  341. }
  342. .file-drag-handle {
  343. @extend %set-indicator;
  344. }
  345. .file-upload-indicator {
  346. @extend %set-indicator;
  347. }
  348. .file-thumb-progress {
  349. @extend %set-absolute;
  350. height: multiply($pad, 2.2);
  351. top: multiply($pad, 7.4);
  352. left: 0;
  353. right: 0;
  354. .progress {
  355. @extend %set-progress;
  356. color: $celeste;
  357. }
  358. .progress-bar {
  359. @extend %set-progress;
  360. font-family: Verdana, Helvetica, sans-serif;
  361. }
  362. }
  363. .file-thumbnail-footer {
  364. @extend %set-relative;
  365. }
  366. .file-caption-info {
  367. @extend %set-caption;
  368. }
  369. .file-size-info {
  370. @extend %set-caption;
  371. }
  372. &.kvsortable-ghost {
  373. background: $mystic;
  374. border: multiply($border, 2) solid $perano;
  375. }
  376. .file-preview-other:hover {
  377. opacity: 0.8;
  378. }
  379. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  380. color: $black;
  381. }
  382. }
  383. .file-upload-stats {
  384. font-size: 9px;
  385. text-align: center;
  386. width: 100%;
  387. }
  388. .kv-upload-progress {
  389. .progress {
  390. height: multiply($pad, 4);
  391. line-height: multiply($pad, 4);
  392. margin: multiply($pad, 2) 0;
  393. overflow: hidden;
  394. color: $celeste;
  395. }
  396. .progress-bar {
  397. height: multiply($pad, 4);
  398. font-family: Verdana, Helvetica, sans-serif;
  399. }
  400. .file-upload-stats {
  401. font-size: 11px;
  402. margin: -10px 0 5px;
  403. }
  404. }
  405. .file-thumb-progress {
  406. .progress {
  407. background-color: #ccc;
  408. }
  409. .progress-bar {
  410. font-size: 0.7rem;
  411. font-family: Verdana, Helvetica, sans-serif;
  412. }
  413. }
  414. .file-zoom-dialog {
  415. .file-other-icon {
  416. //noinspection CssOverwrittenProperties
  417. font-size: 22em;
  418. //noinspection CssOverwrittenProperties
  419. font-size: 50vmin;
  420. }
  421. .modal-dialog {
  422. @extend %set-relative;
  423. width: auto;
  424. }
  425. .modal-header {
  426. display: flex;
  427. align-items: center;
  428. justify-content: space-between;
  429. &:before {
  430. @extend %set-hidden;
  431. }
  432. &:after {
  433. @extend %set-hidden;
  434. }
  435. }
  436. .btn-navigate {
  437. @extend %set-absolute;
  438. padding: 0;
  439. margin: -1.2rem 0.1rem 0;
  440. font-size: 1.2rem;
  441. width: 2.4rem;
  442. height: 2.4rem;
  443. top: 50%;
  444. border-radius: 50%;
  445. opacity: 0.8;
  446. background-color: $gray-1;
  447. border-color: $gray-1;
  448. color: $black;
  449. &:hover, &:focus {
  450. color: $white;
  451. background-color: $gray-2;
  452. border-color: $gray-2;
  453. }
  454. &:focus {
  455. box-shadow: 0 0 0 0.25rem rgb(130 138 145 / 50%);
  456. }
  457. &[disabled] {
  458. background-color: $mountain-mist;
  459. border-color: $mountain-mist;
  460. opacity: 0.4;
  461. }
  462. }
  463. .floating-buttons {
  464. @extend %set-absolute;
  465. top: $pad;
  466. right: multiply($pad, 2);
  467. }
  468. .btn-kv-prev {
  469. left: multiply($pad, 0.2);
  470. }
  471. .btn-kv-next {
  472. right: multiply($pad, 0.2);
  473. }
  474. .kv-zoom-title {
  475. font-weight: 300;
  476. color: $mountain-mist;
  477. max-width: 50%;
  478. overflow: hidden;
  479. white-space: nowrap;
  480. text-overflow: ellipsis;
  481. }
  482. }
  483. .file-input-new {
  484. .file-preview {
  485. @extend %set-hidden;
  486. }
  487. .close {
  488. @extend %set-hidden;
  489. }
  490. .glyphicon-file {
  491. @extend %set-hidden;
  492. }
  493. .fileinput-remove-button {
  494. @extend %set-hidden;
  495. }
  496. .fileinput-upload-button {
  497. @extend %set-hidden;
  498. }
  499. .no-browse {
  500. .input-group-btn {
  501. @extend %set-hidden;
  502. }
  503. .form-control {
  504. border-top-right-radius: $radius;
  505. border-bottom-right-radius: $radius;
  506. }
  507. }
  508. }
  509. .file-input-ajax-new {
  510. .fileinput-remove-button {
  511. @extend %set-hidden;
  512. }
  513. .fileinput-upload-button {
  514. @extend %set-hidden;
  515. }
  516. .no-browse {
  517. .input-group-btn {
  518. @extend %set-hidden;
  519. }
  520. .form-control {
  521. border-top-right-radius: $radius;
  522. border-bottom-right-radius: $radius;
  523. }
  524. }
  525. }
  526. .file-caption-main {
  527. width: 100%;
  528. }
  529. .file-thumb-loading {
  530. background: transparent $url-0 no-repeat scroll center center content-box !important;
  531. }
  532. .file-drop-zone {
  533. border: $border dashed $silver-chalice;
  534. border-radius: $radius;
  535. min-height: multiply($pad, 52);
  536. text-align: center;
  537. vertical-align: middle;
  538. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  539. padding: $pad;
  540. &.clickable {
  541. &:hover {
  542. border: multiply($border, 2) dashed $mountain-mist;
  543. }
  544. &:focus {
  545. border: multiply($border, 2) solid $viking;
  546. }
  547. }
  548. .file-preview-thumbnails {
  549. cursor: default;
  550. }
  551. }
  552. .file-drop-zone-title {
  553. color: $silver-chalice;
  554. font-size: 1.6em;
  555. padding: multiply($pad, 17) multiply($pad, 2);
  556. cursor: default;
  557. }
  558. .file-highlighted {
  559. border: multiply($border, 2) dashed $mountain-mist !important;
  560. background-color: $gallery;
  561. }
  562. .file-uploading {
  563. background: $url-1 no-repeat center bottom multiply($pad, 2);
  564. opacity: 0.65;
  565. }
  566. .file-zoom-fullscreen {
  567. .modal-dialog {
  568. min-width: 100%;
  569. margin: 0;
  570. }
  571. .modal-content {
  572. border-radius: 0;
  573. box-shadow: none;
  574. min-height: 100vh;
  575. }
  576. .modal-body {
  577. overflow-y: auto;
  578. }
  579. }
  580. .floating-buttons {
  581. z-index: 3000;
  582. .btn-kv {
  583. margin-left: multiply($pad, 0.6);
  584. z-index: 3000;
  585. }
  586. }
  587. .kv-zoom-actions .btn-kv {
  588. margin-left: multiply($pad, 0.6);
  589. }
  590. .file-zoom-content {
  591. min-height: 300px;
  592. text-align: center;
  593. white-space: nowrap;
  594. > * {
  595. display: inline-block;
  596. vertical-align: middle;
  597. }
  598. .kv-spacer {
  599. height: 100%;
  600. }
  601. .file-preview-image {
  602. max-height: 100%;
  603. }
  604. .file-preview-video {
  605. max-height: 100%;
  606. }
  607. > .file-object {
  608. &.type-image {
  609. @extend %set-object;
  610. height: auto;
  611. min-height: inherit;
  612. }
  613. &.type-video {
  614. @extend %set-object-video;
  615. }
  616. &.type-flash {
  617. @extend %set-object-video;
  618. }
  619. &.type-audio {
  620. width: auto;
  621. height: multiply($pad, 6);
  622. }
  623. &.type-pdf {
  624. @extend %set-object-default;
  625. }
  626. &.type-html {
  627. @extend %set-object-default;
  628. }
  629. &.type-text {
  630. @extend %set-object-default;
  631. }
  632. &.type-default {
  633. @extend %set-object-default;
  634. }
  635. }
  636. &:hover {
  637. background: transparent;
  638. }
  639. }
  640. @media(min-width: 576px) {
  641. .file-zoom-dialog .modal-dialog {
  642. max-width: 500px;
  643. }
  644. }
  645. @media(min-width: 992px) {
  646. .file-zoom-dialog .modal-lg {
  647. max-width: 800px;
  648. }
  649. }
  650. @media(max-width: 767px) {
  651. .file-preview-thumbnails {
  652. display: flex;
  653. justify-content: center;
  654. align-items: center;
  655. flex-direction: column;
  656. }
  657. .file-zoom-dialog .modal-header {
  658. flex-direction: column;
  659. }
  660. }
  661. @media(max-width: 350px) {
  662. .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
  663. width: 160px;
  664. }
  665. }
  666. @media(max-width: 420px) {
  667. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  668. width: 100%;
  669. }
  670. }
  671. .file-loading[dir=rtl]:before {
  672. background: transparent $url-0 top right no-repeat;
  673. padding-left: 0;
  674. padding-right: multiply($pad, 4);
  675. }
  676. .clickable .file-drop-zone-title {
  677. cursor: pointer;
  678. }
  679. .file-sortable .file-drag-handle {
  680. cursor: grab;
  681. opacity: 1;
  682. &:hover {
  683. opacity: 0.7;
  684. }
  685. }
  686. .file-grabbing, .file-grabbing * {
  687. cursor: not-allowed !important;
  688. }
  689. .file-grabbing .file-preview-thumbnails * {
  690. cursor: grabbing !important;
  691. }
  692. .file-preview-initial.sortable-chosen {
  693. background-color: $link-water;
  694. border-color: $pelorous;
  695. box-shadow: none;
  696. }