fileinput.scss 14 KB

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