From 6661933d4727ef4797eeb945f8c1b0b67f546b9d Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 10 Sep 2021 20:48:03 -0400 Subject: Display button updates (#1945) * Use span rather than div for button badges * Update action button icons * Rename class * Update current entry indicator --- ext/css/display.css | 42 +++++++++++------------------------------- ext/css/material.css | 8 ++++++++ ext/display-templates.html | 20 ++++++++++---------- 3 files changed, 29 insertions(+), 41 deletions(-) (limited to 'ext') diff --git a/ext/css/display.css b/ext/css/display.css index 76e8d6a4..58cd23eb 100644 --- a/ext/css/display.css +++ b/ext/css/display.css @@ -627,7 +627,7 @@ button.action-button[hidden] { -webkit-filter var(--animation-duration) linear, background-color var(--animation-duration) linear; } -button.collapsible-action-button[hidden] { +button.action-button-collapsible[hidden] { display: none; } button.action-button:disabled { @@ -653,34 +653,18 @@ button.action-button:active { background-color: var(--action-button-active-color); box-shadow: none; } -button.action-button[data-icon]::before { - content: ''; - width: var(--action-button-size); - height: var(--action-button-size); - display: block; - background-color: transparent; - background-repeat: no-repeat; - background-size: contain; -} -button.action-button[data-icon=view-note]::before { - background-image: url('/images/view-note.svg'); -} -button.action-button[data-icon=add-term-kanji]::before { - background-image: url('/images/add-term-kanji.svg'); -} -button.action-button[data-icon=add-term-kana]::before { - background-image: url('/images/add-term-kana.svg'); -} -button.action-button[data-icon=play-audio]::before { - background-image: url('/images/play-audio.svg'); -} -button.action-button[data-icon=source-term]::before { - background-image: url('/images/source-term.svg'); -} -.action-view-tags>.icon { +.icon[data-icon=view-note] { background-image: url('/images/view-note.svg'); } +.icon[data-icon=add-term-kanji] { background-image: url('/images/add-term-kanji.svg'); } +.icon[data-icon=add-term-kana] { background-image: url('/images/add-term-kana.svg'); } +.icon[data-icon=play-audio] { background-image: url('/images/play-audio.svg'); } +.icon[data-icon=source-term] { background-image: url('/images/source-term.svg'); } +.icon[data-icon=entry-current] { background-image: url('/images/entry-current.svg'); } +.action-icon { display: block; width: var(--action-button-size); height: var(--action-button-size); +} +.action-icon:not(.color-icon) { background-color: var(--text-color); } :root[data-result-output-mode=merge] .entry[data-type=term] .actions>button.action-button.action-play-audio { @@ -1048,14 +1032,10 @@ button.action-button[data-icon=source-term]::before { :root:not([data-popup-current-indicator-mode=asterisk]) .entry-current-indicator-icon { display: none; } -.entry-current-indicator-icon::before { - content: ''; +.entry-current-indicator-icon>.icon { width: var(--action-button-size); height: var(--action-button-size); display: block; - background-color: transparent; - background-repeat: no-repeat; - background-size: contain; background-image: url('/images/entry-current.svg'); } diff --git a/ext/css/material.css b/ext/css/material.css index 92d4fcdb..710058c7 100644 --- a/ext/css/material.css +++ b/ext/css/material.css @@ -228,6 +228,14 @@ body { mask-size: var(--icon-size); mask-image: var(--icon-image); } +.icon.color-icon { + -webkit-mask-image: none; + mask-image: none; + background-repeat: no-repeat; + background-position: center center; + background-size: var(--icon-size); + background-image: var(--icon-image); +} .icon[data-icon=none] { --icon-image: linear-gradient(transparent, transparent); } .icon[data-icon=profile] { --icon-image: url(/images/profile.svg); } .icon[data-icon=cog] { --icon-image: url(/images/cog.svg); } diff --git a/ext/display-templates.html b/ext/display-templates.html index 9deb1ff5..534ad704 100644 --- a/ext/display-templates.html +++ b/ext/display-templates.html @@ -5,12 +5,12 @@
- - - - - - + + + + + +
@@ -42,7 +42,7 @@
- +