[material_ui] Import of Material tokens v38.0.58#12234
Conversation
FolderOrigin-RevId: /google/src/cloud/elliottbrooks/resolved-typescale/google3/javascript/materialdesign/tokens/compiler/formats/flutter/staging_output
There was a problem hiding this comment.
Code Review
This pull request updates the Material UI default token generation data by upgrading the schema version and refactoring numerous token classes to reference centralized typescale definitions rather than inline TypescaleStruct declarations. Feedback on the changes highlights a compilation error in banners_rich.dart due to a missing import and an incorrect reference to TokenTypescaleEmphasized, as well as an inconsistent typescale mapping in slider.dart where tracking and weight properties do not match the other label properties.
|
|
||
| import 'shape_struct.dart'; | ||
| import 'typescale_struct.dart'; | ||
| import 'typescale.dart'; |
| static const TypescaleStruct titleTextType = | ||
| TokenTypescale.emphasizedBodyMedium; |
There was a problem hiding this comment.
emphasizedBodyMedium is defined in TokenTypescaleEmphasized (from typescale_emphasized.dart), not TokenTypescale. Referencing it on TokenTypescale will cause a compilation error.
| static const TypescaleStruct titleTextType = | |
| TokenTypescale.emphasizedBodyMedium; | |
| static const TypescaleStruct titleTextType = | |
| TokenTypescaleEmphasized.emphasizedBodyMedium; |
| static const double valueIndicatorLabelLabelTextTracking = | ||
| TokenTypescale.bodyLarge.letterSpacing; | ||
|
|
||
| /// md.comp.slider.value-indicator.label.label-text.weight | ||
| static const double valueIndicatorLabelLabelTextWeight = | ||
| TokenTypescale.bodyLarge.fontWeight; |
There was a problem hiding this comment.
There is a mismatch in the typescale mapping for the value indicator label text. The font, line-height, and size properties are mapped to TokenTypescale.labelLarge, but the tracking and weight properties are mapped to TokenTypescale.bodyLarge. They should consistently use TokenTypescale.labelLarge to avoid unexpected styling issues.
| static const double valueIndicatorLabelLabelTextTracking = | |
| TokenTypescale.bodyLarge.letterSpacing; | |
| /// md.comp.slider.value-indicator.label.label-text.weight | |
| static const double valueIndicatorLabelLabelTextWeight = | |
| TokenTypescale.bodyLarge.fontWeight; | |
| static const double valueIndicatorLabelLabelTextTracking = | |
| TokenTypescale.labelLarge.letterSpacing; | |
| /// md.comp.slider.value-indicator.label.label-text.weight | |
| static const double valueIndicatorLabelLabelTextWeight = | |
| TokenTypescale.labelLarge.fontWeight; |

Import of tokens (see cl/944170221)
Pre-Review Checklist
[shared_preferences]///).Test exemption: Import of generated code.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2