Skip to content

Commit

Permalink
Standardize icons on Material Symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Feb 8, 2024
1 parent 6e0e6b9 commit b22be04
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/_11ty/plugins/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function _registerAside(markdown, id, defaultTitle, icon, style) {
const title = parsedArgs?.[1] ?? defaultTitle;
return `<aside class="alert ${style}">
<div class="alert-header">
${icon !== null ? `<i class="material-icons" aria-hidden="true">${icon}</i>` : ''}
${icon !== null ? `<i class="material-symbols" aria-hidden="true">${icon}</i>` : ''}
<span>${title ?? ''}</span>
</div>
<div class="alert-content">
Expand All @@ -77,7 +77,7 @@ function _registerAsides(markdown) {
markdown,
'flutter-note',
'Flutter note',
'smartphone',
'flutter',
'alert-info',
);
_registerAside(
Expand All @@ -87,13 +87,13 @@ function _registerAsides(markdown) {
'merge_type',
'alert-info',
);
_registerAside(markdown, 'tip', 'Tip', 'tips_and_updates', 'alert-success');
_registerAside(markdown, 'tip', 'Tip', 'lightbulb', 'alert-success');
_registerAside(markdown, 'important', 'Important', 'error', 'alert-warning');
_registerAside(
markdown,
'warning',
'Warning',
'report_problem',
'warning',
'alert-warning',
);

Expand Down
2 changes: 1 addition & 1 deletion src/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Display:wght@400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Google+Sans+Text:wght@400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet" />

<link rel="stylesheet" href="{{ '/assets/css/main.css' | append: cache_bust }}">
{% if css -%}
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/navigation-main.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% assign page_url_path = page.url | regex_replace: '/index$|/index\.html$|\.html$|/$' | prepend: '/*' | append: '/' -%}

<nav id="mainnav" class="site-header">
<div id="menu-toggle"><i class="material-icons">menu</i></div>
<div id="menu-toggle"><i class="material-symbols">menu</i></div>
<a href="/" class="brand" title="{{site.title}}">
<img src="/assets/img/logo/logo-white-text.svg" alt="{{site.title}}">
</a>
Expand Down
6 changes: 3 additions & 3 deletions src/_includes/navigation-toc-top.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<header class="site-toc__title">
Contents
{% if collapsible %}
<span class="site-toc--inline__toggle toc-toggle-down"><i class="material-icons">keyboard_arrow_down</i></span>
<span class="site-toc--inline__toggle toc-toggle-up"><i class="material-icons">keyboard_arrow_up</i></span>
<span class="site-toc--inline__toggle toc-toggle-down"><i class="material-symbols">keyboard_arrow_down</i></span>
<span class="site-toc--inline__toggle toc-toggle-up"><i class="material-symbols">keyboard_arrow_up</i></span>
{% endif -%}
</header>
<ul class="section-nav">
Expand All @@ -34,7 +34,7 @@
{% endfor -%}
</ul>
{% if collapsible %}
<span class="site-toc--inline__toggle toc-toggle-more-items"><i class="material-icons">more_horiz</i></span>
<span class="site-toc--inline__toggle toc-toggle-more-items"><i class="material-symbols">more_horiz</i></span>
{% endif -%}
</div>
{% endif -%}
6 changes: 3 additions & 3 deletions src/_includes/page-github-links.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% comment %}
This include file requires the material icons fonts.
This include file requires the material symbols font.
Style the button pair using the `#page-github-links` selector.
{% endcomment -%}

Expand All @@ -12,10 +12,10 @@

<div id="page-github-links" class="btn-group" aria-label="Page GitHub links" role="group">
<a href="{{path}}" class="btn" title="View page source" target="_blank" rel="noopener">
<i class="material-icons">description</i>
<i class="material-symbols">description</i>
</a>
<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"
target="_blank" rel="noopener">
<i class="material-icons">bug_report</i>
<i class="material-symbols">bug_report</i>
</a>
</div>
22 changes: 19 additions & 3 deletions src/_sass/_site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ thead:has(th:empty) {
margin-top: 0.5rem;
}

i.material-icons {
i.material-symbols {
font-size: 1.25em;
user-select: none;
}
Expand Down Expand Up @@ -573,8 +573,24 @@ thead:has(th:empty) {
}
}

.material-symbols {
font-family: $site-font-family-icon;
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

/* Used for inlined icon markers, usually at the start of a paragraph */
.content > p > i.material-icons {
.content > p > i.material-symbols {
vertical-align: bottom;
}

Expand Down Expand Up @@ -639,7 +655,7 @@ ul.nav-list {
}
}

.material-icons {
.material-symbols {
font-size: 18px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/_sass/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
margin-right: bootstrap.bs-spacer(4);
padding: 0;

.material-icons {
.material-symbols {
font-size: 28px;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/_sass/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
content: 'keyboard_arrow_down';
font: $site-font-icon;
transition: transform .25s ease-in-out;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

&:not(.collapsed) {
Expand Down
2 changes: 1 addition & 1 deletion src/_sass/core/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ $site-font-family-gsans: 'Google Sans', 'Roboto', sans-serif;
$site-font-family-gsans-display: 'Google Sans Display', 'Google Sans', 'Roboto', sans-serif;
$site-font-family-base: 'Google Sans Text', 'Roboto', sans-serif;
$site-font-family-alt: $site-font-family-gsans;
$site-font-family-icon: 'Material Icons';
$site-font-family-icon: 'Material Symbols Outlined';
$site-font-family-monospace: 'Google Sans Mono', 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Consolas, monospace;
$site-font-icon: 24px/1 $site-font-family-icon;

Expand Down
2 changes: 1 addition & 1 deletion src/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
<div class="callout-button">
<button class="btn btn-link btn-icon" type="button" data-toggle="modal" data-target="#videoModal" data-video="5F-6n_2XWR8">
<i class="material-icons">play_circle_filled</i> Watch video
<i class="material-symbols">play_circle</i> Watch video
</button>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ short-title: FAQ
description: You have questions about Dart, we have answers.
---

{% assign pdf = '<i style="vertical-align: text-top" class="material-icons">picture_as_pdf</i>' %}
{% assign pdf = '<i style="vertical-align: text-top" class="material-symbols">picture_as_pdf</i>' %}
{% assign site-repo = site.gh-dart.site %}
{% assign sdk-repo = site.gh-dart.sdk %}
{% assign lang-repo = site.gh-dart.lang %}
Expand Down
4 changes: 2 additions & 2 deletions src/content/tools/dart-devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ and interact with tools such as IDEs, `dart run`, and `webdev`.
The following table shows which tools
you can use with common Dart app types.

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

| Tool | [Flutter mobile or desktop][Flutter devtools] | [Flutter web][Flutter devtools] | [Other web][] | [Command-line][] |
Expand Down
12 changes: 6 additions & 6 deletions src/content/web/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Then follow the steps below to create a small web app with Dart.

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

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

```console
$ dart pub global activate webdev
```

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

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

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

```console
$ dart create -t web quickstart
```

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

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

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

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

Expand All @@ -58,7 +58,7 @@ $ cd quickstart
$ webdev serve
```

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

To view your app, use the Chrome browser
Expand Down

0 comments on commit b22be04

Please sign in to comment.