Skip to content

Commit 00431ed

Browse files
parloughTony Sansone
authored and
Tony Sansone
committed
Standardize icons on Material Symbols (dart-lang#5518)
Corresponds to flutter/website#10105 Fixes dart-lang#4278
1 parent 26068e5 commit 00431ed

13 files changed

+45
-27
lines changed

src/_11ty/plugins/markdown.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function _registerAside(markdown, id, defaultTitle, icon, style) {
5353
const title = parsedArgs?.[1] ?? defaultTitle;
5454
return `<aside class="alert ${style}">
5555
<div class="alert-header">
56-
${icon !== null ? `<i class="material-icons" aria-hidden="true">${icon}</i>` : ''}
56+
${icon !== null ? `<i class="material-symbols" aria-hidden="true">${icon}</i>` : ''}
5757
<span>${title ?? ''}</span>
5858
</div>
5959
<div class="alert-content">
@@ -77,7 +77,7 @@ function _registerAsides(markdown) {
7777
markdown,
7878
'flutter-note',
7979
'Flutter note',
80-
'smartphone',
80+
'flutter',
8181
'alert-info',
8282
);
8383
_registerAside(
@@ -87,13 +87,13 @@ function _registerAsides(markdown) {
8787
'merge_type',
8888
'alert-info',
8989
);
90-
_registerAside(markdown, 'tip', 'Tip', 'tips_and_updates', 'alert-success');
90+
_registerAside(markdown, 'tip', 'Tip', 'lightbulb', 'alert-success');
9191
_registerAside(markdown, 'important', 'Important', 'error', 'alert-warning');
9292
_registerAside(
9393
markdown,
9494
'warning',
9595
'Warning',
96-
'report_problem',
96+
'warning',
9797
'alert-warning',
9898
);
9999

src/_includes/head.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Display:wght@400&display=swap" rel="stylesheet">
6666
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Mono:wght@400;500;700&display=swap" rel="stylesheet">
6767
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Text:wght@400;500;700&display=swap" rel="stylesheet">
68-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" rel="stylesheet">
68+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet" />
6969

7070
<link rel="stylesheet" href="{{ '/assets/css/main.css' | append: cache_bust }}">
7171
{% if css -%}

src/_includes/navigation-main.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% assign page_url_path = page.url | regex_replace: '/index$|/index\.html$|\.html$|/$' | prepend: '/*' | append: '/' -%}
22

33
<nav id="mainnav" class="site-header">
4-
<div id="menu-toggle"><i class="material-icons">menu</i></div>
4+
<div id="menu-toggle"><i class="material-symbols">menu</i></div>
55
<a href="/" class="brand" title="{{site.title}}">
66
<img src="/assets/img/logo/logo-white-text.svg" alt="{{site.title}}">
77
</a>

src/_includes/navigation-toc-top.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<header class="site-toc__title">
1414
Contents
1515
{% if collapsible %}
16-
<span class="site-toc--inline__toggle toc-toggle-down"><i class="material-icons">keyboard_arrow_down</i></span>
17-
<span class="site-toc--inline__toggle toc-toggle-up"><i class="material-icons">keyboard_arrow_up</i></span>
16+
<span class="site-toc--inline__toggle toc-toggle-down"><i class="material-symbols">keyboard_arrow_down</i></span>
17+
<span class="site-toc--inline__toggle toc-toggle-up"><i class="material-symbols">keyboard_arrow_up</i></span>
1818
{% endif -%}
1919
</header>
2020
<ul class="section-nav">
@@ -34,7 +34,7 @@
3434
{% endfor -%}
3535
</ul>
3636
{% if collapsible %}
37-
<span class="site-toc--inline__toggle toc-toggle-more-items"><i class="material-icons">more_horiz</i></span>
37+
<span class="site-toc--inline__toggle toc-toggle-more-items"><i class="material-symbols">more_horiz</i></span>
3838
{% endif -%}
3939
</div>
4040
{% endif -%}

src/_includes/page-github-links.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% comment %}
2-
This include file requires the material icons fonts.
2+
This include file requires the material symbols font.
33
Style the button pair using the `#page-github-links` selector.
44
{% endcomment -%}
55

@@ -12,10 +12,10 @@
1212

1313
<div id="page-github-links" class="btn-group" aria-label="Page GitHub links" role="group">
1414
<a href="{{path}}" class="btn" title="View page source" target="_blank" rel="noopener">
15-
<i class="material-icons">description</i>
15+
<i class="material-symbols">description</i>
1616
</a>
1717
<a href="{{repo}}/issues/new?template=1_page_issue.yml&{{issueTitle}}&page-url={{url}}&page-source={{path}}" class="btn" title="Report an issue with this page"
1818
target="_blank" rel="noopener">
19-
<i class="material-icons">bug_report</i>
19+
<i class="material-symbols">bug_report</i>
2020
</a>
2121
</div>

src/_sass/_site.scss

+19-3
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ thead:has(th:empty) {
528528
margin-top: 0.5rem;
529529
}
530530

531-
i.material-icons {
531+
i.material-symbols {
532532
font-size: 1.25em;
533533
user-select: none;
534534
}
@@ -573,8 +573,24 @@ thead:has(th:empty) {
573573
}
574574
}
575575

576+
.material-symbols {
577+
font-family: $site-font-family-icon;
578+
font-weight: normal;
579+
font-style: normal;
580+
font-size: 24px;
581+
line-height: 1;
582+
letter-spacing: normal;
583+
text-transform: none;
584+
display: inline-block;
585+
white-space: nowrap;
586+
word-wrap: normal;
587+
direction: ltr;
588+
-webkit-font-feature-settings: 'liga';
589+
-webkit-font-smoothing: antialiased;
590+
}
591+
576592
/* Used for inlined icon markers, usually at the start of a paragraph */
577-
.content > p > i.material-icons {
593+
.content > p > i.material-symbols {
578594
vertical-align: bottom;
579595
}
580596

@@ -639,7 +655,7 @@ ul.nav-list {
639655
}
640656
}
641657

642-
.material-icons {
658+
.material-symbols {
643659
font-size: 18px;
644660
}
645661
}

src/_sass/components/_header.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
margin-right: bootstrap.bs-spacer(4);
2323
padding: 0;
2424

25-
.material-icons {
25+
.material-symbols {
2626
font-size: 28px;
2727
}
2828
}

src/_sass/components/_sidebar.scss

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
content: 'keyboard_arrow_down';
4444
font: $site-font-icon;
4545
transition: transform .25s ease-in-out;
46+
-webkit-font-feature-settings: 'liga';
47+
-webkit-font-smoothing: antialiased;
4648
}
4749

4850
&:not(.collapsed) {

src/_sass/core/_variables.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $site-font-family-gsans: 'Google Sans', 'Roboto', sans-serif;
8181
$site-font-family-gsans-display: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
8282
$site-font-family-base: 'Google Sans Text', 'Roboto', sans-serif;
8383
$site-font-family-alt: $site-font-family-gsans;
84-
$site-font-family-icon: 'Material Icons';
84+
$site-font-family-icon: 'Material Symbols Outlined';
8585
$site-font-family-monospace: 'Google Sans Mono', 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace;
8686
$site-font-icon: 24px/1 $site-font-family-icon;
8787

src/content/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</div>
3333
<div class="callout-button">
3434
<button class="btn btn-link btn-icon" type="button" data-toggle="modal" data-target="#videoModal" data-video="5F-6n_2XWR8">
35-
<i class="material-icons">play_circle_filled</i> Watch video
35+
<i class="material-symbols">play_circle</i> Watch video
3636
</button>
3737
</div>
3838

src/content/resources/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ short-title: FAQ
44
description: You have questions about Dart, we have answers.
55
---
66

7-
{% assign pdf = '<i style="vertical-align: text-top" class="material-icons">picture_as_pdf</i>' %}
7+
{% assign pdf = '<i style="vertical-align: text-top" class="material-symbols">picture_as_pdf</i>' %}
88
{% assign site-repo = site.gh-dart.site %}
99
{% assign sdk-repo = site.gh-dart.sdk %}
1010
{% assign lang-repo = site.gh-dart.lang %}

src/content/tools/dart-devtools.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ and interact with tools such as IDEs, `dart run`, and `webdev`.
1313
The following table shows which tools
1414
you can use with common Dart app types.
1515

16-
{% assign y = '<span class="material-icons user-select-none" title="Supported" aria-label="Supported">done</span>' %}
16+
{% assign y = '<span class="material-symbols user-select-none" title="Supported" aria-label="Supported">done</span>' %}
1717
{% assign b = '&nbsp;' %}
1818
{% assign na = '&nbsp;' %}
1919
{% comment %}
2020
Considered using this instead:
21-
assign b = '<span class="material-icons" title="use browser tools instead">web</span>'
21+
assign b = '<span class="material-symbols" title="use browser tools instead">web</span>'
2222
{% endcomment %}
2323

2424
| Tool | [Flutter mobile or desktop][Flutter devtools] | [Flutter web][Flutter devtools] | [Other web][] | [Command-line][] |

src/content/web/get-started.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ Then follow the steps below to create a small web app with Dart.
1717

1818
## 2. Get CLI tools or an IDE (or both) {:#tools}
1919

20-
<i class="material-icons">terminal</i>
20+
<i class="material-symbols">terminal</i>
2121
If you like to use the command line, install the [`webdev`][] package:
2222

2323
```console
2424
$ dart pub global activate webdev
2525
```
2626

27-
<i class="material-icons">web</i>
27+
<i class="material-symbols">web</i>
2828
Although using an IDE is optional, we highly recommend using one.
2929
For a list of available IDEs, see the
3030
[overview of editors & debuggers][].
@@ -33,23 +33,23 @@ For a list of available IDEs, see the
3333

3434
## 3. Create a web app {:#create}
3535

36-
<i class="material-icons">terminal</i>
36+
<i class="material-symbols">terminal</i>
3737
To create a web app from the command line,
3838
use the [`dart create`][] command with the `web` template:
3939

4040
```console
4141
$ dart create -t web quickstart
4242
```
4343

44-
<i class="material-icons">web</i>
44+
<i class="material-symbols">web</i>
4545
To create the same web app from an IDE that has Dart integration,
4646
create a project using the template named **Bare-bones Web App**.
4747

4848
[`dart create`]: /tools/dart-create
4949

5050
## 4. Run the app {:#run}
5151

52-
<i class="material-icons">terminal</i>
52+
<i class="material-symbols">terminal</i>
5353
To run the app from the command line,
5454
use [`webdev`][] to build and serve the app:
5555

@@ -58,7 +58,7 @@ $ cd quickstart
5858
$ webdev serve
5959
```
6060

61-
<i class="material-icons">web</i>
61+
<i class="material-symbols">web</i>
6262
Or run the app from your IDE.
6363

6464
To view your app, use the Chrome browser

0 commit comments

Comments
 (0)