_base.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. // Imports
  2. @import "communityrule";
  3. /**
  4. * Reset some basic elements
  5. */
  6. body, h1, h2, h3, h4, h5, h6,
  7. p, blockquote, pre, hr,
  8. dl, dd, ol, ul, figure {
  9. margin: 0;
  10. padding: 0;
  11. }
  12. /**
  13. * Basic styling
  14. */
  15. body {
  16. font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family;
  17. color: $text-color;
  18. background-color: $background-color;
  19. -webkit-text-size-adjust: 100%;
  20. -webkit-font-feature-settings: "kern" 1;
  21. -moz-font-feature-settings: "kern" 1;
  22. -o-font-feature-settings: "kern" 1;
  23. font-feature-settings: "kern" 1;
  24. font-kerning: normal;
  25. }
  26. /**
  27. * Set `margin-bottom` to maintain vertical rhythm
  28. */
  29. h1, h2, h3, h4, h5, h6,
  30. p, blockquote, pre,
  31. ul, ol, dl, figure,
  32. %vertical-rhythm {
  33. margin-bottom: $spacing-unit / 2;
  34. }
  35. hr {
  36. border-color: $grey-color-light;
  37. border-style: solid;
  38. border-width: 1px 0 0;
  39. margin: $spacing-unit - 1px 0 $spacing-unit;
  40. }
  41. /**
  42. * Images
  43. */
  44. img {
  45. max-width: 100%;
  46. vertical-align: middle;
  47. }
  48. /**
  49. * Figures
  50. */
  51. figure > img {
  52. display: block;
  53. }
  54. figcaption {
  55. font-size: $small-font-size;
  56. }
  57. /**
  58. * Lists
  59. */
  60. ul, ol {
  61. margin-left: $spacing-unit;
  62. }
  63. li {
  64. > ul,
  65. > ol {
  66. margin-bottom: 0;
  67. }
  68. }
  69. /**
  70. * Headings
  71. */
  72. h1, h2, h3, h4, h5, h6 {
  73. font-family: $header-font-family;
  74. font-size: nth($header-font-size, -1); // default to smallest header size
  75. font-weight: $base-font-weight ;
  76. }
  77. @for $i from 1 through length($header-font-size) {
  78. h#{$i} {
  79. font-size: nth($header-font-size, $i);
  80. font-weight: nth($header-font-weight, $i);
  81. }
  82. }
  83. /**
  84. * Links
  85. */
  86. a {
  87. color: $brand-color;
  88. text-decoration: none;
  89. &:visited {
  90. color: darken($brand-color, 15%);
  91. }
  92. &:hover {
  93. color: $text-color;
  94. text-decoration: underline;
  95. }
  96. }
  97. /**
  98. * Blockquotes
  99. */
  100. blockquote {
  101. color: $grey-color;
  102. border-left: 4px solid $grey-color-light;
  103. padding-left: $spacing-unit / 2;
  104. font-style: italic;
  105. > :last-child {
  106. margin-bottom: 0;
  107. }
  108. }
  109. /**
  110. * Code formatting
  111. */
  112. pre,
  113. code {
  114. font-size: 15px;
  115. border: 1px solid $grey-color-light;
  116. border-radius: 3px;
  117. background-color: #eef;
  118. }
  119. code {
  120. padding: 1px 5px;
  121. }
  122. pre {
  123. padding: 8px 12px;
  124. overflow-x: auto;
  125. > code {
  126. border: 0;
  127. padding-right: 0;
  128. padding-left: 0;
  129. }
  130. }
  131. /**
  132. * additional tags
  133. */
  134. mark {
  135. background-color: $brand-yellow;
  136. color: inherit;
  137. box-shadow: -3px 0 0 0 $brand-yellow, 3px 0 0 0 $brand-yellow;
  138. }
  139. /**
  140. * Wrapper
  141. */
  142. .wrapper {
  143. max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
  144. max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
  145. margin-right: auto;
  146. margin-left: auto;
  147. padding-right: $spacing-unit;
  148. padding-left: $spacing-unit;
  149. @extend %clearfix;
  150. @include media-query($on-laptop) {
  151. max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
  152. max-width: calc(#{$content-width} - (#{$spacing-unit}));
  153. padding-right: $spacing-unit / 2;
  154. padding-left: $spacing-unit / 2;
  155. }
  156. }
  157. /**
  158. * Clearfix
  159. */
  160. %clearfix {
  161. &:after {
  162. content: "";
  163. display: table;
  164. clear: both;
  165. }
  166. }
  167. /**
  168. * Icons
  169. */
  170. .icon {
  171. > svg {
  172. display: inline-block;
  173. width: 16px;
  174. height: 16px;
  175. vertical-align: middle;
  176. path {
  177. fill: $grey-color;
  178. }
  179. }
  180. }