fileinput.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /*!
  2. * bootstrap-fileinput v4.5.1
  3. * http://plugins.krajee.com/file-input
  4. *
  5. * Krajee default styling for bootstrap-fileinput.
  6. *
  7. * Author: Kartik Visweswaran
  8. * Copyright: 2014 - 2018, 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. }
  267. .file-preview-text {
  268. display: block;
  269. color: $boston-blue;
  270. border: $border solid $alto;
  271. font-family: $font-3, $font-4, $font-5, $font-6, $font-7;
  272. outline: none;
  273. padding: multiply($pad, 1.6);
  274. resize: none;
  275. }
  276. .file-preview-html {
  277. border: $border solid $alto;
  278. padding: multiply($pad, 1.6);
  279. overflow: auto;
  280. }
  281. .file-actions {
  282. @extend %set-text-left;
  283. }
  284. .file-other-error {
  285. @extend %set-text-left;
  286. }
  287. .file-other-icon {
  288. font-size: 6em;
  289. }
  290. .file-footer-buttons {
  291. float: right;
  292. }
  293. .file-footer-caption {
  294. display: block;
  295. text-align: center;
  296. padding-top: multiply($pad, 0.8);
  297. font-size: multiply($pad, 2.2);
  298. color: $tapa;
  299. margin-bottom: multiply($pad, 3);
  300. }
  301. .file-preview-error {
  302. opacity: 0.65;
  303. box-shadow: none;
  304. }
  305. .file-drag-handle {
  306. @extend %set-indicator;
  307. }
  308. .file-upload-indicator {
  309. @extend %set-indicator;
  310. }
  311. .file-thumb-progress {
  312. @extend %set-absolute;
  313. height: multiply($pad, 2.2);
  314. top: multiply($pad, 7.4);
  315. left: 0;
  316. right: 0;
  317. .progress {
  318. @extend %set-progress;
  319. }
  320. .progress-bar {
  321. @extend %set-progress;
  322. font-family: Verdana, Helvetica, sans-serif;
  323. }
  324. }
  325. .file-thumbnail-footer {
  326. @extend %set-relative;
  327. }
  328. .file-caption-info {
  329. @extend %set-caption;
  330. }
  331. .file-size-info {
  332. @extend %set-caption;
  333. }
  334. &.kvsortable-ghost {
  335. background: $mystic;
  336. border: multiply($border, 2) solid $perano;
  337. }
  338. .file-preview-other:hover {
  339. opacity: 0.8;
  340. }
  341. .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover {
  342. color: $black;
  343. }
  344. }
  345. .kv-upload-progress {
  346. .progress {
  347. height: multiply($pad, 4);
  348. line-height: multiply($pad, 4);
  349. margin: multiply($pad, 2) 0;
  350. overflow: hidden;
  351. }
  352. .progress-bar {
  353. height: multiply($pad, 4);
  354. font-family: Verdana, Helvetica, sans-serif;
  355. }
  356. }
  357. .file-zoom-dialog {
  358. .file-other-icon {
  359. //noinspection CssOverwrittenProperties
  360. font-size: 22em;
  361. //noinspection CssOverwrittenProperties
  362. font-size: 50vmin;
  363. }
  364. .modal-dialog {
  365. @extend %set-relative;
  366. width: auto;
  367. }
  368. .modal-header {
  369. display: flex;
  370. align-items: center;
  371. justify-content: space-between;
  372. &:before {
  373. @extend %set-hidden;
  374. }
  375. &:after {
  376. @extend %set-hidden;
  377. }
  378. }
  379. .btn-navigate {
  380. @extend %set-absolute;
  381. padding: 0;
  382. margin: 0;
  383. background: transparent;
  384. text-decoration: none;
  385. outline: none;
  386. opacity: 0.7;
  387. top: 45%;
  388. font-size: 4em;
  389. color: $curious-blue;
  390. &:not([disabled]):hover {
  391. outline: none;
  392. box-shadow: none;
  393. opacity: 0.6;
  394. }
  395. }
  396. .floating-buttons {
  397. @extend %set-absolute;
  398. top: $pad;
  399. right: multiply($pad, 2);
  400. }
  401. .btn-navigate[disabled] {
  402. opacity: 0.3;
  403. }
  404. .btn-prev {
  405. left: multiply($pad, 0.2);
  406. }
  407. .btn-next {
  408. right: multiply($pad, 0.2);
  409. }
  410. .kv-zoom-title {
  411. font-weight: 300;
  412. color: $mountain-mist;
  413. max-width: 50%;
  414. overflow: hidden;
  415. white-space: nowrap;
  416. text-overflow: ellipsis;
  417. }
  418. }
  419. .file-input-new {
  420. .file-preview {
  421. @extend %set-hidden;
  422. }
  423. .close {
  424. @extend %set-hidden;
  425. }
  426. .glyphicon-file {
  427. @extend %set-hidden;
  428. }
  429. .fileinput-remove-button {
  430. @extend %set-hidden;
  431. }
  432. .fileinput-upload-button {
  433. @extend %set-hidden;
  434. }
  435. .no-browse {
  436. .input-group-btn {
  437. @extend %set-hidden;
  438. }
  439. .form-control {
  440. border-top-right-radius: $radius;
  441. border-bottom-right-radius: $radius;
  442. }
  443. }
  444. }
  445. .file-input-ajax-new {
  446. .fileinput-remove-button {
  447. @extend %set-hidden;
  448. }
  449. .fileinput-upload-button {
  450. @extend %set-hidden;
  451. }
  452. .no-browse {
  453. .input-group-btn {
  454. @extend %set-hidden;
  455. }
  456. .form-control {
  457. border-top-right-radius: $radius;
  458. border-bottom-right-radius: $radius;
  459. }
  460. }
  461. }
  462. .file-caption-main {
  463. width: 100%;
  464. }
  465. .file-thumb-loading {
  466. background: transparent $url-0 no-repeat scroll center center content-box !important;
  467. }
  468. .file-drop-zone {
  469. border: $border dashed $silver-chalice;
  470. border-radius: $radius;
  471. height: 100%;
  472. text-align: center;
  473. vertical-align: middle;
  474. margin: multiply($pad, 2.4) multiply($pad, 3) multiply($pad, 2.4) multiply($pad, 2.4);
  475. padding: $pad;
  476. &.clickable {
  477. &:hover {
  478. border: multiply($border, 2) dashed $mountain-mist;
  479. }
  480. &:focus {
  481. border: multiply($border, 2) solid $viking;
  482. }
  483. }
  484. .file-preview-thumbnails {
  485. cursor: default;
  486. }
  487. }
  488. .file-drop-zone-title {
  489. color: $silver-chalice;
  490. font-size: 1.6em;
  491. padding: multiply($pad, 17) multiply($pad, 2);
  492. cursor: default;
  493. }
  494. .file-highlighted {
  495. border: multiply($border, 2) dashed $mountain-mist !important;
  496. background-color: $gallery;
  497. }
  498. .file-uploading {
  499. background: $url-1 no-repeat center bottom multiply($pad, 2);
  500. opacity: 0.65;
  501. }
  502. .file-zoom-fullscreen {
  503. .modal-dialog {
  504. min-width: 100%;
  505. margin: 0;
  506. }
  507. .modal-content {
  508. border-radius: 0;
  509. box-shadow: none;
  510. min-height: 100vh;
  511. }
  512. .modal-body {
  513. overflow-y: auto;
  514. }
  515. }
  516. .floating-buttons {
  517. z-index: 3000;
  518. .btn-kv {
  519. margin-left: multiply($pad, 0.6);
  520. z-index: 3000;
  521. }
  522. }
  523. .file-zoom-content {
  524. height: multiply($pad, 96);
  525. text-align: center;
  526. .file-preview-image {
  527. max-height: 100%;
  528. }
  529. .file-preview-video {
  530. max-height: 100%;
  531. }
  532. > .file-object {
  533. &.type-image {
  534. @extend %set-object;
  535. height: auto;
  536. min-height: inherit;
  537. }
  538. &.type-video {
  539. @extend %set-object-video;
  540. }
  541. &.type-flash {
  542. @extend %set-object-video;
  543. }
  544. &.type-audio {
  545. width: auto;
  546. height: multiply($pad, 6);
  547. }
  548. &.type-pdf {
  549. @extend %set-object-default;
  550. }
  551. &.type-html {
  552. @extend %set-object-default;
  553. }
  554. &.type-text {
  555. @extend %set-object-default;
  556. }
  557. &.type-default {
  558. @extend %set-object-default;
  559. }
  560. }
  561. }
  562. @media(min-width: 576px) {
  563. .file-zoom-dialog .modal-dialog {
  564. max-width: 500px;
  565. }
  566. }
  567. @media(min-width: 992px) {
  568. .file-zoom-dialog .modal-lg {
  569. max-width: 800px;
  570. }
  571. }
  572. @media(max-width: 767px) {
  573. .file-preview-thumbnails {
  574. display: flex;
  575. justify-content: center;
  576. align-items: center;
  577. flex-direction: column;
  578. }
  579. .file-zoom-dialog .modal-header {
  580. flex-direction: column;
  581. }
  582. }
  583. @media(max-width: 350px) {
  584. .krajee-default.file-preview-frame .kv-file-content {
  585. width: multiply($pad, 32);
  586. }
  587. }
  588. @media(max-width: 420px) {
  589. .krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered {
  590. width: 100%;
  591. }
  592. }
  593. .file-loading[dir=rtl]:before {
  594. background: transparent $url-0 top right no-repeat;
  595. padding-left: 0;
  596. padding-right: multiply($pad, 4);
  597. }
  598. .file-sortable .file-drag-handle {
  599. cursor: move;
  600. opacity: 1;
  601. &:hover {
  602. opacity: 0.7;
  603. }
  604. }
  605. .clickable .file-drop-zone-title {
  606. cursor: pointer;
  607. }
  608. .kv-zoom-actions .btn-kv {
  609. margin-left: multiply($pad, 0.6);
  610. }
  611. .file-preview-initial.sortable-chosen {
  612. background-color: $link-water;
  613. }