-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat: integrate typography api into all components #4375
Conversation
src/demo-app/demo-app/demo-app.html
Outdated
</button> | ||
<div> | ||
<button md-button (click)="toggleFullscreen()" title="Toggle fullscreen"> | ||
Fullscreen |
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.
Since you're incidentally touching this, can you right-align this and make it an md-icon-button with the fullscreen
icon 😄 ? That's been bothering me forever.
<h6 class="mat-h6">Lorem ipsum dolor sit amet, consectetur adipisicing.</h6> | ||
|
||
<div class="mat-body"> | ||
<p>Lorem ipsum dolor sit amet, <span class="mat-body-strong">consectetur</span> adipisicing elit. Iure voluptatem amet facilis rerum non dolore repellendus ab. Assumenda nisi perspiciatis odit illum voluptatem expedita laborum! Debitis nisi eius, ratione nostrum velit dignissimos molestias saepe, esse facilis blanditiis, labore optio. Accusantium, nihil illo est beatae nobis expedita animi libero, laboriosam excepturi consequatur eaque, ab repudiandae.</p> |
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.
optional: I like adding something more meaningful / whimsical for demos, up to you
@@ -1,5 +1,11 @@ | |||
@import '../core/theming/palette'; | |||
@import '../core/theming/theming'; | |||
@import '../core/typography/typography-utils'; | |||
|
|||
// TODO(crisbeto): these values don't correspond to any of the typography breakpoints. |
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.
We might have to invent our own; the spec often paints broad strokes that don't capture the specific details for each component
.mat-h0, .mat-hero-header { | ||
@include mat-typography-level-to-styles($config, display-4); | ||
letter-spacing: -0.05em; |
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.
Does the letter spacing come from the spec somewhere?
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.
Not really. I arrived at it by overlaying the spec and tweaking ours until they lined up.
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.
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.
This one isn't using the letter spacing at all @mmalerba, the spacing only applies to h1
, h2
and hero header. I've reduced the spacing only on the larger headers.
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.
Ah I see, it seems it switched from Arial to Roboto which explains the difference, maybe we should add .mat-h4/5
to the element so it looks a little better?
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're right, it's because we have a global style for body h1
in the demo app, which ends up overriding the toolbar style. I'll push a fix.
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.
Add a comment somewhere explaining where the values came from, then? I know a year from now I'll be looking at this and be thinking "Where did these come from?!"
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.
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.
@crisbeto the spec doesn't explicitly give the letter spacing, though; we should document where those specific values came from.
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.
Ah I see. As I mentioned, I arrived at them mainly by overlaying the spec over our demo page and tweaking it until they aligned. I'll add notes about it.
@tinayuangao @andrewseguin @kara @mmalerba can you each do a quick pass on the components you own here? |
LGTM for the input, slider, and sidenav changes |
LGTM for checkbox, button, button-toggle and radio-button |
Addressed the feedback @jelbourn. |
@kara @andrewseguin please take a look No idea what's going on with the screenshot tests |
@crisbeto Rebase? |
Rebased @kara. |
LGTM for tooltip/tabs |
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.
@crisbeto I think the rebase may have caused issues. I'm seeing this:
Fixed @kara. I had forgotten to prefix the theme file name with an underscore and it ended up throwing a SASS error. |
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.
LGTM
@crisbeto removing the |
Done @jelbourn. |
Looks like that fixed the errors, but I have to update some internal build rules and screenshot tests to get this submitted, so I'll do a separate sync just for this. |
* Includes the base typography styles for headers, body text etc. * Adds mixins for typography next to the theme and moves out all of the component typography styles into them. * Switches all the hardcoded typography values to use the ones from the spec. * Adjusts the letter spacing on some of the headers to align them to the spec. **Note:** While going through the components, I haven't checked whether the styles are accurate in regards to the spec. I've left notes in the places where the font sizes weren't a part of the pre-defined ones.
@crisbeto Inspecting the demo app, I see that the |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Note: While going through the components, I haven't checked whether the styles are accurate in regards to the spec. I've left notes in the places where the font sizes weren't a part of the pre-defined ones.