fileinput.less 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // Fileinput.less
  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. position: relative;
  66. z-index: 2;
  67. }
  68. > .btn-file {
  69. z-index: 1;
  70. }
  71. }
  72. // Not 100% correct, but helps in typical use case
  73. .fileinput-new.input-group .btn-file,
  74. .fileinput-new .input-group .btn-file {
  75. border-radius: 0 @border-radius-base @border-radius-base 0;
  76. &.btn-xs,
  77. &.btn-sm {
  78. border-radius: 0 @border-radius-small @border-radius-small 0;
  79. }
  80. &.btn-lg {
  81. border-radius: 0 @border-radius-large @border-radius-large 0;
  82. }
  83. }
  84. .form-group.has-warning .fileinput {
  85. .fileinput-preview {
  86. color: @state-warning-text;
  87. }
  88. .thumbnail {
  89. border-color: @state-warning-border;
  90. }
  91. }
  92. .form-group.has-error .fileinput {
  93. .fileinput-preview {
  94. color: @state-danger-text;
  95. }
  96. .thumbnail {
  97. border-color: @state-danger-border;
  98. }
  99. }
  100. .form-group.has-success .fileinput {
  101. .fileinput-preview {
  102. color: @state-success-text;
  103. }
  104. .thumbnail {
  105. border-color: @state-success-border;
  106. }
  107. }
  108. // Input group fixes
  109. .input-group-addon:not(:first-child) {
  110. border-left: 0;
  111. }