Crazy CSS style gtkrc replacement ideas

Rationale: The current gtkrc syntax is confusing for many people.

Proposal: Replace it with a css style syntax

Style blocks can be defined per class or widget name, with # used to denote widget name. per-state styles can be defined using :state suffix. multiple matches are seperated by commas. Space indicates widget path (could be dot instead of space?). Background and foreground colours become normal style properties, and other style properties do not require the class prefix as they are assumed to apply to the widget(s) being matched. symbolic colours could be used as currently, including modifiers (e.g. @bg_color and lighter (@bg_color))

TODO: define a default and optional colour schemes in the gtkrc.

GtkWidget {

  /* this matches GtkWidget and descendants (i.e. all widgets) */

  some-gtkwidget-property: on;

  background-color: #C0C0C0;
  foreground-color: black;
  selection-color: blue;

  engine: clearlooks {engine options(?)};


GtkWidget:prelight {
  /* this applies to GtkWidgets in prelight state */

GtkEntry, GtkTreeView {

  /* this applies to GtkEntry and GtkTreeView based widgets */

  shadow-type: etched-in;

  background-color: white;
  foreground-color: black;


#some-widget-name {
  /* this applies to any widget named "some-widget-name" */

GtkButton GtkLabel {
/* this applies to any GtkLabel inside a GtkButton */

#my-window GtkButton {
  /* this applies to any GtkButton inside a widget named "my-window" */

Projects/GTK+/NewThemeApi/Proposals/CSS (last edited 2013-11-22 15:36:45 by WilliamJonMcCann)