Skip to content

Commit d4fb175

Browse files
andrewseguinjelbourn
authored andcommitted
fix(material-experimental/mdc-tabs): update theming api
1 parent a0597ec commit d4fb175

File tree

4 files changed

+737
-73
lines changed

4 files changed

+737
-73
lines changed

package.json

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -92,53 +92,53 @@
9292
"@bazel/terser": "4.3.0",
9393
"@bazel/typescript": "4.3.0",
9494
"@firebase/app-types": "^0.6.1",
95-
"@material/animation": "14.0.0-canary.c78ff0429.0",
96-
"@material/auto-init": "14.0.0-canary.c78ff0429.0",
97-
"@material/banner": "14.0.0-canary.c78ff0429.0",
98-
"@material/base": "14.0.0-canary.c78ff0429.0",
99-
"@material/button": "14.0.0-canary.c78ff0429.0",
100-
"@material/card": "14.0.0-canary.c78ff0429.0",
101-
"@material/checkbox": "14.0.0-canary.c78ff0429.0",
102-
"@material/chips": "14.0.0-canary.c78ff0429.0",
103-
"@material/circular-progress": "14.0.0-canary.c78ff0429.0",
104-
"@material/data-table": "14.0.0-canary.c78ff0429.0",
105-
"@material/density": "14.0.0-canary.c78ff0429.0",
106-
"@material/dialog": "14.0.0-canary.c78ff0429.0",
107-
"@material/dom": "14.0.0-canary.c78ff0429.0",
108-
"@material/drawer": "14.0.0-canary.c78ff0429.0",
109-
"@material/elevation": "14.0.0-canary.c78ff0429.0",
110-
"@material/fab": "14.0.0-canary.c78ff0429.0",
111-
"@material/feature-targeting": "14.0.0-canary.c78ff0429.0",
112-
"@material/floating-label": "14.0.0-canary.c78ff0429.0",
113-
"@material/form-field": "14.0.0-canary.c78ff0429.0",
114-
"@material/icon-button": "14.0.0-canary.c78ff0429.0",
115-
"@material/image-list": "14.0.0-canary.c78ff0429.0",
116-
"@material/layout-grid": "14.0.0-canary.c78ff0429.0",
117-
"@material/line-ripple": "14.0.0-canary.c78ff0429.0",
118-
"@material/linear-progress": "14.0.0-canary.c78ff0429.0",
119-
"@material/list": "14.0.0-canary.c78ff0429.0",
120-
"@material/menu": "14.0.0-canary.c78ff0429.0",
121-
"@material/menu-surface": "14.0.0-canary.c78ff0429.0",
122-
"@material/notched-outline": "14.0.0-canary.c78ff0429.0",
123-
"@material/radio": "14.0.0-canary.c78ff0429.0",
124-
"@material/ripple": "14.0.0-canary.c78ff0429.0",
125-
"@material/rtl": "14.0.0-canary.c78ff0429.0",
126-
"@material/segmented-button": "14.0.0-canary.c78ff0429.0",
127-
"@material/select": "14.0.0-canary.c78ff0429.0",
128-
"@material/shape": "14.0.0-canary.c78ff0429.0",
129-
"@material/slider": "14.0.0-canary.c78ff0429.0",
130-
"@material/snackbar": "14.0.0-canary.c78ff0429.0",
131-
"@material/switch": "14.0.0-canary.c78ff0429.0",
132-
"@material/tab": "14.0.0-canary.c78ff0429.0",
133-
"@material/tab-bar": "14.0.0-canary.c78ff0429.0",
134-
"@material/tab-indicator": "14.0.0-canary.c78ff0429.0",
135-
"@material/tab-scroller": "14.0.0-canary.c78ff0429.0",
136-
"@material/textfield": "14.0.0-canary.c78ff0429.0",
137-
"@material/theme": "14.0.0-canary.c78ff0429.0",
138-
"@material/tooltip": "14.0.0-canary.c78ff0429.0",
139-
"@material/top-app-bar": "14.0.0-canary.c78ff0429.0",
140-
"@material/touch-target": "14.0.0-canary.c78ff0429.0",
141-
"@material/typography": "14.0.0-canary.c78ff0429.0",
95+
"@material/animation": "14.0.0-canary.1af7c1c4a.0",
96+
"@material/auto-init": "14.0.0-canary.1af7c1c4a.0",
97+
"@material/banner": "14.0.0-canary.1af7c1c4a.0",
98+
"@material/base": "14.0.0-canary.1af7c1c4a.0",
99+
"@material/button": "14.0.0-canary.1af7c1c4a.0",
100+
"@material/card": "14.0.0-canary.1af7c1c4a.0",
101+
"@material/checkbox": "14.0.0-canary.1af7c1c4a.0",
102+
"@material/chips": "14.0.0-canary.1af7c1c4a.0",
103+
"@material/circular-progress": "14.0.0-canary.1af7c1c4a.0",
104+
"@material/data-table": "14.0.0-canary.1af7c1c4a.0",
105+
"@material/density": "14.0.0-canary.1af7c1c4a.0",
106+
"@material/dialog": "14.0.0-canary.1af7c1c4a.0",
107+
"@material/dom": "14.0.0-canary.1af7c1c4a.0",
108+
"@material/drawer": "14.0.0-canary.1af7c1c4a.0",
109+
"@material/elevation": "14.0.0-canary.1af7c1c4a.0",
110+
"@material/fab": "14.0.0-canary.1af7c1c4a.0",
111+
"@material/feature-targeting": "14.0.0-canary.1af7c1c4a.0",
112+
"@material/floating-label": "14.0.0-canary.1af7c1c4a.0",
113+
"@material/form-field": "14.0.0-canary.1af7c1c4a.0",
114+
"@material/icon-button": "14.0.0-canary.1af7c1c4a.0",
115+
"@material/image-list": "14.0.0-canary.1af7c1c4a.0",
116+
"@material/layout-grid": "14.0.0-canary.1af7c1c4a.0",
117+
"@material/line-ripple": "14.0.0-canary.1af7c1c4a.0",
118+
"@material/linear-progress": "14.0.0-canary.1af7c1c4a.0",
119+
"@material/list": "14.0.0-canary.1af7c1c4a.0",
120+
"@material/menu": "14.0.0-canary.1af7c1c4a.0",
121+
"@material/menu-surface": "14.0.0-canary.1af7c1c4a.0",
122+
"@material/notched-outline": "14.0.0-canary.1af7c1c4a.0",
123+
"@material/radio": "14.0.0-canary.1af7c1c4a.0",
124+
"@material/ripple": "14.0.0-canary.1af7c1c4a.0",
125+
"@material/rtl": "14.0.0-canary.1af7c1c4a.0",
126+
"@material/segmented-button": "14.0.0-canary.1af7c1c4a.0",
127+
"@material/select": "14.0.0-canary.1af7c1c4a.0",
128+
"@material/shape": "14.0.0-canary.1af7c1c4a.0",
129+
"@material/slider": "14.0.0-canary.1af7c1c4a.0",
130+
"@material/snackbar": "14.0.0-canary.1af7c1c4a.0",
131+
"@material/switch": "14.0.0-canary.1af7c1c4a.0",
132+
"@material/tab": "14.0.0-canary.1af7c1c4a.0",
133+
"@material/tab-bar": "14.0.0-canary.1af7c1c4a.0",
134+
"@material/tab-indicator": "14.0.0-canary.1af7c1c4a.0",
135+
"@material/tab-scroller": "14.0.0-canary.1af7c1c4a.0",
136+
"@material/textfield": "14.0.0-canary.1af7c1c4a.0",
137+
"@material/theme": "14.0.0-canary.1af7c1c4a.0",
138+
"@material/tooltip": "14.0.0-canary.1af7c1c4a.0",
139+
"@material/top-app-bar": "14.0.0-canary.1af7c1c4a.0",
140+
"@material/touch-target": "14.0.0-canary.1af7c1c4a.0",
141+
"@material/typography": "14.0.0-canary.1af7c1c4a.0",
142142
"@octokit/rest": "18.3.5",
143143
"@rollup/plugin-babel": "^5.3.0",
144144
"@rollup/plugin-commonjs": "^20.0.0",

packages.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
33
# version for the placeholders.
44
ANGULAR_PACKAGE_VERSION = "^13.0.0-0 || ^14.0.0-0"
5-
MDC_PACKAGE_VERSION = "14.0.0-canary.c78ff0429.0"
5+
MDC_PACKAGE_VERSION = "14.0.0-canary.1af7c1c4a.0"
66
TSLIB_PACKAGE_VERSION = "^2.3.0"
77
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.0.0"
88

src/material-experimental/mdc-tabs/_tabs-theme.scss

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,32 @@
2525
// `theme-styles` are included in the `tab` mixin inside `_tabs-common.scss`. Currently
2626
// they are not, because `theme-styles` outputs the token values directly, rather than
2727
// generating CSS variables.
28-
@include mdc-tab-theme.theme-styles(map.merge(mdc-tab-theme.$light-theme, (
29-
container-color: $surface,
30-
inactive-focus-state-layer-color: $on-surface,
31-
inactive-hover-state-layer-color: $on-surface,
32-
inactive-pressed-state-layer-color: $on-surface,
33-
with-icon-inactive-focus-icon-color: $on-surface,
34-
with-icon-inactive-hover-icon-color: $on-surface,
35-
with-icon-inactive-icon-color: $on-surface,
36-
with-icon-inactive-pressed-icon-color: $on-surface,
37-
with-label-text-inactive-focus-label-text-color: $on-surface,
38-
with-label-text-inactive-hover-label-text-color: $on-surface,
39-
with-label-text-inactive-label-text-color: $on-surface,
40-
with-label-text-inactive-pressed-label-text-color: $on-surface,
41-
42-
// TODO(crisbeto): MDC's styles are set up so that the icon size is set through a
43-
// `font-size` at the root of the tab while the text size of the tab is set on
44-
// `.mdc-tab__text-label` which overrides the one from the root. The problem is that the
45-
// `$light-theme` is looking for a `subhead2` level which doesn't exist in MDC's code which
46-
// in turn causes no text label styles to be emitted and for the icon size to be applied to
47-
// the entire tab. Since we don't support icons inside the tab anyway, we can temporarily
48-
// work around it by preventing MDC from emitting icon styles. The correct label typography
49-
// will be applied by our theme instead.
50-
with-icon-icon-size: null
51-
)));
28+
@include mdc-tab-theme.primary-navigation-tab-theme-styles(map.merge(
29+
mdc-tab-theme.$primary-light-theme,
30+
(
31+
container-color: $surface,
32+
inactive-focus-state-layer-color: $on-surface,
33+
inactive-hover-state-layer-color: $on-surface,
34+
inactive-pressed-state-layer-color: $on-surface,
35+
with-icon-inactive-focus-icon-color: $on-surface,
36+
with-icon-inactive-hover-icon-color: $on-surface,
37+
with-icon-inactive-icon-color: $on-surface,
38+
with-icon-inactive-pressed-icon-color: $on-surface,
39+
with-label-text-inactive-focus-label-text-color: $on-surface,
40+
with-label-text-inactive-hover-label-text-color: $on-surface,
41+
with-label-text-inactive-label-text-color: $on-surface,
42+
with-label-text-inactive-pressed-label-text-color: $on-surface,
43+
44+
// TODO(crisbeto): MDC's styles are set up so that the icon size is set through a
45+
// `font-size` at the root of the tab while the text size of the tab is set on
46+
// `.mdc-tab__text-label` which overrides the one from the root. The problem is that
47+
// the `$light-theme` is looking for a `subhead2` level which doesn't exist in MDC's
48+
// code which in turn causes no text label styles to be emitted and for the icon size
49+
// to be applied to the entire tab. Since we don't support icons inside the tab
50+
// anyway, we can temporarily work around it by preventing MDC from emitting icon
51+
// styles. The correct label typography will be applied by our theme instead.
52+
with-icon-icon-size: null
53+
)));
5254

5355
// MDC seems to include a background color on tabs which only stands out on dark themes.
5456
// Disable for now for backwards compatibility. These styles are inside the theme in order
@@ -127,7 +129,7 @@
127129
// `theme-styles` are included in the `tab` mixin inside `_tabs-common.scss`. Currently
128130
// they are not, because `theme-styles` outputs the token values directly, rather than
129131
// generating CSS variables.
130-
@include mdc-tab-theme.theme-styles((
132+
@include mdc-tab-theme.primary-navigation-tab-theme-styles((
131133
active-focus-state-layer-color: $color,
132134
active-hover-state-layer-color: $color,
133135
active-pressed-state-layer-color: $color,

0 commit comments

Comments
 (0)