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

bug(form-field): typography font-size is not used #8939

Closed
benb7760 opened this issue Dec 11, 2017 · 6 comments
Closed

bug(form-field): typography font-size is not used #8939

benb7760 opened this issue Dec 11, 2017 · 6 comments

Comments

@benb7760
Copy link

Bug, feature request, or proposal:

bug

What is the expected behavior?

The font-size of form-fields should be set by typography and default to 16px as per material spec

What is the current behavior?

The font-size for form fields is 'inherit'

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

5.0.0

Is there anything else we should know?

Looking through the code, I find no usage of the 'input' theme config in any of the form fields or controls that reference the font-size. I do see that the 'input' config is used for font-weight and line-height

@benb7760
Copy link
Author

Possibly related to #5154 where the size was changed from 'inherit' to '16px' in the config, but then ignored in the theme

@devversion
Copy link
Member

The font-size has been set to inherit to avoid any breaking changes in 92d8368. We might be able to change that now and publish it in the next major version? cc. @crisbeto

@crisbeto
Copy link
Member

This was discussed in some other issues together with @mmalerba. Using inherit was deliberate since we wanted it to inherit the same font size as whatever other components are around the form field. @benb7760 if you want it to use the size from the typography config, you can throw this somewhere in your SCSS:

.mat-form-field {
  font-size: mat-font-size($typography-config, input);
}

@benb7760
Copy link
Author

@crisbeto makes sense, thanks - I had already done so! Is this something worth documenting somewhere?

@srix55
Copy link

srix55 commented May 10, 2018

The current behavior (inheriting) is not obvious at all. I had set mat-typography with themes & was expecting my form inputs to remain consistent throughout the site irrespective of other elements used around. In my opinion, the typography font-size set at the root level is expected to remain consistent unless explicitly changed at the component level (like how the other typography settings like font-family behave). The current behavior, although deliberate, really feels like a bug.

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants