Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----
- // libsass (v3.2.5)
- // ----
- $base_font_url : '../bower_components/oneui-core-style/dist/fonts/' !default;
- $base_font_size: 1em; //16px
- $base_line_height: 1.5;
- //Scaling Variables
- $golden: 1.618;
- $minor-second: 1.067;
- $major-second: 1.125;
- $minor-third: 1.2;
- $major-third: 1.25;
- $perfect-fourth: 1.333;
- $augmented-fourth: 1.414;
- $perfect-fifth: 1.5;
- $minor-sixth: 1.6;
- $major-sixth: 1.667;
- $minor-seventh: 1.778;
- $major-seventh: 1.875;
- $octave: 2;
- $major-tenth: 2.5;
- $major-eleventh: 2.667;
- $major-twelfth: 3;
- $double-octave: 4;
- $doubleStrand : 0.875em; //14px
- $modular-scale-ratio: $perfect-fourth;
- $modular-scale-base: $base_font_size $doubleStrand;
- // Modular Scale Mixin for Typography
- $modular-scale-ratio: $perfect-fourth !default;
- $modular-scale-base: em($base_font_size) em(14) !default;
- @function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {
- $v1: nth($value, 1);
- $v2: nth($value, length($value));
- $value: $v1;
- // scale $v2 to just above $v1
- @while $v2 > $v1 {
- $v2: ($v2 / $ratio); // will be off-by-1
- }
- @while $v2 < $v1 {
- $v2: ($v2 * $ratio); // will fix off-by-1
- }
- // Check AFTER scaling $v2 to prevent double-counting corner-case
- $double-stranded: $v2 > $v1;
- @if $increment > 0 {
- @for $i from 1 through $increment {
- @if $double-stranded and ($v1 * $ratio) > $v2 {
- $value: $v2;
- $v2: ($v2 * $ratio);
- } @else {
- $v1: ($v1 * $ratio);
- $value: $v1;
- }
- }
- }
- @if $increment < 0 {
- // adjust $v2 to just below $v1
- @if $double-stranded {
- $v2: ($v2 / $ratio);
- }
- @for $i from $increment through -1 {
- @if $double-stranded and ($v1 / $ratio) < $v2 {
- $value: $v2;
- $v2: ($v2 / $ratio);
- } @else {
- $v1: ($v1 / $ratio);
- $value: $v1;
- }
- }
- }
- @return $value;
- }
- // Vertical Rhythm
- @function vr($font_size,$line_height, $base: 4){
- // Format parameters
- $base_font: $base_font_size/($base_font_size*0+1);
- $font_size:$font_size/($font_size*0+1);
- $line_height:$line_height/($line_height*0+1);
- $total : ($font_size*$line_height) * $base_font;
- @return ceil($total % $base) * 1px;
- }
- $headings : (
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6"
- );
- $increment : length($headings);
- @each $heading in $headings {
- #{$heading} {
- font-size: modular-scale($increment);
- line-height: modular-scale(1);
- margin: vr(modular-scale($increment), $base_line_height,4) 0;
- }
- $increment: $increment - 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement