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

feat(tab): Update layout; Add fixed-width mixin; Add min-width class #3220

Merged
merged 5 commits into from
Jul 26, 2018

Conversation

patrickrodee
Copy link
Contributor

Update the layout to rely more directly on flexbox positioning instead of padding. Add a mixin for setting a tab to a fixed width. Add a class to make a tab shrink to the narrowest possible width.

@@ -104,6 +105,7 @@ Mixin | Description
`mdc-tab-text-label-color($color)` | Customizes the color of the tab text label.
`mdc-tab-icon-color($color)` | Customizes the color of the tab icon.
`mdc-tab-parent-positioning` | Sets the positioning of the MDCTab's parent element so that `MDCTab.computeDimensions()` reports the same values in all browsers.
`mdc-tab-fixed-width($width)` | Sets the fixed width of the tab. The tab will never be smaller than the given width, although it may be larger if the content of the tab is larger than the given width.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be named mdc-tab-min-width instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does set the tab to a fixed width from which it won't grow or shrink. I think min-width isn't quite as accurate.

justify-content: center;
height: inherit;
pointer-events: none;
z-index: 2;
}

.mdc-tab__text-label,
.mdc-tab__icon {
z-index: 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking...

@codecov-io
Copy link

codecov-io commented Jul 26, 2018

Codecov Report

Merging #3220 into feat/tabs/tabs will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           feat/tabs/tabs    #3220   +/-   ##
===============================================
  Coverage           98.27%   98.27%           
===============================================
  Files                 114      114           
  Lines                4818     4818           
  Branches              602      602           
===============================================
  Hits                 4735     4735           
  Misses                 83       83

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b6e49d...284fe41. Read the comment docs.

@patrickrodee
Copy link
Contributor Author

patrickrodee commented Jul 26, 2018

The z-index on the text label and icon that you originally asked about was to fix layering issues when an icon tab indicator was placed inside the tab content. In those cases, the icon tab indicator would appear "on top" of the text label and the icon. By removing the z-index from the tab content and instead applying it directly to the text label and the icon, we can get the original intention and solve the layering problem I originally set out to solve, and with no additional z-index properties. Yay!

Copy link
Contributor

@acdvorak acdvorak left a comment

Choose a reason for hiding this comment

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

LGTM!

@mdc-web-bot
Copy link
Collaborator

All 128 screenshot tests passed for commit 284fe41 vs. feat/tabs/tabs! 💯🎉

@patrickrodee patrickrodee merged commit 932eac2 into feat/tabs/tabs Jul 26, 2018
kfranqueiro pushed a commit that referenced this pull request Jul 27, 2018
WIP fixed bg coloring of icons

fix(tab-indicator): Use absolute positioning (#2547)

WIP start of tab scroller

WIP fixed transition duration

WIP progress on scroller

WIP added demos back

chore(tabs): Removed tab scroller

feat(tabs): Add tab indicator inside tab (#2565)

feat(tab-scroller): Add tab scroller (#2577)

Merge master into feat/tabs/tabs (#3096)

feat(tab): Update tab color and typography (#3108)

docs(tabs): Update metadata and synopses (#3117)

feat(tab): Add MDCTabDimensions computation (#3122)

feat(tab): Emit selection and activation events (#3139)

docs(tabs): Update new READMEs to match standard (#3142)

feat(tab): Give focus to tab when activated (#3164)

feat(tab): Add mixin for parent positioning; Use mixin in tab scroller (#3179)

fix(tabs): Suppress area occupied by scrollbar on platforms that show it (#3149)

fix(tab): Remove extraneous padding from the stacked text label in LTR (#3193)

feat(tabs): Add missing docs and create helper util API (#3194)

Merge master into feat/tabs/tabs (#3227)

feat(tab): Update layout; Add fixed-width mixin; Add min-width class (#3220)

fix(tab-scroller): Fix incorrect animation stopping scroll value in RTL (#3237)

feat(tab-scroller): Add scroll content width method for use in tab bar (#3222)

feat(tab): Remove activation event emitting (#3242)

feat(tab-bar): Add tab bar (#3229)
@kfranqueiro kfranqueiro deleted the feat/tabs/tabs-tab-layout-updates branch August 1, 2018 16:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants