Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. // ----
  2. // libsass (v3.2.5)
  3. // ----
  4.  
  5. $base_font_url : '../bower_components/oneui-core-style/dist/fonts/' !default;
  6. $base_font_size: 1em; //16px
  7. $base_line_height: 1.5;
  8.  
  9. //Scaling Variables
  10. $golden: 1.618;
  11. $minor-second: 1.067;
  12. $major-second: 1.125;
  13. $minor-third: 1.2;
  14. $major-third: 1.25;
  15. $perfect-fourth: 1.333;
  16. $augmented-fourth: 1.414;
  17. $perfect-fifth: 1.5;
  18. $minor-sixth: 1.6;
  19. $major-sixth: 1.667;
  20. $minor-seventh: 1.778;
  21. $major-seventh: 1.875;
  22. $octave: 2;
  23. $major-tenth: 2.5;
  24. $major-eleventh: 2.667;
  25. $major-twelfth: 3;
  26. $double-octave: 4;
  27.  
  28. $doubleStrand : 0.875em; //14px
  29. $modular-scale-ratio: $perfect-fourth;
  30. $modular-scale-base: $base_font_size $doubleStrand;
  31.  
  32. // Modular Scale Mixin for Typography
  33. $modular-scale-ratio: $perfect-fourth !default;
  34. $modular-scale-base: em($base_font_size) em(14) !default;
  35.  
  36. @function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {
  37. $v1: nth($value, 1);
  38. $v2: nth($value, length($value));
  39. $value: $v1;
  40.  
  41. // scale $v2 to just above $v1
  42. @while $v2 > $v1 {
  43. $v2: ($v2 / $ratio); // will be off-by-1
  44. }
  45. @while $v2 < $v1 {
  46. $v2: ($v2 * $ratio); // will fix off-by-1
  47. }
  48.  
  49. // Check AFTER scaling $v2 to prevent double-counting corner-case
  50. $double-stranded: $v2 > $v1;
  51.  
  52. @if $increment > 0 {
  53. @for $i from 1 through $increment {
  54. @if $double-stranded and ($v1 * $ratio) > $v2 {
  55. $value: $v2;
  56. $v2: ($v2 * $ratio);
  57. } @else {
  58. $v1: ($v1 * $ratio);
  59. $value: $v1;
  60. }
  61. }
  62. }
  63.  
  64. @if $increment < 0 {
  65. // adjust $v2 to just below $v1
  66. @if $double-stranded {
  67. $v2: ($v2 / $ratio);
  68. }
  69.  
  70. @for $i from $increment through -1 {
  71. @if $double-stranded and ($v1 / $ratio) < $v2 {
  72. $value: $v2;
  73. $v2: ($v2 / $ratio);
  74. } @else {
  75. $v1: ($v1 / $ratio);
  76. $value: $v1;
  77. }
  78. }
  79. }
  80.  
  81. @return $value;
  82. }
  83.  
  84. // Vertical Rhythm
  85. @function vr($font_size,$line_height, $base: 4){
  86.  
  87. // Format parameters
  88. $base_font: $base_font_size/($base_font_size*0+1);
  89. $font_size:$font_size/($font_size*0+1);
  90. $line_height:$line_height/($line_height*0+1);
  91.  
  92. $total : ($font_size*$line_height) * $base_font;
  93.  
  94. @return ceil($total % $base) * 1px;
  95.  
  96. }
  97.  
  98. $headings : (
  99. "h1",
  100. "h2",
  101. "h3",
  102. "h4",
  103. "h5",
  104. "h6"
  105. );
  106.  
  107. $increment : length($headings);
  108.  
  109. @each $heading in $headings {
  110. #{$heading} {
  111. font-size: modular-scale($increment);
  112. line-height: modular-scale(1);
  113. margin: vr(modular-scale($increment), $base_line_height,4) 0;
  114. }
  115. $increment: $increment - 1;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement