mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ui: Use inline SVG images for app icons for dark mode adaptation
- Use 'currentColor' as color in SVG images to make them adapt to light/dark
modes.
- Introduce a new {% icon %} template tag to read SVG files, attach attributes,
remove <?xml> header, and make all IDs inside unique.
- Use the {% icon %} template tag to inline SVGs in app page, home page,
app pages, and notifications.
- Relax the content security policy to allow inline styling with 'style='
attribute.
Tests:
- Allow the icons looks as before in the following pages: home page, apps page,
app specific page, and in notifications.
- Icons that are fully dark become white when theme is switched to dark mode.
- All the inlined SVG icons have a prefixed unique ID.
- W3C HTML validator shows no new errors.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
c0dcd15169
commit
6defd3e8ce
10 files changed
+187
-20
No files matched your search
@@ -354,6 +354,16 @@ footer {
|
||||
padding-top: 20rem;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inline SVG Icons
|
||||
*/
|
||||
.svg-icon {
|
||||
width: auto;
|
||||
height: 0.875em;
|
||||
vertical-align: sub;
|
||||
margin: 0.125em 0.25em;
|
||||
}
|
||||
|
||||
/*
|
||||
* Bootstrap extensions
|
||||
*/
|
||||
@@ -587,7 +597,7 @@ footer {
|
||||
}
|
||||
|
||||
.card-icon span,
|
||||
.card-icon img {
|
||||
.card-icon svg {
|
||||
width: 6.25rem;
|
||||
height: 6.25rem;
|
||||
font-size: 5rem;
|
||||
@@ -816,9 +826,10 @@ input[type='submit'].running-status-button {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.app-header > img {
|
||||
.app-header > svg {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
section.app-description {
|
||||
@@ -867,7 +878,7 @@ section.app-description {
|
||||
flex-flow: column;
|
||||
}
|
||||
|
||||
.app-header img {
|
||||
.app-header svg {
|
||||
width: 9.375rem;
|
||||
height: 9.375rem;
|
||||
margin-top: 0;
|
||||
@@ -974,7 +985,7 @@ section.app-description {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
img.notification-icon {
|
||||
.notification-icon {
|
||||
display: inline-block;
|
||||
width: 0.875rem;
|
||||
height: 0.875rem;
|
||||
|
||||
Reference in new issue
Block a user