Symbolic Icons / SVG Icons that get recoloured
davidedmundson at kde.org
Mon Mar 4 16:28:37 UTC 2019
KDE's Plasma supports icons which can be coloured through SVG CSS
injection to match the theme.
GTK supports icons which can be coloured through SVG css injection to
match the theme.
Despite them doing the same thing, they are not compatible:
* A Qt app even when running on gnome and with the gnome icon set
won't get any colouring.
* A GTK app even when running on KDE with a KDE icon set won't get any
* A gnome icon set used on a KDE app in Plasma wouldn't get any colouring.
* A KDE icon set used in a GTK on Gnome would get some colouring but
only for the base colour, not the warning/error.
It seems this should be an avoidable problem. The CSS classes are even similar:
Gnome has: FG, Success, Warning, Error colour properties
KDE has: Text, PositiveText, NeutralText, NegativeText colour properties
The exact same idea, but one is semantic, the other explicitly mapping
the palette names.
There are a few other subtle differences:
* We don't change elements in the SVG unless they set a class. GTK
mods most elements to the foreground colour.
* KDE injects the CSS for all SVG icons, not just those ending in -symbolic
* KDE also has two other CSS colour classes "Background, Highlight"
The GTK code links to a page
"http://www.freedesktop.org/wiki/SymbolicIcons" but this page does not
Would there be interest in standardising this and having some interoperability.
More information about the xdg