scaffolding.less 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. //
  2. // Scaffolding
  3. // --------------------------------------------------
  4. // Reset the box-sizing
  5. //
  6. // Heads up! This reset may cause conflicts with some third-party widgets.
  7. // For recommendations on resolving such conflicts, see
  8. // http://getbootstrap.com/getting-started/#third-box-sizing
  9. * {
  10. .box-sizing(border-box);
  11. }
  12. *:before,
  13. *:after {
  14. .box-sizing(border-box);
  15. }
  16. // Body reset
  17. html {
  18. //font-size: 62.5%;
  19. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  20. height: 100%;
  21. }
  22. // Prevent potential for layout shifts on a page with fixed 100% height. This
  23. // can happen, for example, with the Grammarly extension in Firefox.
  24. html.fixed-size-document {
  25. position: fixed;
  26. width: 100%;
  27. }
  28. body {
  29. font-family: @font-family-base;
  30. font-size: @font-size-base;
  31. line-height: @line-height-base;
  32. color: @text-color;
  33. background-color: @body-bg;
  34. min-height: 100%;
  35. position: relative;
  36. & > .content {
  37. min-height: 100vh;
  38. padding-top: @header-height + @content-margin-vertical;
  39. }
  40. &.thin-footer {
  41. .container {
  42. padding-bottom: @footer-height;
  43. }
  44. }
  45. }
  46. // Reset fonts for relevant elements
  47. input,
  48. button,
  49. select,
  50. textarea {
  51. font-family: inherit;
  52. font-size: inherit;
  53. line-height: inherit;
  54. }
  55. // Keep textarea within horizontal container when resizing
  56. textarea {
  57. resize: vertical;
  58. }
  59. // Links
  60. a {
  61. color: @link-color;
  62. text-decoration: none;
  63. &:hover,
  64. &:focus {
  65. color: @link-hover-color;
  66. text-decoration: underline;
  67. }
  68. &:focus {
  69. .tab-focus();
  70. }
  71. }
  72. // Figures
  73. //
  74. // We reset this here because previously Normalize had no `figure` margins. This
  75. // ensures we don't break anyone's use of the element.
  76. figure {
  77. margin: 0;
  78. }
  79. // Images
  80. img {
  81. vertical-align: middle;
  82. }
  83. // Responsive images (ensure images don't scale beyond their parents)
  84. .img-responsive {
  85. .img-responsive();
  86. }
  87. // Rounded corners
  88. .img-rounded {
  89. border-radius: @border-radius-large;
  90. }
  91. // Image thumbnails
  92. //
  93. // Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.
  94. .img-thumbnail {
  95. padding: @thumbnail-padding;
  96. line-height: @line-height-base;
  97. background-color: @thumbnail-bg;
  98. border: 1px solid @thumbnail-border;
  99. border-radius: @thumbnail-border-radius;
  100. .transition(all 0.2s ease-in-out);
  101. // Keep them at most 100% wide
  102. .img-responsive(inline-block);
  103. }
  104. // Perfect circle
  105. .img-circle {
  106. border-radius: 50%; // set radius in percents
  107. }
  108. // Horizontal rules
  109. hr {
  110. margin-top: @line-height-computed;
  111. margin-bottom: @line-height-computed;
  112. border: 0;
  113. border-top: 1px solid @hr-border;
  114. &.thin {
  115. margin-top: @line-height-computed / 2;
  116. margin-bottom: @line-height-computed / 2;
  117. }
  118. }
  119. // Only display content to screen readers
  120. //
  121. // See: http://a11yproject.com/posts/how-to-hide-content/
  122. @sr-only: {
  123. position: absolute;
  124. width: 1px;
  125. height: 1px;
  126. margin: -1px;
  127. padding: 0;
  128. overflow: hidden;
  129. clip: rect(0, 0, 0, 0);
  130. border: 0;
  131. };
  132. .sr-only,
  133. .visually-hidden {
  134. @sr-only();
  135. }
  136. @media (max-width: @screen-xs-max) {
  137. .sr-only-xs {
  138. @sr-only();
  139. }
  140. }
  141. .content {
  142. padding-top: @content-margin-vertical;
  143. padding-bottom: @content-margin-vertical;
  144. }
  145. .content-alt {
  146. background-color: @content-alt-bg-color;
  147. }
  148. .row-spaced {
  149. margin-top: @line-height-computed;
  150. }
  151. .row-spaced-small {
  152. margin-top: @line-height-computed / 2;
  153. }
  154. .row-spaced-large {
  155. margin-top: @line-height-computed * 2;
  156. }
  157. .row-spaced-extra-large {
  158. margin-top: @line-height-computed * 4;
  159. }