example.scss 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * This file is written in the SCSS syntax of Sass-script. It needs to be
  3. * compiled into CSS by a Sass library. You can find installation instructions
  4. * for various applications with Sass support at http://sass-lang.com/install.
  5. */
  6. $primary-color: #333;
  7. $secondary-color: #fff;
  8. $breakpoints: (
  9. mid: 35em,
  10. large: 50em
  11. );
  12. @function ratio($target, $context) {
  13. @return ($target / $context) * 100%;
  14. }
  15. @mixin font-smoothing($subpixel: false) {
  16. @if $subpixel {
  17. -webkit-font-smoothing: subpixel-antialiased;
  18. -moz-osx-font-smoothing: auto;
  19. }
  20. @else {
  21. -webkit-font-smoothing: antialiased;
  22. -moz-osx-font-smoothing: grayscale;
  23. }
  24. }
  25. body {
  26. color: $primary-color;
  27. background-color: $secondary-color;
  28. }
  29. %inverted {
  30. color: $secondary-color;
  31. background-color: $primary-color;
  32. @include font-smoothing;
  33. }
  34. .row-trio > * {
  35. @media only screen and (min-width: map-get($breakpoints, large)) {
  36. width: ratio(300, 960);
  37. }
  38. }
  39. .page-header {
  40. @extend %inverted;
  41. }
  42. .page-footer {
  43. @extend %inverted;
  44. background-color: #14203B;
  45. a {
  46. color: darken(#fff, 10%);
  47. }
  48. }