_base.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. /**
  36. * Images
  37. */
  38. img {
  39. max-width: 100%;
  40. vertical-align: middle;
  41. }
  42. /**
  43. * Figures
  44. */
  45. figure > img {
  46. display: block;
  47. }
  48. figcaption {
  49. font-size: $small-font-size;
  50. }
  51. /**
  52. * Lists
  53. */
  54. ul, ol {
  55. margin-left: $spacing-unit;
  56. }
  57. li {
  58. > ul,
  59. > ol {
  60. margin-bottom: 0;
  61. }
  62. }
  63. /**
  64. * Headings
  65. */
  66. h1, h2, h3, h4, h5, h6 {
  67. font-family: $header-font-family;
  68. font-size: nth($header-font-size, -1); // default to smallest header size
  69. font-weight: $base-font-weight ;
  70. }
  71. @for $i from 1 through length($header-font-size) {
  72. h#{$i} {
  73. font-size: nth($header-font-size, $i);
  74. font-weight: nth($header-font-weight, $i);
  75. }
  76. }
  77. /**
  78. * Links
  79. */
  80. a {
  81. color: $brand-color;
  82. text-decoration: none;
  83. &:visited {
  84. color: darken($brand-color, 15%);
  85. }
  86. &:hover {
  87. color: $text-color;
  88. text-decoration: underline;
  89. }
  90. }
  91. /**
  92. * Blockquotes
  93. */
  94. blockquote {
  95. color: $grey-color;
  96. border-left: 4px solid $grey-color-light;
  97. padding-left: $spacing-unit / 2;
  98. font-style: italic;
  99. > :last-child {
  100. margin-bottom: 0;
  101. }
  102. }
  103. /**
  104. * Code formatting
  105. */
  106. pre,
  107. code {
  108. font-size: 15px;
  109. border: 1px solid $grey-color-light;
  110. border-radius: 3px;
  111. background-color: #eef;
  112. }
  113. code {
  114. padding: 1px 5px;
  115. }
  116. pre {
  117. padding: 8px 12px;
  118. overflow-x: auto;
  119. > code {
  120. border: 0;
  121. padding-right: 0;
  122. padding-left: 0;
  123. }
  124. }
  125. /**
  126. * Wrapper
  127. */
  128. .wrapper {
  129. max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
  130. max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
  131. margin-right: auto;
  132. margin-left: auto;
  133. padding-right: $spacing-unit;
  134. padding-left: $spacing-unit;
  135. @extend %clearfix;
  136. @include media-query($on-laptop) {
  137. max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
  138. max-width: calc(#{$content-width} - (#{$spacing-unit}));
  139. padding-right: $spacing-unit / 2;
  140. padding-left: $spacing-unit / 2;
  141. }
  142. }
  143. /**
  144. * Clearfix
  145. */
  146. %clearfix {
  147. &:after {
  148. content: "";
  149. display: table;
  150. clear: both;
  151. }
  152. }
  153. /**
  154. * Icons
  155. */
  156. .icon {
  157. > svg {
  158. display: inline-block;
  159. width: 16px;
  160. height: 16px;
  161. vertical-align: middle;
  162. path {
  163. fill: $grey-color;
  164. }
  165. }
  166. }