Unverified Commit 21a6c064 authored by Darren Austin's avatar Darren Austin Committed by GitHub

Update Material tokens to v0.81. (#98149)

parent 21de8505
...@@ -34,17 +34,9 @@ Future<void> main(List<String> args) async { ...@@ -34,17 +34,9 @@ Future<void> main(List<String> args) async {
'dialog.json', 'dialog.json',
'elevation.json', 'elevation.json',
'fab_extended_primary.json', 'fab_extended_primary.json',
'fab_extended_secondary.json',
'fab_extended_surface.json',
'fab_large_primary.json', 'fab_large_primary.json',
'fab_large_secondary.json',
'fab_large_surface.json',
'fab_primary.json', 'fab_primary.json',
'fab_secondary.json',
'fab_small_primary.json', 'fab_small_primary.json',
'fab_small_secondary.json',
'fab_small_surface.json',
'fab_surface.json',
'filter_chip.json', 'filter_chip.json',
'input_chip.json', 'input_chip.json',
'motion.json', 'motion.json',
...@@ -61,15 +53,16 @@ Future<void> main(List<String> args) async { ...@@ -61,15 +53,16 @@ Future<void> main(List<String> args) async {
'typeface.json', 'typeface.json',
]; ];
// Generate a map with all the tokens to simplify the template interface.
final Map<String, dynamic> tokens = <String, dynamic>{}; final Map<String, dynamic> tokens = <String, dynamic>{};
// Special case the light and dark color schemes.
tokens['colorsLight'] = _readTokenFile('color_light.json');
tokens['colorsDark'] = _readTokenFile('color_dark.json');
for (final String tokenFile in tokenFiles) { for (final String tokenFile in tokenFiles) {
tokens.addAll(_readTokenFile(tokenFile)); tokens.addAll(_readTokenFile(tokenFile));
} }
// Special case the light and dark color schemes.
tokens['colorsLight'] = _readTokenFile('color_light.json');
tokens['colorsDark'] = _readTokenFile('color_dark.json');
FABTemplate('$materialLib/floating_action_button.dart', tokens).updateFile(); FABTemplate('$materialLib/floating_action_button.dart', tokens).updateFile();
TypographyTemplate('$materialLib/typography.dart', tokens).updateFile(); TypographyTemplate('$materialLib/typography.dart', tokens).updateFile();
} }
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.assist-chip.container.height": 32.0, "md.comp.assist-chip.container.height": 32.0,
"md.comp.assist-chip.container.shape": "md.sys.shape.corner.small", "md.comp.assist-chip.container.shape": "md.sys.shape.corner.small",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.banner.action.focus.label-text.color": "primary", "md.comp.banner.action.focus.label-text.color": "primary",
"md.comp.banner.action.focus.state-layer.color": "primary", "md.comp.banner.action.focus.state-layer.color": "primary",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.color.background": "md.ref.palette.neutral10", "md.sys.color.background": "md.ref.palette.neutral10",
"md.sys.color.error": "md.ref.palette.error80", "md.sys.color.error": "md.ref.palette.error80",
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"md.sys.color.secondary-container": "md.ref.palette.secondary30", "md.sys.color.secondary-container": "md.ref.palette.secondary30",
"md.sys.color.shadow": "md.ref.palette.neutral0", "md.sys.color.shadow": "md.ref.palette.neutral0",
"md.sys.color.surface": "md.ref.palette.neutral10", "md.sys.color.surface": "md.ref.palette.neutral10",
"md.sys.color.surface-tint-color": "primary",
"md.sys.color.surface-variant": "md.ref.palette.neutral-variant30", "md.sys.color.surface-variant": "md.ref.palette.neutral-variant30",
"md.sys.color.tertiary": "md.ref.palette.tertiary80", "md.sys.color.tertiary": "md.ref.palette.tertiary80",
"md.sys.color.tertiary-container": "md.ref.palette.tertiary30" "md.sys.color.tertiary-container": "md.ref.palette.tertiary30"
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.color.background": "md.ref.palette.neutral99", "md.sys.color.background": "md.ref.palette.neutral99",
"md.sys.color.error": "md.ref.palette.error40", "md.sys.color.error": "md.ref.palette.error40",
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"md.sys.color.secondary-container": "md.ref.palette.secondary90", "md.sys.color.secondary-container": "md.ref.palette.secondary90",
"md.sys.color.shadow": "md.ref.palette.neutral0", "md.sys.color.shadow": "md.ref.palette.neutral0",
"md.sys.color.surface": "md.ref.palette.neutral99", "md.sys.color.surface": "md.ref.palette.neutral99",
"md.sys.color.surface-tint-color": "primary",
"md.sys.color.surface-variant": "md.ref.palette.neutral-variant90", "md.sys.color.surface-variant": "md.ref.palette.neutral-variant90",
"md.sys.color.tertiary": "md.ref.palette.tertiary40", "md.sys.color.tertiary": "md.ref.palette.tertiary40",
"md.sys.color.tertiary-container": "md.ref.palette.tertiary90" "md.sys.color.tertiary-container": "md.ref.palette.tertiary90"
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.dialog.action.focus.label-text.color": "primary", "md.comp.dialog.action.focus.label-text.color": "primary",
"md.comp.dialog.action.focus.state-layer.color": "primary", "md.comp.dialog.action.focus.state-layer.color": "primary",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.elevation.level0": 0.0, "md.sys.elevation.level0": 0.0,
"md.sys.elevation.level1": 1.0, "md.sys.elevation.level1": 1.0,
"md.sys.elevation.level2": 3.0, "md.sys.elevation.level2": 3.0,
"md.sys.elevation.level3": 6.0, "md.sys.elevation.level3": 6.0,
"md.sys.elevation.level4": 8.0, "md.sys.elevation.level4": 8.0,
"md.sys.elevation.level5": 12.0, "md.sys.elevation.level5": 12.0
"md.sys.elevation.surface-tint-color": "primary"
} }
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.extended-fab.primary.container.color": "primaryContainer", "md.comp.extended-fab.primary.container.color": "primaryContainer",
"md.comp.extended-fab.primary.container.elevation": "md.sys.elevation.level3", "md.comp.extended-fab.primary.container.elevation": "md.sys.elevation.level3",
......
{
"version": "v0_76",
"md.comp.extended-fab.secondary.container.color": "secondaryContainer",
"md.comp.extended-fab.secondary.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.secondary.container.height": 56.0,
"md.comp.extended-fab.secondary.container.shadow-color": "shadow",
"md.comp.extended-fab.secondary.container.shape": "md.sys.shape.corner.large",
"md.comp.extended-fab.secondary.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.secondary.focus.icon.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.focus.label-text.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.focus.state-layer.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.extended-fab.secondary.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.extended-fab.secondary.hover.icon.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.hover.label-text.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.hover.state-layer.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.extended-fab.secondary.icon.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.icon.size": 24.0,
"md.comp.extended-fab.secondary.label-text.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.label-text.text-style": "labelLarge",
"md.comp.extended-fab.secondary.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.secondary.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.secondary.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.extended-fab.secondary.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.secondary.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.secondary.pressed.icon.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.pressed.label-text.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.pressed.state-layer.color": "onSecondaryContainer",
"md.comp.extended-fab.secondary.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{
"version": "v0_76",
"md.comp.extended-fab.surface.container.color": "surface",
"md.comp.extended-fab.surface.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.surface.container.height": 56.0,
"md.comp.extended-fab.surface.container.shadow-color": "shadow",
"md.comp.extended-fab.surface.container.shape": "md.sys.shape.corner.large",
"md.comp.extended-fab.surface.container.surface-tint-layer.color": "surfaceTintColor",
"md.comp.extended-fab.surface.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.surface.focus.icon.color": "primary",
"md.comp.extended-fab.surface.focus.label-text.color": "primary",
"md.comp.extended-fab.surface.focus.state-layer.color": "primary",
"md.comp.extended-fab.surface.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.extended-fab.surface.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.extended-fab.surface.hover.icon.color": "primary",
"md.comp.extended-fab.surface.hover.label-text.color": "primary",
"md.comp.extended-fab.surface.hover.state-layer.color": "primary",
"md.comp.extended-fab.surface.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.extended-fab.surface.icon.color": "primary",
"md.comp.extended-fab.surface.icon.size": 24.0,
"md.comp.extended-fab.surface.label-text.color": "primary",
"md.comp.extended-fab.surface.label-text.text-style": "labelLarge",
"md.comp.extended-fab.surface.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.surface.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.surface.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.extended-fab.surface.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.extended-fab.surface.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.extended-fab.surface.pressed.icon.color": "primary",
"md.comp.extended-fab.surface.pressed.label-text.color": "primary",
"md.comp.extended-fab.surface.pressed.state-layer.color": "primary",
"md.comp.extended-fab.surface.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.fab.primary.large.container.color": "primaryContainer", "md.comp.fab.primary.large.container.color": "primaryContainer",
"md.comp.fab.primary.large.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.large.container.elevation": "md.sys.elevation.level3",
......
{
"version": "v0_76",
"md.comp.fab.secondary.large.container.color": "secondaryContainer",
"md.comp.fab.secondary.large.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.large.container.height": 96.0,
"md.comp.fab.secondary.large.container.shadow-color": "shadow",
"md.comp.fab.secondary.large.container.shape": "md.sys.shape.corner.extra-large",
"md.comp.fab.secondary.large.container.width": 96.0,
"md.comp.fab.secondary.large.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.large.focus.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.focus.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.secondary.large.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.secondary.large.hover.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.hover.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.secondary.large.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.icon.size": 36.0,
"md.comp.fab.secondary.large.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.large.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.large.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.secondary.large.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.large.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.large.pressed.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.pressed.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.large.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{
"version": "v0_76",
"md.comp.fab.surface.large.container.color": "surface",
"md.comp.fab.surface.large.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.large.container.height": 96.0,
"md.comp.fab.surface.large.container.shadow-color": "shadow",
"md.comp.fab.surface.large.container.shape": "md.sys.shape.corner.extra-large",
"md.comp.fab.surface.large.container.surface-tint-layer.color": "surfaceTintColor",
"md.comp.fab.surface.large.container.width": 96.0,
"md.comp.fab.surface.large.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.large.focus.icon.color": "primary",
"md.comp.fab.surface.large.focus.state-layer.color": "primary",
"md.comp.fab.surface.large.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.surface.large.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.surface.large.hover.icon.color": "primary",
"md.comp.fab.surface.large.hover.state-layer.color": "primary",
"md.comp.fab.surface.large.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.surface.large.icon.color": "primary",
"md.comp.fab.surface.large.icon.size": 36.0,
"md.comp.fab.surface.large.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.large.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.large.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.surface.large.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.large.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.large.pressed.icon.color": "primary",
"md.comp.fab.surface.large.pressed.state-layer.color": "primary",
"md.comp.fab.surface.large.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.fab.primary.container.color": "primaryContainer", "md.comp.fab.primary.container.color": "primaryContainer",
"md.comp.fab.primary.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.container.elevation": "md.sys.elevation.level3",
......
{
"version": "v0_76",
"md.comp.fab.secondary.container.color": "secondaryContainer",
"md.comp.fab.secondary.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.container.height": 56.0,
"md.comp.fab.secondary.container.shadow-color": "shadow",
"md.comp.fab.secondary.container.shape": "md.sys.shape.corner.large",
"md.comp.fab.secondary.container.width": 56.0,
"md.comp.fab.secondary.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.focus.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.focus.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.secondary.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.secondary.hover.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.hover.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.secondary.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.icon.size": 24.0,
"md.comp.fab.secondary.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.secondary.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.pressed.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.pressed.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.fab.primary.small.container.color": "primaryContainer", "md.comp.fab.primary.small.container.color": "primaryContainer",
"md.comp.fab.primary.small.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.small.container.elevation": "md.sys.elevation.level3",
......
{
"version": "v0_76",
"md.comp.fab.secondary.small.container.color": "secondaryContainer",
"md.comp.fab.secondary.small.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.small.container.height": 40.0,
"md.comp.fab.secondary.small.container.shadow-color": "shadow",
"md.comp.fab.secondary.small.container.shape": "md.sys.shape.corner.medium",
"md.comp.fab.secondary.small.container.width": 40.0,
"md.comp.fab.secondary.small.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.small.focus.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.focus.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.secondary.small.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.secondary.small.hover.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.hover.state-layer.color": "onSecondary",
"md.comp.fab.secondary.small.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.secondary.small.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.icon.size": 24.0,
"md.comp.fab.secondary.small.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.small.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.small.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.secondary.small.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.secondary.small.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.secondary.small.pressed.icon.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.pressed.state-layer.color": "onSecondaryContainer",
"md.comp.fab.secondary.small.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{
"version": "v0_76",
"md.comp.fab.surface.small.container.color": "surface",
"md.comp.fab.surface.small.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.small.container.height": 40.0,
"md.comp.fab.surface.small.container.shadow-color": "shadow",
"md.comp.fab.surface.small.container.shape": "md.sys.shape.corner.medium",
"md.comp.fab.surface.small.container.surface-tint-layer.color": "surfaceTintColor",
"md.comp.fab.surface.small.container.width": 40.0,
"md.comp.fab.surface.small.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.small.focus.icon.color": "primary",
"md.comp.fab.surface.small.focus.state-layer.color": "primary",
"md.comp.fab.surface.small.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.surface.small.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.surface.small.hover.icon.color": "primary",
"md.comp.fab.surface.small.hover.state-layer.color": "primary",
"md.comp.fab.surface.small.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.surface.small.icon.color": "primary",
"md.comp.fab.surface.small.icon.size": 24.0,
"md.comp.fab.surface.small.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.small.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.small.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.surface.small.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.small.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.small.pressed.icon.color": "primary",
"md.comp.fab.surface.small.pressed.state-layer.color": "primary",
"md.comp.fab.surface.small.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{
"version": "v0_76",
"md.comp.fab.surface.container.color": "surface",
"md.comp.fab.surface.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.container.height": 56.0,
"md.comp.fab.surface.container.shadow-color": "shadow",
"md.comp.fab.surface.container.shape": "md.sys.shape.corner.large",
"md.comp.fab.surface.container.surface-tint-layer.color": "surfaceTintColor",
"md.comp.fab.surface.container.width": 56.0,
"md.comp.fab.surface.focus.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.focus.icon.color": "primary",
"md.comp.fab.surface.focus.state-layer.color": "primary",
"md.comp.fab.surface.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",
"md.comp.fab.surface.hover.container.elevation": "md.sys.elevation.level4",
"md.comp.fab.surface.hover.icon.color": "primary",
"md.comp.fab.surface.hover.state-layer.color": "primary",
"md.comp.fab.surface.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity",
"md.comp.fab.surface.icon.color": "primary",
"md.comp.fab.surface.icon.size": 24.0,
"md.comp.fab.surface.lowered.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.lowered.focus.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.lowered.hover.container.elevation": "md.sys.elevation.level2",
"md.comp.fab.surface.lowered.pressed.container.elevation": "md.sys.elevation.level1",
"md.comp.fab.surface.pressed.container.elevation": "md.sys.elevation.level3",
"md.comp.fab.surface.pressed.icon.color": "primary",
"md.comp.fab.surface.pressed.state-layer.color": "primary",
"md.comp.fab.surface.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity"
}
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.filter-chip.container.height": 32.0, "md.comp.filter-chip.container.height": 32.0,
"md.comp.filter-chip.container.shadow-color": "shadow", "md.comp.filter-chip.container.shadow-color": "shadow",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.input-chip.container.elevation": "md.sys.elevation.level0", "md.comp.input-chip.container.elevation": "md.sys.elevation.level0",
"md.comp.input-chip.container.height": 32.0, "md.comp.input-chip.container.height": 32.0,
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.motion.duration.100Ms": 100.0, "md.sys.motion.duration.100Ms": 100.0,
"md.sys.motion.duration.1000Ms": 1000.0, "md.sys.motion.duration.1000Ms": 1000.0,
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.navigation-bar.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.focus.icon.color": "onSecondaryContainer",
"md.comp.navigation-bar.active.focus.label-text.color": "onSurface", "md.comp.navigation-bar.active.focus.label-text.color": "onSurface",
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"md.comp.navigation-bar.active.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.icon.color": "onSecondaryContainer",
"md.comp.navigation-bar.active-indicator.color": "secondaryContainer", "md.comp.navigation-bar.active-indicator.color": "secondaryContainer",
"md.comp.navigation-bar.active-indicator.height": 32.0, "md.comp.navigation-bar.active-indicator.height": 32.0,
"md.comp.navigation-bar.active-indicator.shape": "md.sys.shape.corner.large", "md.comp.navigation-bar.active-indicator.shape": "md.sys.shape.corner.full",
"md.comp.navigation-bar.active-indicator.width": 64.0, "md.comp.navigation-bar.active-indicator.width": 64.0,
"md.comp.navigation-bar.active.label-text.color": "onSurface", "md.comp.navigation-bar.active.label-text.color": "onSurface",
"md.comp.navigation-bar.active.pressed.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.pressed.icon.color": "onSecondaryContainer",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.ref.palette.black": "0xFF000000", "md.ref.palette.black": "0xFF000000",
"md.ref.palette.error0": "0xFF000000", "md.ref.palette.error0": "0xFF000000",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.shape.corner.extra-large": { "md.sys.shape.corner.extra-large": {
"family": "SHAPE_FAMILY_ROUNDED_CORNERS", "family": "SHAPE_FAMILY_ROUNDED_CORNERS",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.slider.active.track.color": "primary", "md.comp.slider.active.track.color": "primary",
"md.comp.slider.active.track.height": 6.0, "md.comp.slider.active.track.height": 6.0,
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.state.dragged.state-layer-opacity": 0.16, "md.sys.state.dragged.state-layer-opacity": 0.16,
"md.sys.state.focus.state-layer-opacity": 0.12, "md.sys.state.focus.state-layer-opacity": 0.12,
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.suggestion-chip.container.height": 32.0, "md.comp.suggestion-chip.container.height": 32.0,
"md.comp.suggestion-chip.container.shape": "md.sys.shape.corner.small", "md.comp.suggestion-chip.container.shape": "md.sys.shape.corner.small",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.sys.typescale.body-large.font": "md.ref.typeface.plain", "md.sys.typescale.body-large.font": "md.ref.typeface.plain",
"md.sys.typescale.body-large.line-height": 24.0, "md.sys.typescale.body-large.line-height": 24.0,
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.top-app-bar.large.container.color": "surface", "md.comp.top-app-bar.large.container.color": "surface",
"md.comp.top-app-bar.large.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.large.container.elevation": "md.sys.elevation.level0",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.top-app-bar.medium.container.color": "surface", "md.comp.top-app-bar.medium.container.color": "surface",
"md.comp.top-app-bar.medium.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.medium.container.elevation": "md.sys.elevation.level0",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.comp.top-app-bar.small.container.color": "surface", "md.comp.top-app-bar.small.container.color": "surface",
"md.comp.top-app-bar.small.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.small.container.elevation": "md.sys.elevation.level0",
......
{ {
"version": "v0_76", "version": "v0_81",
"md.ref.typeface.brand": "Roboto", "md.ref.typeface.brand": "Roboto",
"md.ref.typeface.plain": "Roboto", "md.ref.typeface.plain": "Roboto",
......
...@@ -15,10 +15,10 @@ class _M3Defaults extends FloatingActionButtonThemeData { ...@@ -15,10 +15,10 @@ class _M3Defaults extends FloatingActionButtonThemeData {
: _colors = Theme.of(context).colorScheme, : _colors = Theme.of(context).colorScheme,
_textTheme = Theme.of(context).textTheme, _textTheme = Theme.of(context).textTheme,
super( super(
elevation: ${elevation("md.comp.fab.primary.container.elevation")}, elevation: ${elevation("md.comp.fab.primary.container")},
focusElevation: ${elevation("md.comp.fab.primary.focus.container.elevation")}, focusElevation: ${elevation("md.comp.fab.primary.focus.container")},
hoverElevation: ${elevation("md.comp.fab.primary.hover.container.elevation")}, hoverElevation: ${elevation("md.comp.fab.primary.hover.container")},
highlightElevation: ${elevation("md.comp.fab.primary.pressed.container.elevation")}, highlightElevation: ${elevation("md.comp.fab.primary.pressed.container")},
enableFeedback: true, enableFeedback: true,
sizeConstraints: const BoxConstraints.tightFor( sizeConstraints: const BoxConstraints.tightFor(
width: ${tokens["md.comp.fab.primary.container.width"]}, width: ${tokens["md.comp.fab.primary.container.width"]},
...@@ -56,13 +56,13 @@ class _M3Defaults extends FloatingActionButtonThemeData { ...@@ -56,13 +56,13 @@ class _M3Defaults extends FloatingActionButtonThemeData {
ShapeBorder? get shape { ShapeBorder? get shape {
switch (type) { switch (type) {
case _FloatingActionButtonType.regular: case _FloatingActionButtonType.regular:
return ${shape("md.comp.fab.primary.container.shape")}; return ${shape("md.comp.fab.primary.container")};
case _FloatingActionButtonType.small: case _FloatingActionButtonType.small:
return ${shape("md.comp.fab.primary.small.container.shape")}; return ${shape("md.comp.fab.primary.small.container")};
case _FloatingActionButtonType.large: case _FloatingActionButtonType.large:
return ${shape("md.comp.fab.primary.large.container.shape")}; return ${shape("md.comp.fab.primary.large.container")};
case _FloatingActionButtonType.extended: case _FloatingActionButtonType.extended:
return ${shape("md.comp.extended-fab.primary.container.shape")}; return ${shape("md.comp.extended-fab.primary.container")};
} }
} }
......
...@@ -54,9 +54,13 @@ abstract class TokenTemplate { ...@@ -54,9 +54,13 @@ abstract class TokenTemplate {
/// bottom of the file. /// bottom of the file.
String generate(); String generate();
String color(String tokenName) { /// Generate a [ColorScheme] color name for the given component token.
final String tokenColor = '$tokenName.color'; ///
final String tokenOpacity = '$tokenName.opacity'; /// If there is an opacity specified for the given component, it will
/// apply that opacity to the component's color.
String color(String componentToken) {
final String tokenColor = '$componentToken.color';
final String tokenOpacity = '$componentToken.opacity';
String value = '${tokens[tokenColor]!}'; String value = '${tokens[tokenColor]!}';
if (tokens.containsKey(tokenOpacity)) { if (tokens.containsKey(tokenOpacity)) {
final String opacity = tokens[tokens[tokenOpacity]!]!.toString(); final String opacity = tokens[tokens[tokenOpacity]!]!.toString();
...@@ -65,13 +69,18 @@ abstract class TokenTemplate { ...@@ -65,13 +69,18 @@ abstract class TokenTemplate {
return value; return value;
} }
String elevation(String tokenName) { /// Generate an elevation value for the given component token.
return tokens[tokens[tokenName]!]!.toString(); String elevation(String componentToken) {
return tokens[tokens['$componentToken.elevation']!]!.toString();
} }
String shape(String tokenName) { /// Generate a shape constant for the given component token.
///
/// Currently only supports "SHAPE_FAMILY_ROUNDED_CORNERS" which it
/// maps to a [RoundedRectangleBorder] expression.
String shape(String componentToken) {
// TODO(darrenaustin): handle more than just rounded rectangle shapes // TODO(darrenaustin): handle more than just rounded rectangle shapes
final Map<String, dynamic> shape = tokens[tokens[tokenName]!]! as Map<String, dynamic>; final Map<String, dynamic> shape = tokens[tokens['$componentToken.shape']!]! as Map<String, dynamic>;
return 'const RoundedRectangleBorder(borderRadius: ' return 'const RoundedRectangleBorder(borderRadius: '
'BorderRadius.only(' 'BorderRadius.only('
'topLeft: Radius.circular(${shape['topLeft']}), ' 'topLeft: Radius.circular(${shape['topLeft']}), '
...@@ -80,12 +89,8 @@ abstract class TokenTemplate { ...@@ -80,12 +89,8 @@ abstract class TokenTemplate {
'bottomRight: Radius.circular(${shape['bottomRight']})))'; 'bottomRight: Radius.circular(${shape['bottomRight']})))';
} }
String value(String tokenName) { /// Generate a [TextTheme] text style name for the given component token.
final Map<String, dynamic> value = tokens[tokenName]! as Map<String, dynamic>; String textStyle(String componentToken) {
return value['value'].toString(); return tokens['$componentToken.text-style']!.toString();
}
String textStyle(String tokenName) {
return tokens['$tokenName.text-style']!.toString();
} }
} }
...@@ -110,7 +110,7 @@ static final String tokenBar = 'bar'; ...@@ -110,7 +110,7 @@ static final String tokenBar = 'bar';
} }
}; };
final TestTemplate template = TestTemplate('foobar.dart', tokens); final TestTemplate template = TestTemplate('foobar.dart', tokens);
expect(template.shape('foo.shape'), 'const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(1.0), topRight: Radius.circular(2.0), bottomLeft: Radius.circular(3.0), bottomRight: Radius.circular(4.0)))'); expect(template.shape('foo'), 'const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(1.0), topRight: Radius.circular(2.0), bottomLeft: Radius.circular(3.0), bottomRight: Radius.circular(4.0)))');
}); });
} }
......
...@@ -773,7 +773,7 @@ class _M2Defaults extends FloatingActionButtonThemeData { ...@@ -773,7 +773,7 @@ class _M2Defaults extends FloatingActionButtonThemeData {
// These defaults are generated from the Material Design Token // These defaults are generated from the Material Design Token
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart. // database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// Generated version v0_76 // Generated version v0_81
class _M3Defaults extends FloatingActionButtonThemeData { class _M3Defaults extends FloatingActionButtonThemeData {
_M3Defaults(this.context, this.type, this.hasChild) _M3Defaults(this.context, this.type, this.hasChild)
: _colors = Theme.of(context).colorScheme, : _colors = Theme.of(context).colorScheme,
......
...@@ -731,7 +731,7 @@ class Typography with Diagnosticable { ...@@ -731,7 +731,7 @@ class Typography with Diagnosticable {
// These defaults are generated from the Material Design Token // These defaults are generated from the Material Design Token
// database by the script dev/tools/gen_defaults/bin/gen_defaults.dart. // database by the script dev/tools/gen_defaults/bin/gen_defaults.dart.
// Generated version v0_76 // Generated version v0_81
class _M3Typography { class _M3Typography {
_M3Typography._(); _M3Typography._();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment