fileinput.scss 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  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: 1.875rem;
  200. }
  201. > .input-group-lg .file-caption-name {
  202. padding-left: 2.1rem;
  203. }
  204. > .input-group-sm .file-caption-name {
  205. padding-left: 1.5rem;
  206. }
  207. }
  208. }
  209. .file-caption-icon {
  210. @extend %set-hidden;
  211. @extend %set-absolute;
  212. left: multiply($pad, 1.6);
  213. padding: 0.5rem;
  214. }
  215. .input-group-lg .file-caption-icon {
  216. font-size: 1.25rem;
  217. }
  218. .input-group-sm .file-caption-icon {
  219. font-size: 0.875rem;
  220. padding: 0.25rem;
  221. }
  222. .file-error-message {
  223. color: $apple-blossom;
  224. background-color: $vanilla-ice;
  225. margin: $pad;
  226. border: $border solid $oyster-pink;
  227. border-radius: $radius;
  228. padding: multiply($pad, 3);
  229. pre {
  230. @extend %set-error;
  231. margin: $pad 0;
  232. }
  233. ul {
  234. @extend %set-error;
  235. }
  236. }
  237. .file-caption-disabled {
  238. background-color: $gallery;
  239. cursor: not-allowed;
  240. opacity: 1;
  241. }
  242. .file-preview {
  243. @extend %set-relative;
  244. border-radius: multiply($radius, 1.25);
  245. border: $border solid $alto;
  246. padding: multiply($pad, 1.6);
  247. width: 100%;
  248. margin-bottom: $pad;
  249. .btn-xs {
  250. padding: multiply($pad, 0.2) $pad;
  251. font-size: multiply($pad, 2.4);
  252. line-height: 1.5;
  253. border-radius: multiply($radius, 0.75);
  254. }
  255. .fileinput-remove {
  256. @extend %set-absolute;
  257. top: multiply($pad, 0.2);
  258. right: multiply($pad, 0.2);
  259. line-height: multiply($pad, 2);
  260. }
  261. .clickable {
  262. cursor: pointer;
  263. }
  264. .kv-zoom-cache {
  265. display: none;
  266. }
  267. }
  268. .file-preview-image {
  269. font: multiply($pad, 8) $font-0, $font-1, $font-2;
  270. color: $green;
  271. width: auto;
  272. height: auto;
  273. max-width: 100%;
  274. max-height: 100%;
  275. }
  276. .krajee-default {
  277. &.file-preview-frame {
  278. @extend %set-relative;
  279. margin: multiply($pad, 1.6);
  280. border: $border solid $black-20;
  281. box-shadow: 0 0 multiply($pad, 2) 0 $black-20;
  282. padding: multiply($pad, 1.2);
  283. float: left;
  284. text-align: center;
  285. .kv-file-content {
  286. width: multiply($pad, 42.6);
  287. height: multiply($pad, 32);
  288. &.kv-pdf-rendered {
  289. width: 400px;
  290. }
  291. }
  292. .file-thumbnail-footer {
  293. height: multiply($pad, 14);
  294. }
  295. &:not(.file-preview-error):hover {
  296. border: $border solid $black-30;
  297. box-shadow: 0 0 multiply($pad, 2) 0 $black-40;
  298. }
  299. &[data-template="audio"] .kv-file-content {
  300. width: 240px;
  301. height: 55px;
  302. }
  303. }
  304. .file-preview-other-frame {
  305. display: flex;
  306. align-items: center;
  307. justify-content: center;
  308. }
  309. .file-preview-text {
  310. display: block;
  311. color: $boston-blue;
  312. border: $border solid $alto;
  313. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  314. outline: none;
  315. padding: multiply($pad, 1.6);
  316. resize: none;
  317. }
  318. .file-preview-html {
  319. border: $border solid $alto;
  320. padding: multiply($pad, 1.6);
  321. overflow: auto;
  322. }
  323. .file-actions {
  324. @extend %set-text-left;
  325. }
  326. .file-other-error {
  327. @extend %set-text-left;
  328. }
  329. .file-other-icon {
  330. font-size: 6em;
  331. line-height: 1;
  332. }
  333. .file-footer-buttons {
  334. float: right;
  335. }
  336. .file-footer-caption {
  337. display: block;
  338. text-align: center;
  339. padding-top: multiply($pad, 0.8);
  340. font-size: multiply($pad, 2.2);
  341. color: $tapa;
  342. margin-bottom: multiply($pad, 3);
  343. }
  344. .file-preview-error {
  345. opacity: 0.65;
  346. box-shadow: none;
  347. }
  348. .file-drag-handle {
  349. @extend %set-indicator;
  350. }
  351. .file-upload-indicator {
  352. @extend %set-indicator;
  353. }
  354. .file-thumb-progress {
  355. @extend %set-absolute;
  356. height: multiply($pad, 2.2);
  357. top: multiply($pad, 7.4);
  358. left: 0;
  359. right: 0;
  360. .progress {
  361. @extend %set-progress;
  362. color: $celeste;
  363. }
  364. .progress-bar {
  365. @extend %set-progress;
  366. font-family: Verdana, Helvetica, sans-serif;
  367. }
  368. }
  369. .file-thumbnail-footer {
  370. @extend %set-relative;
  371. }
  372. .file-caption-info {
  373. @extend %set-caption;
  374. }
  375. .file-size-info {
  376. @extend %set-caption;
  377. }
  378. &.kvsortable-ghost {
  379. background: $mystic;
  380. border: multiply($border, 2) solid $perano;
  381. }
  382. .file-preview-other:hover {
  383. opacity: 0.8;
  384. }
  385. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  386. color: $black;
  387. }
  388. }
  389. .file-upload-stats {
  390. font-size: 9px;
  391. text-align: center;
  392. width: 100%;
  393. }
  394. .kv-upload-progress {
  395. .progress {
  396. height: multiply($pad, 4);
  397. line-height: multiply($pad, 4);
  398. margin: multiply($pad, 2) 0;
  399. overflow: hidden;
  400. color: $celeste;
  401. }
  402. .progress-bar {
  403. height: multiply($pad, 4);
  404. font-family: Verdana, Helvetica, sans-serif;
  405. }
  406. .file-upload-stats {
  407. font-size: 11px;
  408. margin: -10px 0 5px;
  409. }
  410. }
  411. .file-thumb-progress {
  412. .progress {
  413. background-color: #ccc;
  414. }
  415. .progress-bar {
  416. font-size: 0.7rem;
  417. font-family: Verdana, Helvetica, sans-serif;
  418. }
  419. }
  420. .file-zoom-dialog {
  421. .file-other-icon {
  422. //noinspection CssOverwrittenProperties
  423. font-size: 22em;
  424. //noinspection CssOverwrittenProperties
  425. font-size: 50vmin;
  426. }
  427. .modal-dialog {
  428. @extend %set-relative;
  429. width: auto;
  430. }
  431. .modal-header {
  432. display: flex;
  433. align-items: center;
  434. justify-content: space-between;
  435. &:before {
  436. @extend %set-hidden;
  437. }
  438. &:after {
  439. @extend %set-hidden;
  440. }
  441. }
  442. .btn-navigate {
  443. @extend %set-absolute;
  444. padding: 0;
  445. margin: -1.2rem 0.1rem 0;
  446. font-size: 1.2rem;
  447. width: 2.4rem;
  448. height: 2.4rem;
  449. top: 50%;
  450. border-radius: 50%;
  451. opacity: 0.8;
  452. background-color: $gray-1;
  453. border-color: $gray-1;
  454. color: $black;
  455. &:hover, &:focus {
  456. color: $white;
  457. background-color: $gray-2;
  458. border-color: $gray-2;
  459. }
  460. &:focus {
  461. box-shadow: 0 0 0 0.25rem rgb(130 138 145 / 50%);
  462. }
  463. &[disabled] {
  464. background-color: $mountain-mist;
  465. border-color: $mountain-mist;
  466. opacity: 0.4;
  467. }
  468. }
  469. .floating-buttons {
  470. @extend %set-absolute;
  471. top: $pad;
  472. right: multiply($pad, 2);
  473. }
  474. .btn-kv-prev {
  475. left: multiply($pad, 0.2);
  476. }
  477. .btn-kv-next {
  478. right: multiply($pad, 0.2);
  479. }
  480. .kv-zoom-title {
  481. font-weight: 300;
  482. color: $mountain-mist;
  483. max-width: 50%;
  484. overflow: hidden;
  485. white-space: nowrap;
  486. text-overflow: ellipsis;
  487. }
  488. }
  489. .file-input-new {
  490. .file-preview {
  491. @extend %set-hidden;
  492. }
  493. .close {
  494. @extend %set-hidden;
  495. }
  496. .glyphicon-file {
  497. @extend %set-hidden;
  498. }
  499. .fileinput-remove-button {
  500. @extend %set-hidden;
  501. }
  502. .fileinput-upload-button {
  503. @extend %set-hidden;
  504. }
  505. .no-browse {
  506. .input-group-btn {
  507. @extend %set-hidden;
  508. }
  509. .form-control {
  510. border-top-right-radius: $radius;
  511. border-bottom-right-radius: $radius;
  512. }
  513. }
  514. }
  515. .file-input-ajax-new {
  516. .fileinput-remove-button {
  517. @extend %set-hidden;
  518. }
  519. .fileinput-upload-button {
  520. @extend %set-hidden;
  521. }
  522. .no-browse {
  523. .input-group-btn {
  524. @extend %set-hidden;
  525. }
  526. .form-control {
  527. border-top-right-radius: $radius;
  528. border-bottom-right-radius: $radius;
  529. }
  530. }
  531. }
  532. .file-caption-main {
  533. width: 100%;
  534. }
  535. .file-thumb-loading {
  536. background: transparent $url-0 no-repeat scroll center center content-box !important;
  537. }
  538. .file-drop-zone {
  539. border: $border dashed $silver-chalice;
  540. border-radius: $radius;
  541. min-height: multiply($pad, 52);
  542. text-align: center;
  543. vertical-align: middle;
  544. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  545. padding: $pad;
  546. &.clickable {
  547. &:hover {
  548. border: multiply($border, 2) dashed $mountain-mist;
  549. }
  550. &:focus {
  551. border: multiply($border, 2) solid $viking;
  552. }
  553. }
  554. .file-preview-thumbnails {
  555. cursor: default;
  556. }
  557. }
  558. .file-drop-zone-title {
  559. color: $silver-chalice;
  560. font-size: 1.6em;
  561. padding: multiply($pad, 17) multiply($pad, 2);
  562. cursor: default;
  563. }
  564. .file-highlighted {
  565. border: multiply($border, 2) dashed $mountain-mist !important;
  566. background-color: $gallery;
  567. }
  568. .file-uploading {
  569. background: $url-1 no-repeat center bottom multiply($pad, 2);
  570. opacity: 0.65;
  571. }
  572. .file-zoom-fullscreen {
  573. .modal-dialog {
  574. min-width: 100%;
  575. margin: 0;
  576. }
  577. .modal-content {
  578. border-radius: 0;
  579. box-shadow: none;
  580. min-height: 100vh;
  581. }
  582. .modal-body {
  583. overflow-y: auto;
  584. }
  585. }
  586. .floating-buttons {
  587. z-index: 3000;
  588. .btn-kv {
  589. margin-left: multiply($pad, 0.6);
  590. z-index: 3000;
  591. }
  592. }
  593. .kv-zoom-actions .btn-kv {
  594. margin-left: multiply($pad, 0.6);
  595. }
  596. .file-zoom-content {
  597. min-height: 300px;
  598. text-align: center;
  599. white-space: nowrap;
  600. > * {
  601. display: inline-block;
  602. vertical-align: middle;
  603. }
  604. .kv-spacer {
  605. height: 100%;
  606. }
  607. .file-preview-image {
  608. max-height: 100%;
  609. }
  610. .file-preview-video {
  611. max-height: 100%;
  612. }
  613. > .file-object {
  614. &.type-image {
  615. @extend %set-object;
  616. height: auto;
  617. min-height: inherit;
  618. }
  619. &.type-video {
  620. @extend %set-object-video;
  621. }
  622. &.type-flash {
  623. @extend %set-object-video;
  624. }
  625. &.type-audio {
  626. width: auto;
  627. height: multiply($pad, 6);
  628. }
  629. &.type-pdf {
  630. @extend %set-object-default;
  631. }
  632. &.type-html {
  633. @extend %set-object-default;
  634. }
  635. &.type-text {
  636. @extend %set-object-default;
  637. }
  638. &.type-default {
  639. @extend %set-object-default;
  640. }
  641. }
  642. &:hover {
  643. background: transparent;
  644. }
  645. }
  646. @media(min-width: 576px) {
  647. .file-zoom-dialog .modal-dialog {
  648. max-width: 500px;
  649. }
  650. }
  651. @media(min-width: 992px) {
  652. .file-zoom-dialog .modal-lg {
  653. max-width: 800px;
  654. }
  655. }
  656. @media(max-width: 767px) {
  657. .file-preview-thumbnails {
  658. display: flex;
  659. justify-content: center;
  660. align-items: center;
  661. flex-direction: column;
  662. }
  663. .file-zoom-dialog .modal-header {
  664. flex-direction: column;
  665. }
  666. }
  667. @media(max-width: 350px) {
  668. .krajee-default.file-preview-frame:not([data-template="audio"]) .kv-file-content {
  669. width: 160px;
  670. }
  671. }
  672. @media(max-width: 420px) {
  673. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  674. width: 100%;
  675. }
  676. }
  677. .file-loading[dir=rtl]:before {
  678. background: transparent $url-0 top right no-repeat;
  679. padding-left: 0;
  680. padding-right: multiply($pad, 4);
  681. }
  682. .clickable .file-drop-zone-title {
  683. cursor: pointer;
  684. }
  685. .file-sortable .file-drag-handle {
  686. cursor: grab;
  687. opacity: 1;
  688. &:hover {
  689. opacity: 0.7;
  690. }
  691. }
  692. .file-grabbing, .file-grabbing * {
  693. cursor: not-allowed !important;
  694. }
  695. .file-grabbing .file-preview-thumbnails * {
  696. cursor: grabbing !important;
  697. }
  698. .file-preview-initial.sortable-chosen {
  699. background-color: $link-water;
  700. border-color: $pelorous;
  701. box-shadow: none;
  702. }