Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

MDCTextField: Use em over px for sizing #4164

Closed
patrickrodee opened this issue Dec 11, 2018 · 3 comments
Closed

MDCTextField: Use em over px for sizing #4164

patrickrodee opened this issue Dec 11, 2018 · 3 comments
Labels
backlog Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository.

Comments

@patrickrodee
Copy link
Contributor

patrickrodee commented Dec 11, 2018

Google internally needs rem over px for sizing of text field content to solve for accessible scaling.

An example working codepen has already been created: https://codepen.io/williamernest/pen/bmOKeQ


Related to #2731, #4142

@patrickrodee patrickrodee changed the title Use rem over px for text field sizing Use rem over px for text field sizing Dec 11, 2018
@patrickrodee patrickrodee changed the title Use rem over px for text field sizing MDCTextField: Use rem over px for sizing Dec 11, 2018
@williamernest
Copy link
Contributor

rem doesn't solve the use case of having 2 text fields on the same page be different sizes (ex: an email
subject vs cc line, or a calendar invite title vs location fields).

By basing it on em it still respects the scale applied to rem but allows for more granular control. I recommend we use em and have users specify the specific font-size on the mdc-text-field element or parent directly.

@patrickrodee patrickrodee changed the title MDCTextField: Use rem over px for sizing MDCTextField: Use em over px for sizing Dec 13, 2018
@clshortfuse
Copy link

When trying to fix this exact same issue in AngularJS Material, the solution was to use 1em for the font-size of the input element.

angular/material@1df5336#diff-74a081d9d358e41d6c52623c1b29422dR31

But unfortunately, our fix came along way too late in the framework lifecycle so, ultimately, we couldn't risk breaking design layouts. I suggest adding this sooner than later.

The other question you'll have is, if you resize the input label from 16sp, is the label meant to be 12sp or 75% of the input label? I haven't been able to find an answer for that. MD2015 changed all samples to use 16sp instead of varying height. It used to look like this, showing to use 12sp no matter what size the input was. But with the newer redesign, there are no such samples selectively showing large font. It was changed to this.

That's something you'd have to either take a guess at, or ask for some explicit direction from the Googlers.

@abhiomkar
Copy link
Collaborator

Since we changed font-size to rem can we close this now?

@asyncLiz asyncLiz added the Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository. label Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog Unresolved (Archived) Open and unresolved issues and PRs that were closed due to archiving the repository.
Projects
None yet
Development

No branches or pull requests

5 participants