[fix] simple theme: /preferences: dark theme version for select widgets

It is not possible to use CSS variable in a SVG when this is in a background.
This commit adds two .svg files, less converts them into data URL.
The two files are indentical except the fill color.
This commit is contained in:
Alexandre Flament 2021-10-30 11:51:52 +02:00
parent 67b0b68b40
commit d0a3164514
4 changed files with 19 additions and 1 deletions

View file

@ -232,3 +232,7 @@ html {
@icon-font-name: "glyphicons-halflings-regular"; @icon-font-name: "glyphicons-halflings-regular";
//** Element ID within SVG icon file. //** Element ID within SVG icon file.
@icon-font-svg-id: "glyphicons_halflingsregular"; @icon-font-svg-id: "glyphicons_halflingsregular";
// decoration of the select HTML elements
@select-light-svg-path: "../svg/select-light.svg";
@select-dark-svg-path: "../svg/select-dark.svg";

View file

@ -328,7 +328,7 @@ select {
-moz-appearance: none; -moz-appearance: none;
border: none; border: none;
border-bottom: 1px solid var(--color-toolkit-select-border); border-bottom: 1px solid var(--color-toolkit-select-border);
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat; background: data-uri('image/svg+xml;charset=UTF-8', @select-light-svg-path) no-repeat;
background-position-x: 105%; background-position-x: 105%;
background-size: 2em; background-size: 2em;
background-origin: content-box; background-origin: content-box;
@ -339,6 +339,12 @@ select {
border-bottom: 1px solid var(--color-search-border); border-bottom: 1px solid var(--color-search-border);
} }
} }
@media (prefers-color-scheme: dark) {
select {
background-image: data-uri('image/svg+xml;charset=UTF-8', @select-dark-svg-path);
}
}
} }
/* -- checkbox-onoff -- */ /* -- checkbox-onoff -- */

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
<g><polygon fill="#ddd" points="128,192 256,320 384,192"/></g>
</svg>

After

Width:  |  Height:  |  Size: 196 B

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
<g><polygon points="128,192 256,320 384,192"/></g>
</svg>

After

Width:  |  Height:  |  Size: 184 B