Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the site's icon system from using external Material Symbols icon fonts to rendering inline SVGs. It introduces a new update-icons command to download SVGs and generate a Dart file containing the SVG path data, updates the MaterialIcon and Icon components to use these inline SVGs, and removes the external font references and associated SASS styles. The review feedback highlights two critical compile-time issues in the icon generation script: literal newlines in SVG path data causing syntax errors in the generated file, and an invalid raw string literal r'\' that fails to compile in Dart.
|
Staged preview of the updated docs.flutter.dev site (updated for commit e59e854): https://flutter-docs-prod--docs-pr14150-feat-svg-material-symb-ve3a9a03.web.app |
|
Only real visible change: The icon for "Smooth Experiences" here https://flutter.dev/why-flutter#design-fidelity changed since it was only existing in the legacy material icons set (which the font included), not the new material symbols set (which we now use exclusively). Changed it to "animation" which seems to best fit the text. @abdallahshaban557 |
|
Staged preview of the updated flutter.dev site (updated for commit e59e854): https://flutter-dev-230821--www-pr14150-feat-svg-material-symb-x815s7p8.web.app |
abdallahshaban557
left a comment
There was a problem hiding this comment.
thanks for doing that @schultek - I am approving this!
a993b05 to
88ce844
Compare
…14120) - Add `update-icons` command to `dash_site` to download Material Symbols Outlined SVGs into a temporary directory and generate Dart path data - Prerender Material Symbols as inline SVGs in `MaterialIcon`, `Icon`, and Markdown alerts - Remove Material Symbols font stylesheets from docs and www layouts - Add unit tests for SVG icon path resolution and component rendering
- Remove font-based SCSS styles (font-family, font-variation-settings, ligatures) - Remove unused font-based classes and attributes (ms-filled, notranslate, translate='no') - Support --weight in `update-icons` (defaulting to 500 to match the optical size 24 font weight) - Convert expansion-list collapse arrow from CSS font ligature to MaterialIcon
88ce844 to
6070b39
Compare
|
@parlough Fyi this needs re-approval to be mergeable. |
Replaces the Material Symbols icon font with inline SVG icons across both
docsandwwwsites to eliminate the external icon font download and layout shift:dart run dash_site update-iconscommand intool/dash_siteto fetch Material Symbols SVGs (weight 600, outline and filled variants) and generatepackages/site_shared/lib/src/material_symbols_data.dart. (Only for pulling in updated icons, rarely needed)MaterialIcon(site_shared) andIcon(www) to render inline<svg>elements inside<span class="icon">..iconclass using--icon-sizeCSS custom property for sizing.packages/site_shared/test/material_icon_test.dart.Issues fixed by this PR (if any):
Contributes to #14120
PRs or commits this PR depends on (if any):
None
Presubmit checklist
of 80 characters or fewer.