-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[K7] Font sizing, weights, families and mixins #12879
Changes from 2 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@import 'naming'; | ||
@import 'responsive'; | ||
@import 'typography'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Some mixins that help us deal with browser scaling of text more consistantly. | ||
// Essentially, fonts across kui should scale agains the root html element, not | ||
// against parent inheritance. | ||
|
||
|
||
// Typography mixins | ||
|
||
@function convertToRem($size) { | ||
@return #{$size / $kuiFontSize}rem; | ||
} | ||
|
||
// Spit out rem and px | ||
|
||
@mixin fontSize($size: $kuiFontSize) { | ||
font-size: $size; | ||
font-size: convert-to-rem($size); | ||
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. Can we add a comment explaining why we're using both 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. And why are we calling |
||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Font | ||
|
||
// Families | ||
$kuiFontFamily: "Roboto", Helvetica, Arial, sans-serif; | ||
$kuiCodeFontFamily: "Roboto Mono", monospace; | ||
|
||
// Font sizes | ||
$kuiFontSize: $kuiSize; | ||
|
||
$kuiFontSizeXS: 12px; | ||
$kuiFontSizeS: 14px; | ||
$kuiFontSizeM: $kuiFontSize; | ||
$kuiFontSizeL: 24px; | ||
$kuiFontSizeXL: 32px; | ||
$kuiFontSizeXXL: 48px; | ||
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. Should these other sizes be multiples of 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. Also, is there a reason not to convert these variables to rem here in their definition? 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'd like to still try and account for older versions of IE since we target enterprise. the |
||
|
||
// Line height | ||
|
||
$kuiLineHeight: 1.5 * $kuiFontSize; | ||
|
||
// Font weights | ||
|
||
$kuiFontWeightLight: 300; | ||
$kuiFontWeightRegular: 400; | ||
$kuiFontWeightMedium: 500; | ||
|
||
// Our base fonts | ||
|
||
%kuiFont { | ||
font-family: $kuiFontFamily; | ||
font-weight: $kuiFontWeightRegular; | ||
} | ||
|
||
%kuiCodeFont { | ||
font-family: $kuiCodeFontFamily; | ||
} | ||
|
||
// Font sizing extends, using rem mixin | ||
|
||
%kuiFontSize { | ||
font-size: rem($kuiFontSize); | ||
line-height: $kuiLineHeight; | ||
} | ||
|
||
%kuiFontSizeXS { | ||
font-size: rem($kuiFontSizeXS); | ||
line-height: $kuiLineHeight; | ||
} | ||
|
||
%kuiFontSizeS { | ||
font-size: rem($kuiFontSizeS); | ||
line-height: $kuiLineHeight; | ||
} | ||
|
||
%kuiFontSizeM { | ||
font-size: rem($kuiFontSizeM); | ||
line-height: $kuiLineHeight; | ||
} | ||
|
||
%kuiFontSizeL { | ||
font-size: rem($kuiFontSizeL); | ||
line-height: $kuiLineHeight * 1.5; | ||
} | ||
|
||
%kuiFontSizeXL { | ||
font-size: rem($kuiFontSizeXL); | ||
line-height: $kuiLineHeight * 2; | ||
} | ||
|
||
%kuiFontSizeXXL { | ||
font-size: rem($kuiFontSizeXXL); | ||
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. What's the |
||
line-height: $kuiLineHeight * 3; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Adapted from Eric Meyer's reset (http://meyerweb.com/eric/tools/css/reset/, v2.0 | 20110126). | ||
* | ||
*/ | ||
* { | ||
border-box: box-sizing; } | ||
|
||
html, body, div, span, applet, object, iframe, | ||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | ||
a, abbr, acronym, address, big, cite, code, | ||
del, dfn, em, img, ins, kbd, q, s, samp, | ||
small, strike, strong, sub, sup, tt, var, | ||
b, u, i, center, | ||
dl, dt, dd, ol, ul, li, | ||
fieldset, form, label, legend, | ||
table, caption, tbody, tfoot, thead, tr, th, td, | ||
article, aside, canvas, details, embed, | ||
figure, figcaption, footer, header, hgroup, | ||
menu, nav, output, ruby, section, summary, | ||
time, mark, audio, video { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font: inherit; | ||
vertical-align: baseline; } | ||
|
||
/* HTML5 display-role reset for older browsers */ | ||
article, aside, details, figcaption, figure, | ||
footer, header, hgroup, menu, nav, section { | ||
display: block; } | ||
|
||
body { | ||
line-height: 1; } | ||
|
||
ol, ul { | ||
list-style: none; } | ||
|
||
blockquote, q { | ||
quotes: none; } | ||
|
||
blockquote:before, blockquote:after, | ||
q:before, q:after { | ||
content: ''; | ||
content: none; } | ||
|
||
table { | ||
border-collapse: collapse; | ||
border-spacing: 0; } |
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.
Dumb question: what's an additive selector?