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: add initial sass typography API #4162

Merged
merged 3 commits into from
Apr 21, 2017
Merged

Conversation

crisbeto
Copy link
Member

Adds an initial implementation for the API that'll be used to do the Material typography.

Note: These are just the various functions and mixins, they aren't being used anywhere yet. The usage for the mat-typography mixin can be:

// Includes the default typography styles.
@include mat-typography();

// Overrides one of the typography levels
@include mat-typography(
  $display-2: mat-typography-level(50px, 52px, 600)
);

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 19, 2017
Adds an initial implementation for the API that'll be used to do the Material typography.
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of minor comments

@return map-get(map-get($config, $level), $name);
}

// Returns the font size for a level inside a typography config.
Copy link
Member

Choose a reason for hiding this comment

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

Returns -> Gets here and elsewhere

$font-weight: mat-font-weight($config, $level);
$line-height: mat-line-height($config, $level);

font: $font-weight #{$font-size}/#{$line-height} unquote(map-get($config, font-family));
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 for what's going on here?

@crisbeto
Copy link
Member Author

Addressed the feedback.

$font-family: mat-font-family($config);

// Use the shorthand `font` to represent a typography level, because it's the shortest. Notes that
// we need to use interpolation for `font-size/line-height` in order to prevent SASS from diving
Copy link
Contributor

Choose a reason for hiding this comment

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

🏊 "dividing"

@jelbourn
Copy link
Member

LGTM, can add merge-ready when you're ready

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Apr 20, 2017
@kara kara merged commit 7de316f into angular:master Apr 21, 2017
@jvbianchi jvbianchi mentioned this pull request Apr 22, 2017
@robertorfischer
Copy link

When are you intending to have this be usable by the other material libraries in this repo and by user code? This looks promising!

@cvgaviao
Copy link

is there any example or doc reference for this feature?

@crisbeto
Copy link
Member Author

There's a guide at https://material.angular.io/guide/typography

@cvgaviao
Copy link

cvgaviao commented Jul 1, 2017

@crisbeto, thanks.

@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