fileinput.scss 14 KB

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