scaffolding.less 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. padding-bottom: @footer-height;
  42. }
  43. }
  44. // Reset fonts for relevant elements
  45. input,
  46. button,
  47. select,
  48. textarea {
  49. font-family: inherit;
  50. font-size: inherit;
  51. line-height: inherit;
  52. }
  53. // Keep textarea within horizontal container when resizing
  54. textarea {
  55. resize: vertical;
  56. }
  57. // Links
  58. a {
  59. color: @link-color;
  60. text-decoration: none;
  61. &:hover,
  62. &:focus {
  63. color: @link-hover-color;
  64. text-decoration: underline;
  65. }
  66. &:focus {
  67. .tab-focus();
  68. }
  69. }
  70. // Figures
  71. //
  72. // We reset this here because previously Normalize had no `figure` margins. This
  73. // ensures we don't break anyone's use of the element.
  74. figure {
  75. margin: 0;
  76. }
  77. // Images
  78. img {
  79. vertical-align: middle;
  80. }
  81. // Responsive images (ensure images don't scale beyond their parents)
  82. .img-responsive {
  83. .img-responsive();
  84. }
  85. // Rounded corners
  86. .img-rounded {
  87. border-radius: @border-radius-large;
  88. }
  89. // Image thumbnails
  90. //
  91. // Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.
  92. .img-thumbnail {
  93. padding: @thumbnail-padding;
  94. line-height: @line-height-base;
  95. background-color: @thumbnail-bg;
  96. border: 1px solid @thumbnail-border;
  97. border-radius: @thumbnail-border-radius;
  98. .transition(all 0.2s ease-in-out);
  99. // Keep them at most 100% wide
  100. .img-responsive(inline-block);
  101. }
  102. // Perfect circle
  103. .img-circle {
  104. border-radius: 50%; // set radius in percents
  105. }
  106. // Horizontal rules
  107. hr {
  108. margin-top: @line-height-computed;
  109. margin-bottom: @line-height-computed;
  110. border: 0;
  111. border-top: 1px solid @hr-border;
  112. &.thin {
  113. margin-top: @line-height-computed / 2;
  114. margin-bottom: @line-height-computed / 2;
  115. }
  116. }
  117. // Only display content to screen readers
  118. //
  119. // See: http://a11yproject.com/posts/how-to-hide-content/
  120. @sr-only: {
  121. position: absolute;
  122. width: 1px;
  123. height: 1px;
  124. margin: -1px;
  125. padding: 0;
  126. overflow: hidden;
  127. clip: rect(0, 0, 0, 0);
  128. border: 0;
  129. };
  130. .sr-only {
  131. @sr-only();
  132. }
  133. @media (max-width: @screen-xs-max) {
  134. .sr-only-xs {
  135. @sr-only();
  136. }
  137. }
  138. .content {
  139. padding-top: @content-margin-vertical;
  140. padding-bottom: @content-margin-vertical;
  141. }
  142. .content-alt {
  143. background-color: @content-alt-bg-color;
  144. }
  145. .row-spaced {
  146. margin-top: @line-height-computed;
  147. }
  148. .row-spaced-small {
  149. margin-top: @line-height-computed / 2;
  150. }
  151. .row-spaced-large {
  152. margin-top: @line-height-computed * 2;
  153. }