Skip to content

Commit

Permalink
[BasicUI] Upgrade to last version of Material icons (#2016)
Browse files Browse the repository at this point in the history
Move from the outdated official NPM module (material-design-icons) to an
alternative NPM module (material-icons) providing most recent material
icons.

As a consequence, TTF format is no more provided, only WOFF and WOFF2
formats. All current browsers support WOFF format, so only very old
browsers could be impacted by the miss of the TTF format.

Also fix icon size in condensed mode (28x28).

Fixes #2011
Fixes #2015

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo authored Aug 16, 2023
1 parent 391f0fd commit 7f2dbb3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 28 deletions.
3 changes: 1 addition & 2 deletions bundles/org.openhab.ui.basic/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

var paths = {
FontLibs: [
'./node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff*',
'./node_modules/material-design-icons/iconfont/MaterialIcons-Regular.ttf',
'./node_modules/material-icons/iconfont/material-icons.woff*',
'./node_modules/framework7-icons/fonts/Framework7Icons-Regular.woff*',
'./node_modules/framework7-icons/fonts/Framework7Icons-Regular.ttf'
]
Expand Down
18 changes: 9 additions & 9 deletions bundles/org.openhab.ui.basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundles/org.openhab.ui.basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"gulp-eslint": "^6.0.0",
"gulp-sass": "^5.0.0",
"gulp-uglify": "^3.0.2",
"material-design-icons": "^3.0.1",
"material-icons": "^1.13.9",
"framework7-icons": "^5.0.5",
"node-sass": "^8.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<spam class="f7-icons">%icon_name%</spam>
<span class="f7-icons">%icon_name%</span>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<spam class="material-icons md-oh">%icon_name%</spam>
<span class="material-icons">%icon_name%</span>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
font-weight: 400;
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(fonts/MaterialIcons-Regular.woff) format('woff'),
url(fonts/MaterialIcons-Regular.ttf) format('truetype');
url(fonts/material-icons.woff2) format('woff2'),
url(fonts/material-icons.woff) format('woff');
}

.material-icons {
Expand All @@ -21,6 +20,8 @@
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
Expand All @@ -33,14 +34,3 @@
/* Support for IE. */
font-feature-settings: 'liga';
}

.material-icons.md-oh {
font-size: 32px;
vertical-align: middle;
html:not(.ui-icons-enabled) & {
display: none;
}
html.ui-layout-condensed & {
font-size: 28px;
}
}
1 change: 1 addition & 0 deletions bundles/org.openhab.ui.basic/web-src/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
font-size: 28px;
}
}
.material-icons,
.f7-icons {
font-size: 32px;
vertical-align: middle;
Expand Down

0 comments on commit 7f2dbb3

Please sign in to comment.