Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(tabs): update min-width to follow the spec #11438

Merged
merged 1 commit into from
Jun 30, 2020
Merged

Conversation

Splaktar
Copy link
Member

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Previous commits removed use of getMinTabWidth() but never updated the CSS to apply the proper min-width.

  • Tabs always had a min width of 72px even though they should have a min width of 160px "on larger devices" according to the MD spec.

Issue Number:
Relates to #10406. Relates to #11432.

What is the new behavior?

  • This applies the proper min-width CSS to match the spec.
    • which is 72px on xs and 160px on everything else.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Other information

This is not a breaking API or CSS change, but it will break screenshot tests. However the new result is aligned with the Material Design spec.

Also please note that this is fixing a regression from a breaking change that was in 1.1.2.

Before (IE on bottom, Chrome on top):
chrome-and-ie-before-fix

After in IE (Chrome and IE look the same now)
tabs-pagination-ie11-fixed
tabs-fixed-ie11

And here is IE11 rendering with a small width (sub 600px)
tabs-pagination-ie11-xs-fixed
tabs-fixed-ie11-xs

@Splaktar Splaktar added type: bug severity: regression This issue is related to a regression P3: important Important issues that really should be fixed when possible. type: spec alignment For issues related to aligning with the Material Design Spec labels Sep 10, 2018
@Splaktar Splaktar added this to the 1.2.0 milestone Sep 10, 2018
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Sep 10, 2018
@Splaktar Splaktar self-assigned this Jun 29, 2020
@Splaktar Splaktar requested a review from mmalerba June 29, 2020 23:47
@Splaktar
Copy link
Member Author

Rebased and added breaking change note to commit message.

- previous commits removed use of `getMinTabWidth` but never updated the related CSS
  - this applies the proper `min-width` CSS to match the spec
  - which is `72px` on `xs` and `160px` on everything else
- this also changes the left and right padding from `24px` to `12px` to align with the spec

Relates to #10406. Relates to #11432.

BREAKING CHANGE: Tab items now have a `min-width` and `padding` which matches the Material Design specification. For width, this is `72px` on `xs` screens and `160px` on all other screens. For left and right `padding`, this is now `12px` instead of `24px`. If your app needs to have tabs which are smaller than the spec, you will need to override `md-tab-item`'s `min-width` and `md-tab`'s `padding` styles.
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Jun 29, 2020
@Splaktar Splaktar removed the request for review from mmalerba June 30, 2020 18:14
@Splaktar Splaktar merged commit 693ecca into master Jun 30, 2020
@Splaktar Splaktar deleted the changeTabMinWidth branch June 30, 2020 18:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
- Breaking Change cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P3: important Important issues that really should be fixed when possible. pr: merge ready This PR is ready for a caretaker to review severity: regression This issue is related to a regression type: bug type: spec alignment For issues related to aligning with the Material Design Spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants