mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 11:37:27 +01:00
Local Material Icons (#703)
Remove external dependence on fonts.googleapis.com by vendoring MDI fonts and CSS.
This commit is contained in:
parent
a0b3d861fe
commit
15b87af8ed
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.eot
Normal file
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.eot
Normal file
Binary file not shown.
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.ttf
Normal file
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.ttf
Normal file
Binary file not shown.
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.woff
Normal file
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.woff
Normal file
Binary file not shown.
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.woff2
Normal file
BIN
esphome/dashboard/static/fonts/MaterialIcons-Regular.woff2
Normal file
Binary file not shown.
12
esphome/dashboard/static/fonts/README.md
Normal file
12
esphome/dashboard/static/fonts/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
The recommended way to use the Material Icons font is by linking to the web font hosted on Google Fonts:
|
||||
|
||||
```html
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
|
||||
rel="stylesheet">
|
||||
```
|
||||
|
||||
Read more in our full usage guide:
|
||||
http://google.github.io/material-design-icons/#icon-font-for-the-web
|
||||
|
||||
Source:
|
||||
https://github.com/google/material-design-icons
|
36
esphome/dashboard/static/fonts/material-icons.css
Normal file
36
esphome/dashboard/static/fonts/material-icons.css
Normal file
@ -0,0 +1,36 @@
|
||||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
|
||||
src: local('Material Icons'),
|
||||
local('MaterialIcons-Regular'),
|
||||
url(MaterialIcons-Regular.woff2) format('woff2'),
|
||||
url(MaterialIcons-Regular.woff) format('woff'),
|
||||
url(MaterialIcons-Regular.ttf) format('truetype');
|
||||
}
|
||||
|
||||
.material-icons {
|
||||
font-family: 'Material Icons';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 24px; /* Preferred icon size */
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
text-transform: none;
|
||||
letter-spacing: normal;
|
||||
word-wrap: normal;
|
||||
white-space: nowrap;
|
||||
direction: ltr;
|
||||
|
||||
/* Support for all WebKit browsers. */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
/* Support for Safari and Chrome. */
|
||||
text-rendering: optimizeLegibility;
|
||||
|
||||
/* Support for Firefox. */
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Support for IE. */
|
||||
font-feature-settings: 'liga';
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ESPHome Dashboard</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('fonts/material-icons.css') }}">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('materialize.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('materialize-stepper.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('esphome.css') }}">
|
||||
|
@ -3,9 +3,9 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ESPHome Dashboard</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('fonts/material-icons.css') }}">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('materialize.min.css') }}">
|
||||
<link href="{{ get_static_file_url('esphome.css') }}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ get_static_file_url('esphome.css') }}">
|
||||
<link rel="shortcut icon" href="{{ get_static_file_url('favicon.ico') }}">
|
||||
|
||||
<script src="{{ get_static_file_url('materialize.min.js') }}"></script>
|
||||
|
@ -32,9 +32,10 @@ files = list(filter(os.path.exists, files))
|
||||
files.sort()
|
||||
|
||||
file_types = ('.h', '.c', '.cpp', '.tcc', '.yaml', '.yml', '.ini', '.txt', '.ico', '.svg',
|
||||
'.py', '.html', '.js', '.md', '.sh', '.css', '.proto', '.conf', '.cfg')
|
||||
'.py', '.html', '.js', '.md', '.sh', '.css', '.proto', '.conf', '.cfg',
|
||||
'.eot', '.ttf', '.woff', '.woff2')
|
||||
cpp_include = ('*.h', '*.c', '*.cpp', '*.tcc')
|
||||
ignore_types = ('.ico',)
|
||||
ignore_types = ('.ico', '.eot', '.ttf', '.woff', '.woff2')
|
||||
|
||||
LINT_FILE_CHECKS = []
|
||||
LINT_CONTENT_CHECKS = []
|
||||
@ -231,7 +232,7 @@ def add_errors(fname, errs):
|
||||
for fname in files:
|
||||
_, ext = os.path.splitext(fname)
|
||||
run_checks(LINT_FILE_CHECKS, fname, fname)
|
||||
if ext in ('.ico',):
|
||||
if ext in ignore_types:
|
||||
continue
|
||||
try:
|
||||
with codecs.open(fname, 'r', encoding='utf-8') as f_handle:
|
||||
|
Loading…
Reference in New Issue
Block a user