form-input-group.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @import "vars";
  2. .number .slash {
  3. margin-left: -2px;
  4. margin-right: -2px;
  5. top: -2px;
  6. position: relative;
  7. }
  8. .slash {
  9. font-size: 20px;
  10. opacity: 0.4;
  11. color: inherit;
  12. margin-top: -4px;
  13. margin-left: 5px;
  14. margin-right: 6px;
  15. }
  16. .input-couple {
  17. position: relative;
  18. display: inline-block;
  19. vertical-align: middle;
  20. }
  21. .input-couple {
  22. position: relative; // For dropdowns
  23. display: table;
  24. border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
  25. table-layout: fixed;
  26. &.divided {
  27. > div {
  28. padding-top: 15px ;
  29. display: table-cell;
  30. border-right: 2px solid rgba(0,0,0,0.025);
  31. &:last-child {border: none; }
  32. }
  33. }
  34. > div {
  35. display: table-cell;
  36. &:first-child .form-group { padding-right: 10px; .label,.input {text-align: right !important;} }
  37. &:last-child .form-group { padding-left: 10px; .label,.input {text-align: left !important;} }
  38. .unit { display: none;}
  39. }
  40. .slash {
  41. position: absolute;
  42. font-size: 20px;
  43. opacity: 0.4;
  44. right: 3px;
  45. bottom: 0px;
  46. width: 0;
  47. height: 60px;
  48. line-height: 60px;
  49. color: inherit;
  50. }
  51. .times {
  52. position: absolute;
  53. font-size: 20px;
  54. opacity: 0.4;
  55. right: 7px;
  56. bottom: 0px;
  57. width: 0;
  58. height: 60px;
  59. line-height: 60px;
  60. }
  61. }
  62. .input-group {
  63. position: relative; // For dropdowns
  64. display: table;
  65. border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
  66. > * {
  67. display: table-cell;
  68. width: 100%;
  69. }
  70. .input {
  71. // IE9 fubars the placeholder attribute in text inputs and the arrows on
  72. // select elements in input groups. To fix it, we float the input. Details:
  73. // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855
  74. float: left;
  75. width: 100%;
  76. border-top-right-radius: 0px;
  77. border-bottom-right-radius: 0px;
  78. // border-right: none;
  79. }
  80. .form-group {
  81. padding: 0px;
  82. }
  83. }
  84. // Addon and addon wrapper for buttons
  85. .input-group-addon,
  86. .input-group-btn {
  87. width: 1%;
  88. white-space: nowrap;
  89. vertical-align: middle; // Match the inputs
  90. // padding-left: 3px;
  91. .btn {
  92. border-top-left-radius: 0px;
  93. border-bottom-left-radius: 0px;
  94. }
  95. .input {
  96. border-left: none;
  97. }
  98. }
  99. // Button input groups
  100. // -------------------------
  101. .input-group-btn {
  102. position: relative;
  103. // Jankily prevent input button groups from wrapping with `white-space` and
  104. // `font-size` in combination with `inline-block` on buttons.
  105. font-size: 0;
  106. white-space: nowrap;
  107. // Negative margin for spacing, position for bringing hovered/focused/actived
  108. // element above the siblings.
  109. > .btn {
  110. position: relative;
  111. + .btn {
  112. // margin-left: -1px;
  113. }
  114. // Bring the "active" button to the front
  115. &:hover,
  116. &:focus,
  117. &:active {
  118. z-index: 2;
  119. }
  120. }
  121. // Negative margin to only have a 1px border between the two
  122. &:first-child {
  123. > .btn,
  124. > .btn-group {
  125. // margin-right: -1px;
  126. }
  127. }
  128. &:last-child {
  129. > .btn,
  130. > .btn-group {
  131. // margin-left: -1px;
  132. }
  133. }
  134. }