From f5ae0f1f3d9a83aa85322a2008e21da5b882e01c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 20 Dec 2020 15:43:10 -0500 Subject: Settings v2 icon improvements (#1147) * Update navigation icons * Improve outline layout, fixing badge indicators * Change attribute value * Update icon buttons * Update settings page --- ext/bg/css/settings2.css | 135 +++++++++++++++++++---------------------------- ext/bg/search.html | 2 +- ext/bg/settings2.html | 76 +++++++++++++------------- ext/bg/welcome.html | 6 +-- ext/mixed/css/search.css | 32 ++++++----- 5 files changed, 114 insertions(+), 137 deletions(-) diff --git a/ext/bg/css/settings2.css b/ext/bg/css/settings2.css index 8ba53b8b..651da9c0 100644 --- a/ext/bg/css/settings2.css +++ b/ext/bg/css/settings2.css @@ -266,6 +266,45 @@ h3 { } +/* Icons */ +.icon { + --icon-image: none; + --icon-size: contain; + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center center; + -webkit-mask-mode: alpha; + -webkit-mask-size: var(--icon-size); + -webkit-mask-image: var(--icon-image); + mask-repeat: no-repeat; + mask-position: center center; + mask-mode: alpha; + mask-size: var(--icon-size); + mask-image: var(--icon-image); +} +.icon[data-icon=profile] { --icon-image: url(/mixed/img/profile.svg); } +.icon[data-icon=cog] { --icon-image: url(/mixed/img/cog.svg); } +.icon[data-icon=palette] { --icon-image: url(/mixed/img/palette.svg); } +.icon[data-icon=popup] { --icon-image: url(/mixed/img/popup.svg); } +.icon[data-icon=speaker] { --icon-image: url(/mixed/img/speaker.svg); } +.icon[data-icon=scanning] { --icon-image: url(/mixed/img/scanning.svg); } +.icon[data-icon=text-parsing] { --icon-image: url(/mixed/img/text-parsing.svg); } +.icon[data-icon=translation] { --icon-image: url(/mixed/img/translation.svg); } +.icon[data-icon=book] { --icon-image: url(/mixed/img/book.svg); } +.icon[data-icon=note-card] { --icon-image: url(/mixed/img/note-card.svg); } +.icon[data-icon=keyboard] { --icon-image: url(/mixed/img/keyboard.svg); } +.icon[data-icon=backup] { --icon-image: url(/mixed/img/backup.svg); } +.icon[data-icon=lock] { --icon-image: url(/mixed/img/lock.svg); } +.icon[data-icon=question-mark] { --icon-image: url(/mixed/img/question-mark.svg); } +.icon[data-icon=popup-size] { --icon-image: url(/mixed/img/popup-size.svg); } +.icon[data-icon=hamburger-menu] { --icon-image: url(/mixed/img/hamburger-menu.svg); } +.icon[data-icon=kebab-menu] { --icon-image: url(/mixed/img/kebab-menu.svg); } +.icon[data-icon=mouse] { --icon-image: url(/mixed/img/mouse.svg); } +.icon[data-icon=material-down-arrow] { --icon-image: url(/mixed/img/material-down-arrow.svg); } +.icon[data-icon=material-right-arrow] { --icon-image: url(/mixed/img/material-right-arrow.svg); } +.icon[data-icon=exclamation-point-short] { --icon-image: url(/mixed/img/exclamation-point-short.svg); } +.icon[data-icon=magnifying-glass] { --icon-image: url(/mixed/img/magnifying-glass.svg); } + + /* Content layout */ .content-outer { display: flex; @@ -412,7 +451,9 @@ h3 { padding-bottom: 2em; } .outline-item { - display: block; + display: flex; + align-items: center; + width: 100%; height: var(--outline-item-height); line-height: var(--outline-item-height); padding: 0 1.5em; @@ -428,10 +469,6 @@ h3 { .outline-item:hover { background-color: var(--outline-item-background-color-hover); } -.outline-item-inner { - display: flex; - align-items: center; -} .outline-item-left { display: inline-block; width: var(--outline-item-icon-size); @@ -455,8 +492,7 @@ h3 { .outline-item-left-warning-badge:not([hidden]) { display: block; } -.outline-item-left-warning-badge[data-icon]::after { - content: ""; +.outline-item-left-warning-badge>.icon { display: block; position: absolute; left: 0; @@ -464,43 +500,17 @@ h3 { right: 0; bottom: 0; background-color: var(--warning-color); - mask-repeat: no-repeat; - mask-position: center center; - mask-mode: alpha; - -webkit-mask-repeat: no-repeat; - -webkit-mask-position: center center; - -webkit-mask-mode: alpha; -} -.outline-item-left-warning-badge[data-icon=exclamation-point-short]::after { - mask-image: url(/mixed/img/exclamation-point-short.svg); - -webkit-mask-image: url(/mixed/img/exclamation-point-short.svg); - mask-size: 100% 100%; - -webkit-mask-size: 100% 100%; } .outline-item-label { white-space: nowrap; padding-left: var(--padding); } .outline-item-icon { - background-size: contain; - background-color: transparent; - background-repeat: no-repeat; + display: block; + background-color: var(--button-icon-color); + width: 100%; + height: 100%; } -.outline-item-icon[data-icon=profile] { background-image: url(/mixed/img/profile.svg); } -.outline-item-icon[data-icon=general] { background-image: url(/mixed/img/cog.svg); } -.outline-item-icon[data-icon=appearance] { background-image: url(/mixed/img/palette.svg); } -.outline-item-icon[data-icon=popup] { background-image: url(/mixed/img/popup.svg); } -.outline-item-icon[data-icon=audio] { background-image: url(/mixed/img/speaker.svg); } -.outline-item-icon[data-icon=scanning] { background-image: url(/mixed/img/scanning.svg); } -.outline-item-icon[data-icon=text-parsing] { background-image: url(/mixed/img/text-parsing.svg); } -.outline-item-icon[data-icon=translation] { background-image: url(/mixed/img/translation.svg); } -.outline-item-icon[data-icon=dictionaries] { background-image: url(/mixed/img/book.svg); } -.outline-item-icon[data-icon=anki] { background-image: url(/mixed/img/note-card.svg); } -.outline-item-icon[data-icon=shortcuts] { background-image: url(/mixed/img/keyboard.svg); } -.outline-item-icon[data-icon=backup] { background-image: url(/mixed/img/backup.svg); } -.outline-item-icon[data-icon=security] { background-image: url(/mixed/img/lock.svg); } -.outline-item-icon[data-icon=about] { background-image: url(/mixed/img/question-mark.svg); } -.outline-item-icon[data-icon=popup-size] { background-image: url(/mixed/img/popup-size.svg); } /* Preview sidebar */ @@ -1360,7 +1370,7 @@ button.icon-button:active { opacity var(--animation-duration2) ease-in-out, visibility var(--animation-duration2) ease-in-out; } -.icon-button-icon { +.icon-button>.icon-button-inner>.icon { display: block; position: absolute; left: 0; @@ -1368,52 +1378,13 @@ button.icon-button:active { right: 0; bottom: 0; background-color: var(--button-icon-color); - mask-repeat: no-repeat; - mask-position: center center; - mask-mode: alpha; - -webkit-mask-repeat: no-repeat; - -webkit-mask-position: center center; - -webkit-mask-mode: alpha; + --icon-size: 16px 16px; } -.icon-button-icon.icon-button-icon-light { +.icon-button>.icon-button-inner>.icon.icon-button-icon-light { background-color: var(--button-icon-color-light); } -.icon-button-icon[data-icon=right-arrow] { - mask-image: url(/mixed/img/material-right-arrow.svg); - -webkit-mask-image: url(/mixed/img/material-right-arrow.svg); - mask-size: var(--material-arrow-dimension1) var(--material-arrow-dimension2); - -webkit-mask-size: var(--material-arrow-dimension1) var(--material-arrow-dimension2); -} -.icon-button-icon[data-icon=hamburger-menu] { - mask-image: url(/mixed/img/hamburger-menu.svg); - -webkit-mask-image: url(/mixed/img/hamburger-menu.svg); - mask-size: 16px 16px; - -webkit-mask-size: 16px 16px; -} -.icon-button-icon[data-icon=kebab-menu] { - mask-image: url(/mixed/img/kebab-menu.svg); - -webkit-mask-image: url(/mixed/img/kebab-menu.svg); - mask-size: 16px 16px; - -webkit-mask-size: 16px 16px; -} -.icon-button-icon[data-icon=popup] { - mask-image: url(/mixed/img/popup.svg); - -webkit-mask-image: url(/mixed/img/popup.svg); - mask-size: 16px 16px; - -webkit-mask-size: 16px 16px; -} -.icon-button-icon[data-icon=mouse] { - mask-image: url(/mixed/img/mouse.svg); - -webkit-mask-image: url(/mixed/img/mouse.svg); - mask-size: 16px 16px; - -webkit-mask-size: 16px 16px; -} -.icon-button-icon[data-icon=material-down-arrow] { - mask-image: url(/mixed/img/material-down-arrow.svg); - -webkit-mask-image: url(/mixed/img/material-down-arrow.svg); - mask-size: var(--material-arrow-dimension2) var(--material-arrow-dimension1); - -webkit-mask-size: var(--material-arrow-dimension2) var(--material-arrow-dimension1); -} +.icon-button>.icon-button-inner>.icon[data-icon=material-right-arrow] { --icon-size: var(--material-arrow-dimension1) var(--material-arrow-dimension2); } +.icon-button>.icon-button-inner>.icon[data-icon=material-down-arrow] { --icon-size: var(--material-arrow-dimension2) var(--material-arrow-dimension1); } .input-height-icon-button-container { height: var(--input-height); @@ -1806,7 +1777,7 @@ button.fab-button:active { background-color: var(--accent-color); box-shadow: var(--shadow-vertical); } -button.fab-button>.icon-button-inner>.icon-button-icon { +button.fab-button>.icon-button-inner>.icon { background-color: #ffffff; } .fab-container-item.fab-container-item-popup-preview { diff --git a/ext/bg/search.html b/ext/bg/search.html index 34d36478..bcc02578 100644 --- a/ext/bg/search.html +++ b/ext/bg/search.html @@ -46,7 +46,7 @@
- +
diff --git a/ext/bg/settings2.html b/ext/bg/settings2.html index 0a591861..0d7483e1 100644 --- a/ext/bg/settings2.html +++ b/ext/bg/settings2.html @@ -21,26 +21,26 @@ @@ -97,7 +97,7 @@
Adjust profiles
- +
@@ -109,7 +109,7 @@
Configure installed and enabled dictionaries
- +
@@ -252,7 +252,7 @@
Secondary dictionaries
- +
@@ -564,7 +564,7 @@
Custom CSS
- +
@@ -779,7 +779,7 @@
Audio playback sources
- +
@@ -827,7 +827,7 @@
Configure advanced scanning inputs (# defined)
- +
@@ -944,7 +944,7 @@
Configure input action prevention
- +
@@ -1294,7 +1294,7 @@
Configure Anki card format
- +
@@ -1302,7 +1302,7 @@
Configure Anki card templates
- +
@@ -1445,10 +1445,10 @@
- +
- +
@@ -2083,7 +2083,7 @@
- +
@@ -2170,7 +2170,7 @@
0
-
+
@@ -2223,7 +2223,7 @@
- +
@@ -2317,7 +2317,7 @@
- +
diff --git a/ext/mixed/css/search.css b/ext/mixed/css/search.css index 8c8f77e6..ad4a2ae7 100644 --- a/ext/mixed/css/search.css +++ b/ext/mixed/css/search.css @@ -98,6 +98,23 @@ h1 { border-bottom: calc(1em / (var(--font-size-no-units) * 2)) solid var(--separator-color1); } +/* Icons */ +.icon { + --icon-image: none; + --icon-size: contain; + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center center; + -webkit-mask-mode: alpha; + -webkit-mask-size: var(--icon-size); + -webkit-mask-image: var(--icon-image); + mask-repeat: no-repeat; + mask-position: center center; + mask-mode: alpha; + mask-size: var(--icon-size); + mask-image: var(--icon-image); +} +.icon[data-icon=magnifying-glass] { --icon-image: url(/mixed/img/magnifying-glass.svg); } + /* Material design select */ select { width: var(--input-width-large); @@ -289,7 +306,7 @@ label.toggle { background-color: var(--input-background-color-darker); } -.icon-button-icon { +#search-button>.icon { display: block; position: absolute; left: 0; @@ -297,18 +314,7 @@ label.toggle { right: 0; bottom: 0; background-color: var(--button-icon-color); - mask-repeat: no-repeat; - mask-position: center center; - mask-mode: alpha; - -webkit-mask-repeat: no-repeat; - -webkit-mask-position: center center; - -webkit-mask-mode: alpha; -} -.icon-button-icon[data-icon=magnifying-glass] { - mask-image: url(/mixed/img/magnifying-glass.svg); - -webkit-mask-image: url(/mixed/img/magnifying-glass.svg); - mask-size: 16px 16px; - -webkit-mask-size: 16px 16px; + --icon-size: 16px 16px; } /* Search options */ -- cgit v1.2.3