_settings.core.scss 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ///* ========================================================================
  2. // #CORE
  3. // ======================================================================== */
  4. // This core file sets up inuitcss’ most important setup variables. They
  5. // underpin a lot of how the framework functions and should be modified and
  6. // preconfigured with caution.
  7. // Baseline grid lines height.
  8. // Every spacing metric should be based on this.
  9. $inuit-global-baseline: 6px !default;
  10. // How many grid lines should our spacing unit variants span?
  11. // Each value should be an unitless integer.
  12. $inuit-global-spacing-unit-factor-tiny: 1 !default; // 6px
  13. $inuit-global-spacing-unit-factor-small: 2 !default; // 12px
  14. $inuit-global-spacing-unit-factor: 4 !default; // 24px
  15. $inuit-global-spacing-unit-factor-large: 8 !default; // 48px
  16. $inuit-global-spacing-unit-factor-huge: 16 !default; // 96px
  17. // Spacing values are determined based on your project’s global baseline grid.
  18. // It is not recommended that you modify these following variables
  19. // (it can break your vertical rhythm), but if you need to, you can.
  20. $inuit-global-spacing-unit: $inuit-global-baseline * $inuit-global-spacing-unit-factor !default;
  21. $inuit-global-spacing-unit-tiny: $inuit-global-baseline * $inuit-global-spacing-unit-factor-tiny !default;
  22. $inuit-global-spacing-unit-small: $inuit-global-baseline * $inuit-global-spacing-unit-factor-small !default;
  23. $inuit-global-spacing-unit-large: $inuit-global-baseline * $inuit-global-spacing-unit-factor-large !default;
  24. $inuit-global-spacing-unit-huge: $inuit-global-baseline * $inuit-global-spacing-unit-factor-huge !default;
  25. // Base typographical styles.
  26. $inuit-global-font-size: 16px !default;
  27. $inuit-global-line-height: $inuit-global-spacing-unit !default;
  28. // Check that the chosen font rules are pixel numbers.
  29. @each $_inuit-font-globals in
  30. $inuit-global-font-size
  31. $inuit-global-line-height {
  32. @if (type-of($_inuit-font-globals) == number) {
  33. @if (unit($_inuit-font-globals) != "px") {
  34. @error "`#{$_inuit-font-globals}` needs to be a pixel value.";
  35. }
  36. } @else {
  37. @error "`#{$_inuit-font-globals}` needs to be a number.";
  38. }
  39. }
  40. // Check that the chosen size factors are unitless, integer numbers.
  41. @each $_inuit-spacing-unit in
  42. $inuit-global-spacing-unit-factor-tiny
  43. $inuit-global-spacing-unit-factor-small
  44. $inuit-global-spacing-unit-factor-large
  45. $inuit-global-spacing-unit-factor-huge {
  46. @if (type-of($_inuit-spacing-unit) == number) {
  47. @if (unitless($_inuit-spacing-unit) == false) {
  48. @error "`#{$_inuit-spacing-unit}` needs to be unitless.";
  49. }
  50. @if ($_inuit-spacing-unit != ceil($_inuit-spacing-unit)) {
  51. @error "`#{$_inuit-spacing-unit}` needs to be an integer.";
  52. }
  53. } @else {
  54. @error "`#{$_inuit-spacing-unit}` needs to be a number.";
  55. }
  56. }