fileinput.scss 14 KB

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