Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
SWT/Devel/Gtk/CSS selector
< SWT | Devel | Gtk
Revision as of 14:05, 22 August 2018 by Ericwill.redhat.com (Talk | contribs) (→Avoiding CSS warnings in console)
Avoiding CSS warnings in console
GTK CSS has a specific format in order to be parsed without warnings. The format is as follows:
<widget name/selector> {<property>: <value>;}
For example:
GtkWidget {background-color: rgba(255, 0, 0, 255);}
Forming CSS strings with this format will not cause any warnings. Additional semi-colons will cause problems. Note that only one semi-colon is needed.
Please note that the selectors have changed for GTK3.20+, so using things like GtkWidget
as a selector will not work. Thankfully, GTK3 CSS is now part of the API, so you can look up the proper selectors here.