_fileinput.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Fileinput
  2. // CSS for file upload button and fileinput widget
  3. // ------------------------------------------------
  4. .btn-file {
  5. overflow: hidden;
  6. position: relative;
  7. vertical-align: middle;
  8. > input {
  9. position: absolute;
  10. top: 0;
  11. right: 0;
  12. margin: 0;
  13. opacity: 0;
  14. filter: alpha(opacity=0);
  15. font-size: 23px;
  16. height: 100%;
  17. width: 100%;
  18. direction: ltr;
  19. cursor: pointer;
  20. }
  21. }
  22. .fileinput {
  23. margin-bottom: 9px;
  24. display: inline-block;
  25. .form-control {
  26. padding-top: 7px;
  27. padding-bottom: 5px;
  28. display: inline-block;
  29. margin-bottom: 0px;
  30. vertical-align: middle;
  31. cursor: text;
  32. }
  33. .thumbnail {
  34. overflow: hidden;
  35. display: inline-block;
  36. margin-bottom: 5px;
  37. vertical-align: middle;
  38. text-align: center;
  39. > img {
  40. max-height: 100%;
  41. }
  42. }
  43. .btn {
  44. vertical-align: middle;
  45. }
  46. }
  47. .fileinput-exists .fileinput-new,
  48. .fileinput-new .fileinput-exists {
  49. display: none;
  50. }
  51. .fileinput-inline .fileinput-controls {
  52. display: inline;
  53. }
  54. .fileinput-filename {
  55. vertical-align: middle;
  56. display: inline-block;
  57. overflow: hidden;
  58. }
  59. .form-control .fileinput-filename {
  60. vertical-align: bottom;
  61. }
  62. .fileinput.input-group {
  63. display: table;
  64. }
  65. // Not 100% correct, but helps in typical use case
  66. .fileinput-new.input-group .btn-file,
  67. .fileinput-new .input-group .btn-file {
  68. border-radius: 0 $border-radius-base $border-radius-base 0;
  69. &.btn-xs,
  70. &.btn-sm {
  71. border-radius: 0 $border-radius-small $border-radius-small 0;
  72. }
  73. &.btn-lg {
  74. border-radius: 0 $border-radius-large $border-radius-large 0;
  75. }
  76. }
  77. .form-group.has-warning .fileinput {
  78. .fileinput-preview {
  79. color: $state-warning-text;
  80. }
  81. .thumbnail {
  82. border-color: $state-warning-border;
  83. }
  84. }
  85. .form-group.has-error .fileinput {
  86. .fileinput-preview {
  87. color: $state-danger-text;
  88. }
  89. .thumbnail {
  90. border-color: $state-danger-border;
  91. }
  92. }
  93. .form-group.has-success .fileinput {
  94. .fileinput-preview {
  95. color: $state-success-text;
  96. }
  97. .thumbnail {
  98. border-color: $state-success-border;
  99. }
  100. }
  101. // Input group fixes
  102. .input-group-addon:not(:first-child) {
  103. border-left: 0;
  104. }