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

mdc-textfield Outlined incorrect specs #2826

Closed
EstebanG23 opened this issue May 25, 2018 · 2 comments
Closed

mdc-textfield Outlined incorrect specs #2826

EstebanG23 opened this issue May 25, 2018 · 2 comments
Labels

Comments

@EstebanG23
Copy link
Contributor

Specs show the whole component should come to be 56px in height. Also 16px in spacing between the icon, and 28px from the label baseline to the input baseline.
https://material.io/design/components/text-fields.html#spec

screen shot 2018-05-25 at 2 23 45 pm

But our components show:

  • 54px in height
  • 16px on top of icon, 24px for icon and 14px below icon
  • 30px from label baseline to input baseline

screen shot 2018-05-25 at 2 09 09 pm
screen shot 2018-05-25 at 2 09 37 pm
screen shot 2018-05-25 at 2 12 20 pm

@rubenmendoza
Copy link

image

My fixes so far, :

.mdc-text-field--outlined .mdc-text-field__input:-webkit-autofill+.mdc-floating-label{
-webkit-transform: translateY(calc(-100% - 9px)) scale(.75);
transform: translateY(calc(-100% - 9px)) scale(.75);
}
.mdc-text-field--outlined .mdc-floating-label--float-above{
-webkit-transform: translateY(calc(-130% - 4px)) scale(.75);
transform: translateY(calc(-130% - 4px)) scale(.75);
}
.mdc-text-field--outlined{
margin-bottom: 0;
}
.mdc-text-field--outlined+.mdc-text-field-helper-text{
margin-left: 12px;
}

/* Change autocomplete styles in WebKit */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus
input:-webkit-autofill,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
-webkit-text-fill-color: rgba(0,0,0,.6) !important;
-webkit-box-shadow: 0 0 0px 1000px transparent inset;
transition: background-color 5000s ease-in-out 0s;
}

@kfranqueiro
Copy link
Contributor

Tracking this, but Will pointed out that we may want to doublecheck to make sure there's not going to be any further line-height-related typography implementation changes before we commit changes for issues like this.

acdvorak added a commit that referenced this issue Aug 13, 2018
BREAKING CHANGE: The `mdc-text-field--upgraded` class has been removed. `mdc-text-field__input` position has changed by 2px to match spec. `mdc-text-field--textarea` width in IE and Edge now matches other browsers.

### What it does

- Fixes vertical text alignment of `mdc-text-field__input` in the `mdc-text-field--box` variant to match spec. Baseline is now 28px instead of 30px. See #2826.
- Fixes `textarea` width in IE and Edge:
    - Replaces unsupported values `fit-content` and `initial` with `auto`
- Removes the `mdc-text-field--upgraded` class:
    - Prevents text fields from resizing and causing browser reflow jank after the JS initializes
    - Most properties from `mdc-text-field--upgraded` have been moved to `mdc-text-field`
    - Sets `display: inline-flex`, `box-sizing: border-box`, and `margin-top: 16px` on all variants

### Example output

#### Before:

![before](https://user-images.githubusercontent.com/409245/43914999-46b71f76-9bbe-11e8-9882-24067cff11f8.png)

#### After:

![after](https://user-images.githubusercontent.com/409245/43915004-4b121b2a-9bbe-11e8-9011-729dc004ecc0.png)

#### Spec:

[Text field guidelines](https://material-io-project.appspot.com/design/components/text-fields.html#spec)

![image](https://user-images.githubusercontent.com/409245/43916708-33e4b994-9bc3-11e8-8b95-b907d801630e.png)
@jamesmfriedman jamesmfriedman mentioned this issue Aug 23, 2018
48 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants