Skip to content
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

Merged
merged 7 commits into from
May 31, 2017

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 3, 2017

  • 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.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 3, 2017
</button>
<div>
<button md-button (click)="toggleFullscreen()" title="Toggle fullscreen">
Fullscreen
Copy link
Member

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>
Copy link
Member

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.
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for undoing this and just using default spacing, some things look kind of cramped when using these settings, for example the page header.

Page header before this PR:
old-title

Page header after this PR:
new-title

Copy link
Member Author

@crisbeto crisbeto May 8, 2017

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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?!"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Member Author

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.

@jelbourn
Copy link
Member

jelbourn commented May 3, 2017

@tinayuangao @andrewseguin @kara @mmalerba can you each do a quick pass on the components you own here?

@mmalerba
Copy link
Contributor

mmalerba commented May 4, 2017

LGTM for the input, slider, and sidenav changes

@tinayuangao
Copy link
Contributor

LGTM for checkbox, button, button-toggle and radio-button

@crisbeto
Copy link
Member Author

crisbeto commented May 8, 2017

Addressed the feedback @jelbourn.

@jelbourn
Copy link
Member

@kara @andrewseguin please take a look

No idea what's going on with the screenshot tests

@kara
Copy link
Contributor

kara commented May 15, 2017

@crisbeto Rebase?

@crisbeto
Copy link
Member Author

Rebased @kara.

@andrewseguin
Copy link
Contributor

LGTM for tooltip/tabs

Copy link
Contributor

@kara kara left a 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:

screen shot 2017-05-16 at 11 22 38 am

@crisbeto
Copy link
Member Author

Fixed @kara. I had forgotten to prefix the theme file name with an underscore and it ended up throwing a SASS error.

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kara kara added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed cla: yes PR author has agreed to Google's Contributor License Agreement pr: needs review labels May 16, 2017
@jelbourn jelbourn added presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels May 17, 2017
@jelbourn
Copy link
Member

@crisbeto removing the $mat-font-family breaks a bunch of Google apps; can we add it back for know so we can separately refactor it away?

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 17, 2017
@crisbeto
Copy link
Member Author

Done @jelbourn.

@jelbourn jelbourn removed the presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged label May 17, 2017
@jelbourn
Copy link
Member

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.
@mmalerba
Copy link
Contributor

@crisbeto Inspecting the demo app, I see that the mat-button-wrapper for the hamburger icon now has a computed font-size of 13.3333px rather than the 14px it previously had. Do you know what's responsible for this change? Is it expected? (It seems to be the cause of a lot of the screenshot diffs I'm seeing in Google)

@mmalerba mmalerba merged commit e650b04 into angular:master May 31, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants