-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding SCSS Support #5
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@function bk-calculateTypeOffset($line-height, $font-size, $descdender-height-scale){ | ||
$line-height-scale: $line-height / $font-size; | ||
$line-height-scale: (($line-height-scale - 1) / 2) + $descdender-height-scale; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than mutate the |
||
@return $line-height-scale; | ||
} | ||
|
||
@mixin bk-render($font-size, $line-height, $type-offset){ | ||
font-size: $font-size * 1px; | ||
line-height: $line-height * 1px; | ||
transform: translateY( $type-offset * 1em ); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My SASS experience is non-existent so excuse my ignorance, but any reason you dont place these functions inside the |
||
|
||
@mixin basekick( | ||
$bk-type-size-modifier, | ||
$bk-type-row-span, | ||
$bk-descender-height-scale, | ||
$bk-base-font-size, | ||
$bk-grid-row-height, | ||
$bk-line-height-override: false){ | ||
|
||
$font-size: $bk-type-size-modifier * $bk-base-font-size; | ||
|
||
@if type-of($bk-line-height-override) == number { | ||
$line-height: $bk-line-height-override; | ||
$type-offset: bk-calculateTypeOffset($line-height, $font-size, $bk-descender-height-scale); | ||
@include bk-render($font-size, $line-height, $type-offset); | ||
} @else { | ||
$line-height: $bk-grid-row-height * $bk-type-row-span; | ||
$type-offset: bk-calculateTypeOffset($line-height, $font-size, $bk-descender-height-scale); | ||
@include bk-render($font-size, $line-height, $type-offset); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would propose cleaning up some of this duplication by using a more ternary like syntax for the $line-height: if(type-of($bk-line-height-override) == number,
$bk-line-height-override,
$bk-grid-row-height * $bk-type-row-span); Then you would not need to duplicate the |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a typo here, should be
$descender-height-scale