[gtk/api-touchups: 2/2] Drop style class defines




commit ae7cefd97dfbd37e23a4c604abe8a1cae25459c5
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 13 19:49:02 2020 -0400

    Drop style class defines
    
    We document the supported style classes by name,
    not by macro name, and these macros don't really
    add any value. Drop them for GTK 4.

 demos/gtk-demo/bluroverlay.c         |  24 +-
 demos/gtk-demo/rotated_text.c        |   2 +-
 demos/gtk-demo/sliding_puzzle.c      |   2 +-
 docs/reference/gtk/gtk4-sections.txt |  84 ----
 gtk/gtkappchooserdialog.c            |   4 +-
 gtk/gtkassistant.c                   |   4 +-
 gtk/gtkbutton.c                      |   6 +-
 gtk/gtkcalendar.c                    |   2 +-
 gtk/gtkcellrenderer.c                |   4 +-
 gtk/gtkcellrendererpixbuf.c          |   4 +-
 gtk/gtkcellrendererprogress.c        |   8 +-
 gtk/gtkcolorchooserwidget.c          |   8 +-
 gtk/gtkdialog.c                      |   6 +-
 gtk/gtkentry.c                       |   8 +-
 gtk/gtkexpander.c                    |   2 +-
 gtk/gtkfilechooserdialog.c           |   4 +-
 gtk/gtkheaderbar.c                   |   2 +-
 gtk/gtkiconview.c                    |   4 +-
 gtk/gtkinfobar.c                     |   8 +-
 gtk/gtkmenusectionbox.c              |   4 +-
 gtk/gtkmodelbutton.c                 |  32 +-
 gtk/gtkmountoperation.c              |   2 +-
 gtk/gtknotebook.c                    |  17 +-
 gtk/gtkoverlaylayout.c               |  24 +-
 gtk/gtkpaned.c                       |   6 +-
 gtk/gtkpathbar.c                     |   2 +-
 gtk/gtkplacesview.c                  |   4 +-
 gtk/gtkprogressbar.c                 |  20 +-
 gtk/gtkrange.c                       |  16 +-
 gtk/gtkscale.c                       |  33 +-
 gtk/gtkscrolledwindow.c              |  28 +-
 gtk/gtkshortcutssection.c            |   2 +-
 gtk/gtkshortcutsshortcut.c           |   2 +-
 gtk/gtkshortcutswindow.c             |   6 +-
 gtk/gtkstacksidebar.c                |   4 +-
 gtk/gtkstackswitcher.c               |   4 +-
 gtk/gtkstylecontext.h                | 770 -----------------------------------
 gtk/gtktext.c                        |   8 +-
 gtk/gtktexthandle.c                  |  18 +-
 gtk/gtktextview.c                    |  12 +-
 gtk/gtktextviewchild.c               |   8 +-
 gtk/gtktreepopover.c                 |   2 +-
 gtk/gtktreeview.c                    |  26 +-
 gtk/gtkviewport.c                    |   2 +-
 gtk/gtkwidget.c                      |  12 +-
 gtk/gtkwindow.c                      |  10 +-
 gtk/inspector/prop-editor.c          |   4 +-
 gtk/inspector/size-groups.c          |   2 +-
 tests/testrevealer2.c                |   2 +-
 49 files changed, 210 insertions(+), 1058 deletions(-)
---
diff --git a/demos/gtk-demo/bluroverlay.c b/demos/gtk-demo/bluroverlay.c
index 6436b3cad4..3a7585ff09 100644
--- a/demos/gtk-demo/bluroverlay.c
+++ b/demos/gtk-demo/bluroverlay.c
@@ -132,10 +132,10 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
   gboolean is_left, is_right, is_top, is_bottom;
   gboolean has_left, has_right, has_top, has_bottom;
 
-  has_left = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_LEFT);
-  has_right = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_RIGHT);
-  has_top = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_TOP);
-  has_bottom = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_BOTTOM);
+  has_left = gtk_widget_has_css_class (child, "left");
+  has_right = gtk_widget_has_css_class (child, "right");
+  has_top = gtk_widget_has_css_class (child, "top");
+  has_bottom = gtk_widget_has_css_class (child, "bottom");
 
   is_left = is_right = is_top = is_bottom = FALSE;
 
@@ -158,24 +158,24 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
     is_bottom = (child_allocation->y + child_allocation->height == height);
 
   if (has_left && !is_left)
-    gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_remove_css_class (child, "left");
   else if (!has_left && is_left)
-    gtk_widget_add_css_class (child, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_add_css_class (child, "left");
 
   if (has_right && !is_right)
-    gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_remove_css_class (child, "right");
   else if (!has_right && is_right)
-    gtk_widget_add_css_class (child, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_add_css_class (child, "right");
 
   if (has_top && !is_top)
-    gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_TOP);
+    gtk_widget_remove_css_class (child, "top");
   else if (!has_top && is_top)
-    gtk_widget_add_css_class (child, GTK_STYLE_CLASS_TOP);
+    gtk_widget_add_css_class (child, "top");
 
   if (has_bottom && !is_bottom)
-    gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_remove_css_class (child, "bottom");
   else if (!has_bottom && is_bottom)
-    gtk_widget_add_css_class (child, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_add_css_class (child, "bottom");
 }
 
 static void
diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c
index 0af45dc017..88a81edaa8 100644
--- a/demos/gtk-demo/rotated_text.c
+++ b/demos/gtk-demo/rotated_text.c
@@ -189,7 +189,7 @@ do_rotated_text (GtkWidget *do_widget)
       /* Add a drawing area */
       drawing_area = gtk_drawing_area_new ();
       gtk_box_append (GTK_BOX (box), drawing_area);
-      gtk_widget_add_css_class (drawing_area, GTK_STYLE_CLASS_VIEW);
+      gtk_widget_add_css_class (drawing_area, "view");
 
       gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area),
                                       rotated_text_draw,
diff --git a/demos/gtk-demo/sliding_puzzle.c b/demos/gtk-demo/sliding_puzzle.c
index 250f5983cf..4cd2ab9116 100644
--- a/demos/gtk-demo/sliding_puzzle.c
+++ b/demos/gtk-demo/sliding_puzzle.c
@@ -435,7 +435,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
       gtk_widget_set_margin_bottom (tweaks, 10);
 
       choices = gtk_flow_box_new ();
-      gtk_widget_add_css_class (choices, GTK_STYLE_CLASS_VIEW);
+      gtk_widget_add_css_class (choices, "view");
       add_choice (choices, puzzle);
       add_choice (choices, gtk_nuclear_animation_new ());
       media = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 7710b7020d..2199592314 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4842,91 +4842,7 @@ gtk_style_provider_get_type
 <SECTION>
 <FILE>gtkstylecontext</FILE>
 <TITLE>GtkStyleContext</TITLE>
-<SUBSECTION>
 GtkBorderStyle
-<SUBSECTION>
-GTK_STYLE_CLASS_ACCELERATOR
-GTK_STYLE_CLASS_ARROW
-GTK_STYLE_CLASS_BACKGROUND
-GTK_STYLE_CLASS_BOTTOM
-GTK_STYLE_CLASS_BUTTON
-GTK_STYLE_CLASS_CALENDAR
-GTK_STYLE_CLASS_CELL
-GTK_STYLE_CLASS_COMBOBOX_ENTRY
-GTK_STYLE_CLASS_CONTEXT_MENU
-GTK_STYLE_CLASS_CHECK
-GTK_STYLE_CLASS_CSD
-GTK_STYLE_CLASS_CURSOR_HANDLE
-GTK_STYLE_CLASS_DEFAULT
-GTK_STYLE_CLASS_DESTRUCTIVE_ACTION
-GTK_STYLE_CLASS_DIM_LABEL
-GTK_STYLE_CLASS_DND
-GTK_STYLE_CLASS_DOCK
-GTK_STYLE_CLASS_ENTRY
-GTK_STYLE_CLASS_ERROR
-GTK_STYLE_CLASS_EXPANDER
-GTK_STYLE_CLASS_FRAME
-GTK_STYLE_CLASS_FLAT
-GTK_STYLE_CLASS_HEADER
-GTK_STYLE_CLASS_HIGHLIGHT
-GTK_STYLE_CLASS_HORIZONTAL
-GTK_STYLE_CLASS_IMAGE
-GTK_STYLE_CLASS_INFO
-GTK_STYLE_CLASS_INSERTION_CURSOR
-GTK_STYLE_CLASS_LABEL
-GTK_STYLE_CLASS_LEFT
-GTK_STYLE_CLASS_LEVEL_BAR
-GTK_STYLE_CLASS_LINKED
-GTK_STYLE_CLASS_LIST
-GTK_STYLE_CLASS_LIST_ROW
-GTK_STYLE_CLASS_MARK
-GTK_STYLE_CLASS_MENU
-GTK_STYLE_CLASS_MENUBAR
-GTK_STYLE_CLASS_MENUITEM
-GTK_STYLE_CLASS_MESSAGE_DIALOG
-GTK_STYLE_CLASS_MONOSPACE
-GTK_STYLE_CLASS_NEEDS_ATTENTION
-GTK_STYLE_CLASS_NOTEBOOK
-GTK_STYLE_CLASS_OSD
-GTK_STYLE_CLASS_OVERSHOOT
-GTK_STYLE_CLASS_PANE_SEPARATOR
-GTK_STYLE_CLASS_PAPER
-GTK_STYLE_CLASS_POPUP
-GTK_STYLE_CLASS_POPOVER
-GTK_STYLE_CLASS_PROGRESSBAR
-GTK_STYLE_CLASS_PULSE
-GTK_STYLE_CLASS_QUESTION
-GTK_STYLE_CLASS_RADIO
-GTK_STYLE_CLASS_RAISED
-GTK_STYLE_CLASS_READ_ONLY
-GTK_STYLE_CLASS_RIGHT
-GTK_STYLE_CLASS_RUBBERBAND
-GTK_STYLE_CLASS_SCALE
-GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE
-GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW
-GTK_STYLE_CLASS_SCROLLBAR
-GTK_STYLE_CLASS_SCROLLBARS_JUNCTION
-GTK_STYLE_CLASS_SEPARATOR
-GTK_STYLE_CLASS_SIDEBAR
-GTK_STYLE_CLASS_SLIDER
-GTK_STYLE_CLASS_SPINBUTTON
-GTK_STYLE_CLASS_SPINNER
-GTK_STYLE_CLASS_STATUSBAR
-GTK_STYLE_CLASS_SUBTITLE
-GTK_STYLE_CLASS_SUGGESTED_ACTION
-GTK_STYLE_CLASS_TITLE
-GTK_STYLE_CLASS_TITLEBAR
-GTK_STYLE_CLASS_TOOLBAR
-GTK_STYLE_CLASS_TOOLTIP
-GTK_STYLE_CLASS_TOUCH_SELECTION
-GTK_STYLE_CLASS_TOP
-GTK_STYLE_CLASS_TROUGH
-GTK_STYLE_CLASS_UNDERSHOOT
-GTK_STYLE_CLASS_VERTICAL
-GTK_STYLE_CLASS_VIEW
-GTK_STYLE_CLASS_WARNING
-GTK_STYLE_CLASS_WIDE
-<SUBSECTION>
 GtkStyleContext
 gtk_style_context_add_provider
 gtk_style_context_add_provider_for_display
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 6999eabf4f..50f12bc4ba 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -236,7 +236,7 @@ set_dialog_properties (GtkAppChooserDialog *self)
       gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
       gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
       gtk_label_set_width_chars (GTK_LABEL (label), 5);
-      gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
+      gtk_widget_add_css_class (label, "title");
       gtk_widget_set_parent (label, box);
 
       if (subtitle)
@@ -245,7 +245,7 @@ set_dialog_properties (GtkAppChooserDialog *self)
           gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
           gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
           gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
-          gtk_widget_add_css_class (label, GTK_STYLE_CLASS_SUBTITLE);
+          gtk_widget_add_css_class (label, "subtitle");
           gtk_widget_set_parent (label, box);
         }
 
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 27acfdf4f5..b776fbabba 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -416,7 +416,7 @@ add_action_widgets (GtkAssistant *assistant)
           if (has_default)
             {
               gtk_window_set_default_widget (GTK_WINDOW (assistant), child);
-              gtk_widget_add_css_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
+              gtk_widget_add_css_class (child, "suggested-action");
             }
         }
       g_list_free (children);
@@ -1676,7 +1676,7 @@ gtk_assistant_add_page (GtkAssistant *assistant,
   gtk_widget_show (page_info->regular_title);
   gtk_widget_hide (page_info->current_title);
 
-  gtk_widget_add_css_class (page_info->current_title, GTK_STYLE_CLASS_HIGHLIGHT);
+  gtk_widget_add_css_class (page_info->current_title, "highlight");
 
   gtk_size_group_add_widget (assistant->title_size_group, page_info->regular_title);
   gtk_size_group_add_widget (assistant->title_size_group, page_info->current_title);
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index c242b28c64..007bd41ba1 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -720,9 +720,9 @@ gtk_button_set_has_frame (GtkButton *button,
     return;
 
   if (has_frame)
-    gtk_widget_remove_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_remove_css_class (GTK_WIDGET (button), "flat");
   else
-    gtk_widget_add_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_add_css_class (GTK_WIDGET (button), "flat");
 
   g_object_notify_by_pspec (G_OBJECT (button), props[PROP_HAS_FRAME]);
 }
@@ -740,7 +740,7 @@ gtk_button_get_has_frame (GtkButton *button)
 {
   g_return_val_if_fail (GTK_IS_BUTTON (button), TRUE);
 
-  return !gtk_widget_has_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
+  return !gtk_widget_has_css_class (GTK_WIDGET (button), "flat");
 }
 
 static void
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 55c1bceec5..59e43033f4 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -572,7 +572,7 @@ gtk_calendar_init (GtkCalendar *calendar)
 
   gtk_widget_set_focusable (widget, TRUE);
 
-  gtk_widget_add_css_class (GTK_WIDGET (calendar), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (calendar), "view");
 
   calendar->header_box = g_object_new (GTK_TYPE_BOX,
                                    "css-name", "header",
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index ed9be3e10b..0f48cfeb32 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -713,7 +713,7 @@ gtk_cell_renderer_snapshot (GtkCellRenderer      *cell,
   context = gtk_widget_get_style_context (widget);
 
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
+  gtk_style_context_add_class (context, "cell");
 
   state = gtk_cell_renderer_get_state (cell, widget, flags);
   gtk_style_context_set_state (context, state);
@@ -826,7 +826,7 @@ gtk_cell_renderer_start_editing (GtkCellRenderer      *cell,
   if (editable == NULL)
     return NULL;
 
-  gtk_widget_add_css_class (GTK_WIDGET (editable), GTK_STYLE_CLASS_CELL);
+  gtk_widget_add_css_class (GTK_WIDGET (editable), "cell");
 
   g_signal_emit (cell, 
                 cell_renderer_signals[EDITING_STARTED], 0,
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c
index 09763afed5..e94331c1bc 100644
--- a/gtk/gtkcellrendererpixbuf.c
+++ b/gtk/gtkcellrendererpixbuf.c
@@ -423,7 +423,7 @@ gtk_cell_renderer_pixbuf_get_size (GtkCellRenderer    *cell,
 
   context = gtk_widget_get_style_context (widget);
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
+  gtk_style_context_add_class (context, "image");
   gtk_icon_size_set_style_classes (gtk_style_context_get_node (context), priv->icon_size);
   icon_helper = create_icon_helper (cellpixbuf, widget);
 
@@ -523,7 +523,7 @@ gtk_cell_renderer_pixbuf_snapshot (GtkCellRenderer      *cell,
   context = gtk_widget_get_style_context (widget);
   gtk_style_context_save (context);
 
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
+  gtk_style_context_add_class (context, "image");
   gtk_icon_size_set_style_classes (gtk_style_context_get_node (context), priv->icon_size);
 
   is_expander = gtk_cell_renderer_get_is_expander (cell);
diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c
index eef3edc585..f75a998be4 100644
--- a/gtk/gtkcellrendererprogress.c
+++ b/gtk/gtkcellrendererprogress.c
@@ -574,7 +574,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer      *cell,
   h = cell_area->height - ypad * 2;
 
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
+  gtk_style_context_add_class (context, "trough");
 
   gtk_snapshot_render_background (snapshot, context, x, y, w, h);
   gtk_snapshot_render_frame (snapshot, context, x, y, w, h);
@@ -632,7 +632,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer      *cell,
   if (bar_size > 0)
     {
       gtk_style_context_save (context);
-      gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
+      gtk_style_context_add_class (context, "progressbar");
 
       gtk_snapshot_render_background (snapshot, context, clip.x, clip.y, clip.width, clip.height);
       gtk_snapshot_render_frame (snapshot, context, clip.x, clip.y, clip.width, clip.height);
@@ -665,7 +665,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer      *cell,
                               ));
 
       gtk_style_context_save (context);
-      gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
+      gtk_style_context_add_class (context, "progressbar");
 
       gtk_snapshot_render_layout (snapshot, context,
                                   x_pos, y_pos,
@@ -675,7 +675,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer      *cell,
       gtk_snapshot_pop (snapshot);
 
       gtk_style_context_save (context);
-      gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
+      gtk_style_context_add_class (context, "trough");
 
       if (bar_position > start)
         {
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c
index 114a3db522..087e8df056 100644
--- a/gtk/gtkcolorchooserwidget.c
+++ b/gtk/gtkcolorchooserwidget.c
@@ -336,18 +336,18 @@ add_palette (GtkColorChooserWidget  *cc,
       if (orientation == GTK_ORIENTATION_HORIZONTAL)
         {
           if (pos == left)
-            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_LEFT);
+            gtk_widget_add_css_class (p, "left");
           else if (pos == right)
-            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_RIGHT);
+            gtk_widget_add_css_class (p, "right");
 
           gtk_grid_attach (GTK_GRID (grid), p, pos, line, 1, 1);
         }
       else
         {
           if (pos == 0)
-            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_TOP);
+            gtk_widget_add_css_class (p, "top");
           else if (pos == colors_per_line - 1)
-            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_BOTTOM);
+            gtk_widget_add_css_class (p, "bottom");
 
           gtk_grid_attach (GTK_GRID (grid), p, line, pos, 1, 1);
        }
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 82b3504199..dad6263942 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -389,10 +389,10 @@ update_suggested_action (GtkDialog *dialog,
 
   if (priv->use_header_bar)
     {
-      if (gtk_widget_has_css_class (child, GTK_STYLE_CLASS_DEFAULT))
-        gtk_widget_add_css_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
+      if (gtk_widget_has_css_class (child, "default"))
+        gtk_widget_add_css_class (child, "suggested-action");
       else
-        gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
+        gtk_widget_remove_css_class (child, "suggested-action");
     }
 }
 
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index ee4de399d3..aedf9a325c 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -1448,7 +1448,7 @@ update_icon_style (GtkWidget            *widget,
   GtkEntry *entry = GTK_ENTRY (widget);
   GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
   EntryIconInfo *icon_info = priv->icons[icon_pos];
-  const char *sides[2] = { GTK_STYLE_CLASS_LEFT, GTK_STYLE_CLASS_RIGHT };
+  const char *sides[2] = { "left", "right" };
 
   if (icon_info == NULL)
     return;
@@ -2321,9 +2321,9 @@ gtk_entry_set_has_frame (GtkEntry *entry,
     return;
 
   if (setting)
-    gtk_widget_remove_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_remove_css_class (GTK_WIDGET (entry), "flat");
   else
-    gtk_widget_add_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_add_css_class (GTK_WIDGET (entry), "flat");
 
   g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_HAS_FRAME]);
 }
@@ -2341,7 +2341,7 @@ gtk_entry_get_has_frame (GtkEntry *entry)
 {
   g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE);
 
-  return !gtk_widget_has_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FRAME);
+  return !gtk_widget_has_css_class (GTK_WIDGET (entry), "flat");
 }
 
 /**
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 343701c2a8..533b567252 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -407,7 +407,7 @@ gtk_expander_init (GtkExpander *expander)
   gtk_box_append (GTK_BOX (expander->box), expander->title_widget);
 
   expander->arrow_widget = gtk_builtin_icon_new ("expander");
-  gtk_widget_add_css_class (expander->arrow_widget, GTK_STYLE_CLASS_HORIZONTAL);
+  gtk_widget_add_css_class (expander->arrow_widget, "horizontal");
   gtk_box_append (GTK_BOX (expander->title_widget), expander->arrow_widget);
 
   controller = gtk_drop_controller_motion_new ();
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 6870bccb1c..4db5c024a1 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -495,7 +495,7 @@ setup_search (GtkFileChooserDialog *dialog)
           gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
           gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
           gtk_label_set_width_chars (GTK_LABEL (label), 5);
-          gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
+          gtk_widget_add_css_class (label, "title");
           gtk_widget_set_parent (label, box);
 
           g_object_bind_property (dialog, "title",
@@ -506,7 +506,7 @@ setup_search (GtkFileChooserDialog *dialog)
           gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
           gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
           gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
-          gtk_widget_add_css_class (label, GTK_STYLE_CLASS_SUBTITLE);
+          gtk_widget_add_css_class (label, "subtitle");
           gtk_widget_set_parent (label, box);
 
           g_object_bind_property (priv->widget, "subtitle",
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index d2ce3fb3a3..e6b795962a 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -263,7 +263,7 @@ construct_title_label (GtkHeaderBar *bar)
   g_assert (bar->title_label == NULL);
 
   label = gtk_label_new (NULL);
-  gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (label, "title");
   gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
   gtk_label_set_wrap (GTK_LABEL (label), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 57e3404cc9..f1cc209ffd 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -951,7 +951,7 @@ gtk_icon_view_init (GtkIconView *icon_view)
   icon_view->priv->row_contexts = 
     g_ptr_array_new_with_free_func ((GDestroyNotify)g_object_unref);
 
-  gtk_widget_add_css_class (GTK_WIDGET (icon_view), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (icon_view), "view");
 
   gesture = gtk_gesture_click_new ();
   g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_icon_view_button_press),
@@ -2842,7 +2842,7 @@ gtk_icon_view_snapshot_item (GtkIconView     *icon_view,
   state = gtk_widget_get_state_flags (widget);
 
   gtk_style_context_save (style_context);
-  gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
+  gtk_style_context_add_class (style_context, "cell");
 
   state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
 
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 54e2120fa9..37c0c9efe5 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -1072,10 +1072,10 @@ gtk_info_bar_set_message_type (GtkInfoBar     *info_bar,
   if (info_bar->message_type != message_type)
     {
       const char *type_class[] = {
-        GTK_STYLE_CLASS_INFO,
-        GTK_STYLE_CLASS_WARNING,
-        GTK_STYLE_CLASS_QUESTION,
-        GTK_STYLE_CLASS_ERROR,
+        "info",
+        "warning",
+        "question",
+        "error",
         NULL
       };
 
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c
index 916ef54c47..86ecfa24df 100644
--- a/gtk/gtkmenusectionbox.c
+++ b/gtk/gtkmenusectionbox.c
@@ -643,10 +643,10 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
 
       title = gtk_label_new (label);
       g_object_bind_property (item, "label", title, "label", G_BINDING_SYNC_CREATE);
-      gtk_widget_add_css_class (title, GTK_STYLE_CLASS_SEPARATOR);
+      gtk_widget_add_css_class (title, "separator");
       gtk_widget_set_halign (title, GTK_ALIGN_START);
       gtk_label_set_xalign (GTK_LABEL (title), 0.0);
-      gtk_widget_add_css_class (title, GTK_STYLE_CLASS_TITLE);
+      gtk_widget_add_css_class (title, "title");
       gtk_box_append (GTK_BOX (box->separator), title);
     }
   else
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index fad86907d2..7eda4627fd 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -306,14 +306,14 @@ update_node_ordering (GtkModelButton *button)
     {
       if (button->start_indicator)
         {
-          gtk_widget_add_css_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_css_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (button->start_indicator, "left");
+          gtk_widget_remove_css_class (button->start_indicator, "right");
         }
 
       if (button->end_indicator)
         {
-          gtk_widget_add_css_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_css_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (button->end_indicator, "right");
+          gtk_widget_remove_css_class (button->end_indicator, "left");
         }
 
       child = gtk_widget_get_first_child (GTK_WIDGET (button));
@@ -328,14 +328,14 @@ update_node_ordering (GtkModelButton *button)
     {
       if (button->start_indicator)
         {
-          gtk_widget_add_css_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_css_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (button->start_indicator, "right");
+          gtk_widget_remove_css_class (button->start_indicator, "left");
         }
 
       if (button->end_indicator)
         {
-          gtk_widget_add_css_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_css_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (button->end_indicator, "left");
+          gtk_widget_remove_css_class (button->end_indicator, "right");
 
         }
 
@@ -359,13 +359,13 @@ update_end_indicator (GtkModelButton *self)
 
   if (is_ltr)
     {
-      gtk_widget_add_css_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
-      gtk_widget_remove_css_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_add_css_class (self->end_indicator, "right");
+      gtk_widget_remove_css_class (self->end_indicator, "left");
     }
   else
     {
-      gtk_widget_add_css_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
-      gtk_widget_remove_css_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_add_css_class (self->end_indicator, "left");
+      gtk_widget_remove_css_class (self->end_indicator, "right");
     }
 }
 
@@ -398,13 +398,13 @@ update_start_indicator (GtkModelButton *self)
 
   if (is_ltr)
     {
-      gtk_widget_add_css_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
-      gtk_widget_remove_css_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_add_css_class (self->start_indicator, "left");
+      gtk_widget_remove_css_class (self->start_indicator, "right");
     }
   else
     {
-      gtk_widget_add_css_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
-      gtk_widget_remove_css_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_add_css_class (self->start_indicator, "right");
+      gtk_widget_remove_css_class (self->start_indicator, "left");
     }
 
 }
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 674ab15192..b1bf809a3c 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -1426,7 +1426,7 @@ do_popup_menu_for_process_tree_view (GtkWidget         *widget,
 
   menu = gtk_popover_new ();
   gtk_widget_set_parent (menu, widget);
-  gtk_widget_add_css_class (menu, GTK_STYLE_CLASS_CONTEXT_MENU);
+  gtk_widget_add_css_class (menu, "context-menu");
 
   item = gtk_model_button_new ();
   g_object_set (item, "text", _("_End Process"), NULL);
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 95108c1dd0..cdf873861f 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1400,7 +1400,7 @@ gtk_notebook_init (GtkNotebook *notebook)
   notebook->header_widget = g_object_new (GTK_TYPE_BOX,
                                           "css-name", "header",
                                           NULL);
-  gtk_widget_add_css_class (notebook->header_widget, GTK_STYLE_CLASS_TOP);
+  gtk_widget_add_css_class (notebook->header_widget, "top");
   gtk_widget_hide (notebook->header_widget);
   gtk_widget_set_parent (notebook->header_widget, GTK_WIDGET (notebook));
 
@@ -1437,7 +1437,7 @@ gtk_notebook_init (GtkNotebook *notebook)
   g_signal_connect (controller, "motion", G_CALLBACK (gtk_notebook_motion), notebook);
   gtk_widget_add_controller (GTK_WIDGET (notebook), controller);
 
-  gtk_widget_add_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+  gtk_widget_add_css_class (GTK_WIDGET (notebook), "frame");
 
   layout = gtk_widget_get_layout_manager (GTK_WIDGET (notebook));
   gtk_orientable_set_orientation (GTK_ORIENTABLE (layout), GTK_ORIENTATION_VERTICAL);
@@ -2641,7 +2641,7 @@ static void
 tab_drag_begin (GtkNotebook     *notebook,
                 GtkNotebookPage *page)
 {
-  gtk_widget_add_css_class (page->tab_widget, GTK_STYLE_CLASS_DND);
+  gtk_widget_add_css_class (page->tab_widget, "dnd");
 }
 
 /* This function undoes the reparenting that happens both when drag_surface
@@ -2659,7 +2659,7 @@ tab_drag_end (GtkNotebook     *notebook,
       g_object_unref (page->tab_label);
     }
 
-  gtk_widget_remove_css_class (page->tab_widget, GTK_STYLE_CLASS_DND);
+  gtk_widget_remove_css_class (page->tab_widget, "dnd");
 }
 
 static void
@@ -5977,9 +5977,9 @@ gtk_notebook_set_show_border (GtkNotebook *notebook,
       notebook->show_border = show_border;
 
       if (show_border)
-        gtk_widget_add_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_add_css_class (GTK_WIDGET (notebook), "frame");
       else
-        gtk_widget_remove_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_remove_css_class (GTK_WIDGET (notebook), "frame");
 
       g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_SHOW_BORDER]);
     }
@@ -6085,10 +6085,7 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
   GtkLayoutManager *layout;
   GtkPositionType tab_pos;
   const char *tab_pos_names[] = {
-    GTK_STYLE_CLASS_LEFT,
-    GTK_STYLE_CLASS_RIGHT,
-    GTK_STYLE_CLASS_TOP,
-    GTK_STYLE_CLASS_BOTTOM
+    "left", "right", "top", "bottom",
   };
   int i;
 
diff --git a/gtk/gtkoverlaylayout.c b/gtk/gtkoverlaylayout.c
index e861f54016..b6f64069d5 100644
--- a/gtk/gtkoverlaylayout.c
+++ b/gtk/gtkoverlaylayout.c
@@ -350,10 +350,10 @@ gtk_overlay_child_update_style_classes (GtkOverlay *overlay,
   gboolean is_left, is_right, is_top, is_bottom;
   gboolean has_left, has_right, has_top, has_bottom;
 
-  has_left = gtk_widget_has_css_class (widget, GTK_STYLE_CLASS_LEFT);
-  has_right = gtk_widget_has_css_class (widget, GTK_STYLE_CLASS_RIGHT);
-  has_top = gtk_widget_has_css_class (widget, GTK_STYLE_CLASS_TOP);
-  has_bottom = gtk_widget_has_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
+  has_left = gtk_widget_has_css_class (widget, "left");
+  has_right = gtk_widget_has_css_class (widget, "right");
+  has_top = gtk_widget_has_css_class (widget, "top");
+  has_bottom = gtk_widget_has_css_class (widget, "bottom");
 
   is_left = is_right = is_top = is_bottom = FALSE;
 
@@ -376,24 +376,24 @@ gtk_overlay_child_update_style_classes (GtkOverlay *overlay,
     is_bottom = (child_allocation->y + child_allocation->height == height);
 
   if (has_left && !is_left)
-    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_remove_css_class (widget, "left");
   else if (!has_left && is_left)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_add_css_class (widget, "left");
 
   if (has_right && !is_right)
-    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_remove_css_class (widget, "right");
   else if (!has_right && is_right)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_add_css_class (widget, "right");
 
   if (has_top && !is_top)
-    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_remove_css_class (widget, "top");
   else if (!has_top && is_top)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_add_css_class (widget, "top");
 
   if (has_bottom && !is_bottom)
-    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_remove_css_class (widget, "bottom");
   else if (!has_bottom && is_bottom)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_add_css_class (widget, "bottom");
 }
 
 static void
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index cd0676e824..f7d06e8743 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -2498,9 +2498,9 @@ gtk_paned_set_wide_handle (GtkPaned *paned,
   if (old_wide != wide)
     {
       if (wide)
-        gtk_widget_add_css_class (paned->handle_widget, GTK_STYLE_CLASS_WIDE);
+        gtk_widget_add_css_class (paned->handle_widget, "wide");
       else
-        gtk_widget_remove_css_class (paned->handle_widget, GTK_STYLE_CLASS_WIDE);
+        gtk_widget_remove_css_class (paned->handle_widget, "wide");
 
       g_object_notify_by_pspec (G_OBJECT (paned), paned_props[PROP_WIDE_HANDLE]);
     }
@@ -2519,5 +2519,5 @@ gtk_paned_get_wide_handle (GtkPaned *paned)
 {
   g_return_val_if_fail (GTK_IS_PANED (paned), FALSE);
 
-  return gtk_widget_has_css_class (paned->handle_widget, GTK_STYLE_CLASS_WIDE);
+  return gtk_widget_has_css_class (paned->handle_widget, "wide");
 }
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index bf9ec5e67f..7b52d40b01 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -223,7 +223,7 @@ gtk_path_bar_init (GtkPathBar *path_bar)
   g_signal_connect_swapped (path_bar->down_slider_button, "clicked",
                            G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
 
-  gtk_widget_add_css_class (GTK_WIDGET (path_bar), GTK_STYLE_CLASS_LINKED);
+  gtk_widget_add_css_class (GTK_WIDGET (path_bar), "linked");
 
   path_bar->get_info_cancellable = NULL;
   path_bar->cancellables = NULL;
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index f861c0ec58..9bdd919547 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1887,9 +1887,9 @@ on_address_entry_text_changed (GtkPlacesView *view)
 out:
   gtk_widget_set_sensitive (view->connect_button, supported);
   if (scheme && !supported)
-    gtk_widget_add_css_class (view->address_entry, GTK_STYLE_CLASS_ERROR);
+    gtk_widget_add_css_class (view->address_entry, "error");
   else
-    gtk_widget_remove_css_class (view->address_entry, GTK_STYLE_CLASS_ERROR);
+    gtk_widget_remove_css_class (view->address_entry, "error");
 
   g_free (address);
   g_free (scheme);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 0b31b893ff..f42e20a147 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -336,24 +336,24 @@ update_node_classes (GtkProgressBar *pbar)
     }
 
   if (left)
-    gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_add_css_class (pbar->progress_widget, "left");
   else
-    gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_remove_css_class (pbar->progress_widget, "left");
 
   if (right)
-    gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_add_css_class (pbar->progress_widget, "right");
   else
-    gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_remove_css_class (pbar->progress_widget, "right");
 
   if (top)
-    gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_add_css_class (pbar->progress_widget, "top");
   else
-    gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_remove_css_class (pbar->progress_widget, "top");
 
   if (bottom)
-    gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_add_css_class (pbar->progress_widget, "bottom");
   else
-    gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_remove_css_class (pbar->progress_widget, "bottom");
 
   update_fraction_classes (pbar);
 }
@@ -661,7 +661,7 @@ gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
   GtkWidget *widget = GTK_WIDGET (pbar);
   gboolean inverted;
 
-  gtk_widget_add_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
+  gtk_widget_add_css_class (pbar->progress_widget, "pulse");
   gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
                                GTK_ACCESSIBLE_STATE_BUSY, TRUE,
                                -1);
@@ -705,7 +705,7 @@ gtk_progress_bar_act_mode_leave (GtkProgressBar *pbar)
   gtk_accessible_update_state (GTK_ACCESSIBLE (pbar),
                                GTK_ACCESSIBLE_STATE_BUSY, FALSE,
                                -1);
-  gtk_widget_remove_css_class (pbar->progress_widget, GTK_STYLE_CLASS_PULSE);
+  gtk_widget_remove_css_class (pbar->progress_widget, "pulse");
   update_node_classes (pbar);
 }
 
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index ef8b1f4f91..4ffac29534 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -731,13 +731,13 @@ update_highlight_position (GtkRange *range)
 
   if (should_invert (range))
     {
-      gtk_widget_add_css_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_css_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_add_css_class (priv->highlight_widget, "bottom");
+      gtk_widget_remove_css_class (priv->highlight_widget, "top");
     }
   else
     {
-      gtk_widget_add_css_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_remove_css_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_add_css_class (priv->highlight_widget, "top");
+      gtk_widget_remove_css_class (priv->highlight_widget, "bottom");
     }
 }
 
@@ -751,13 +751,13 @@ update_fill_position (GtkRange *range)
 
   if (should_invert (range))
     {
-      gtk_widget_add_css_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_css_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_add_css_class (priv->fill_widget, "bottom");
+      gtk_widget_remove_css_class (priv->fill_widget, "top");
     }
   else
     {
-      gtk_widget_add_css_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_remove_css_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_add_css_class (priv->fill_widget, "top");
+      gtk_widget_remove_css_class (priv->fill_widget, "bottom");
     }
 }
 
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 4317ac2baa..ce70f9f5e9 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1046,19 +1046,28 @@ update_value_position (GtkScale *scale)
   if (!priv->value_widget)
     return;
 
-  gtk_widget_remove_css_class (priv->value_widget, GTK_STYLE_CLASS_TOP);
-  gtk_widget_remove_css_class (priv->value_widget, GTK_STYLE_CLASS_RIGHT);
-  gtk_widget_remove_css_class (priv->value_widget, GTK_STYLE_CLASS_BOTTOM);
-  gtk_widget_remove_css_class (priv->value_widget, GTK_STYLE_CLASS_LEFT);
+  gtk_widget_remove_css_class (priv->value_widget, "top");
+  gtk_widget_remove_css_class (priv->value_widget, "right");
+  gtk_widget_remove_css_class (priv->value_widget, "bottom");
+  gtk_widget_remove_css_class (priv->value_widget, "left");
 
   switch (priv->value_pos)
     {
-    case GTK_POS_TOP:    gtk_widget_add_css_class (priv->value_widget, GTK_STYLE_CLASS_TOP); break;
-    case GTK_POS_RIGHT:  gtk_widget_add_css_class (priv->value_widget, GTK_STYLE_CLASS_RIGHT); break;
-    case GTK_POS_BOTTOM: gtk_widget_add_css_class (priv->value_widget, GTK_STYLE_CLASS_BOTTOM); break;
-    case GTK_POS_LEFT:   gtk_widget_add_css_class (priv->value_widget, GTK_STYLE_CLASS_LEFT); break;
-
-    default: g_assert_not_reached ();
+    case GTK_POS_TOP:
+      gtk_widget_add_css_class (priv->value_widget, "top");
+      break;
+    case GTK_POS_RIGHT:
+      gtk_widget_add_css_class (priv->value_widget, "right");
+      break;
+    case GTK_POS_BOTTOM:
+      gtk_widget_add_css_class (priv->value_widget, "bottom");
+      break;
+    case GTK_POS_LEFT:
+      gtk_widget_add_css_class (priv->value_widget, "left");
+      break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
@@ -1700,7 +1709,7 @@ gtk_scale_add_mark (GtkScale        *scale,
           gtk_widget_insert_after (priv->top_marks_widget,
                                    GTK_WIDGET (scale),
                                    priv->value_widget);
-          gtk_widget_add_css_class (priv->top_marks_widget, GTK_STYLE_CLASS_TOP);
+          gtk_widget_add_css_class (priv->top_marks_widget, "top");
         }
       marks_widget = priv->top_marks_widget;
     }
@@ -1718,7 +1727,7 @@ gtk_scale_add_mark (GtkScale        *scale,
           gtk_widget_insert_before (priv->bottom_marks_widget,
                                     GTK_WIDGET (scale),
                                     gtk_range_get_trough_widget (GTK_RANGE (scale)));
-          gtk_widget_add_css_class (priv->bottom_marks_widget, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_add_css_class (priv->bottom_marks_widget, "bottom");
         }
       marks_widget = priv->bottom_marks_widget;
     }
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 13a5803ca6..779ff18591 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -497,13 +497,13 @@ update_scrollbar_positions (GtkScrolledWindow *scrolled_window)
       if (priv->window_placement == GTK_CORNER_TOP_LEFT ||
           priv->window_placement == GTK_CORNER_TOP_RIGHT)
         {
-          gtk_widget_add_css_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
-          gtk_widget_remove_css_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
+          gtk_widget_add_css_class (priv->hscrollbar, "bottom");
+          gtk_widget_remove_css_class (priv->hscrollbar, "top");
         }
       else
         {
-          gtk_widget_add_css_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
-          gtk_widget_remove_css_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_add_css_class (priv->hscrollbar, "top");
+          gtk_widget_remove_css_class (priv->hscrollbar, "bottom");
         }
     }
 
@@ -517,13 +517,13 @@ update_scrollbar_positions (GtkScrolledWindow *scrolled_window)
           (priv->window_placement == GTK_CORNER_TOP_LEFT ||
            priv->window_placement == GTK_CORNER_BOTTOM_LEFT)))
         {
-          gtk_widget_add_css_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_css_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (priv->vscrollbar, "right");
+          gtk_widget_remove_css_class (priv->vscrollbar, "left");
         }
       else
         {
-          gtk_widget_add_css_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_css_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (priv->vscrollbar, "left");
+          gtk_widget_remove_css_class (priv->vscrollbar, "right");
         }
     }
 }
@@ -1955,10 +1955,10 @@ gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
   GtkEventController *controller;
   GtkCssNode *widget_node;
   GQuark classes[4] = {
-    g_quark_from_static_string (GTK_STYLE_CLASS_LEFT),
-    g_quark_from_static_string (GTK_STYLE_CLASS_RIGHT),
-    g_quark_from_static_string (GTK_STYLE_CLASS_TOP),
-    g_quark_from_static_string (GTK_STYLE_CLASS_BOTTOM),
+    g_quark_from_static_string ("left"),
+    g_quark_from_static_string ("right"),
+    g_quark_from_static_string ("top"),
+    g_quark_from_static_string ("bottom"),
   };
   int i;
 
@@ -2467,9 +2467,9 @@ gtk_scrolled_window_set_has_frame (GtkScrolledWindow *scrolled_window,
   priv->has_frame = has_frame;
 
   if (has_frame)
-    gtk_widget_add_css_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
+    gtk_widget_add_css_class (GTK_WIDGET (scrolled_window), "frame");
   else
-    gtk_widget_remove_css_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
+    gtk_widget_remove_css_class (GTK_WIDGET (scrolled_window), "frame");
 
   g_object_notify_by_pspec (G_OBJECT (scrolled_window), properties[PROP_HAS_FRAME]);
 }
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index aa8407611b..bf82df0823 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -393,7 +393,7 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
                                  "visible", FALSE,
                                  NULL);
 
-  gtk_widget_remove_css_class (GTK_WIDGET (self->switcher), GTK_STYLE_CLASS_LINKED);
+  gtk_widget_remove_css_class (GTK_WIDGET (self->switcher), "linked");
 
   self->show_all = gtk_button_new_with_mnemonic (_("_Show All"));
   gtk_widget_hide (self->show_all);
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index 3c7d17887b..286a4b482f 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -766,6 +766,6 @@ gtk_shortcuts_shortcut_init (GtkShortcutsShortcut *self)
                                  "visible", FALSE,
                                  "xalign", 0.0f,
                                  NULL);
-  gtk_widget_add_css_class (GTK_WIDGET (self->subtitle), GTK_STYLE_CLASS_DIM_LABEL);
+  gtk_widget_add_css_class (GTK_WIDGET (self->subtitle), "dim-label");
   gtk_box_append (GTK_BOX (self->title_box), GTK_WIDGET (self->subtitle));
 }
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 64add4c38f..e373c5d1ad 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -896,12 +896,12 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
 
   /* Translators: This is the window title for the shortcuts window in normal mode */
   label = gtk_label_new (_("Shortcuts"));
-  gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (label, "title");
   gtk_stack_add_named (priv->title_stack, label, "title");
 
   /* Translators: This is the window title for the shortcuts window in search mode */
   label = gtk_label_new (_("Search Results"));
-  gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (label, "title");
   gtk_stack_add_named (priv->title_stack, label, "search");
 
   priv->menu_button = g_object_new (GTK_TYPE_MENU_BUTTON,
@@ -978,7 +978,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
                         "halign", GTK_ALIGN_CENTER,
                         "valign", GTK_ALIGN_CENTER,
                         NULL);
-  gtk_widget_add_css_class (empty, GTK_STYLE_CLASS_DIM_LABEL);
+  gtk_widget_add_css_class (empty, "dim-label");
   gtk_grid_attach (GTK_GRID (empty),
                    g_object_new (GTK_TYPE_IMAGE,
                                  "icon-name", "edit-find-symbolic",
diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c
index 81ac989425..8daf3e4fdf 100644
--- a/gtk/gtkstacksidebar.c
+++ b/gtk/gtkstacksidebar.c
@@ -200,9 +200,9 @@ update_row (GtkStackSidebar *self,
   gtk_widget_set_visible (row, visible && title != NULL);
 
   if (needs_attention)
-    gtk_widget_add_css_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_add_css_class (row, "needs-attention");
   else
-    gtk_widget_remove_css_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_remove_css_class (row, "needs-attention");
 
   g_free (title);
 }
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 76985afdf6..cf452db7cc 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -179,9 +179,9 @@ update_button (GtkStackSwitcher *self,
   gtk_widget_set_visible (button, visible && (title != NULL || icon_name != NULL));
 
   if (needs_attention)
-    gtk_widget_add_css_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_add_css_class (button, "needs-attention");
   else
-    gtk_widget_remove_css_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_remove_css_class (button, "needs-attention");
 
   g_free (title);
   g_free (icon_name);
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index bd4dde7646..09cce1a0bc 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -57,776 +57,6 @@ struct _GtkStyleContextClass
   void (*_gtk_reserved4) (void);
 };
 
-/* Predefined set of CSS classes */
-
-/**
- * GTK_STYLE_CLASS_CELL:
- *
- * A CSS class to match content rendered in cell views.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CELL "cell"
-
-/**
- * GTK_STYLE_CLASS_DIM_LABEL:
- *
- * A CSS class to match dimmed labels.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_DIM_LABEL "dim-label"
-
-/**
- * GTK_STYLE_CLASS_ENTRY:
- *
- * A CSS class to match text entries.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_ENTRY "entry"
-
-/**
- * GTK_STYLE_CLASS_LABEL:
- *
- * A CSS class to match labels.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LABEL "label"
-
-/**
- * GTK_STYLE_CLASS_COMBOBOX_ENTRY:
- *
- * A CSS class to match combobox entries.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_COMBOBOX_ENTRY "combobox-entry"
-
-/**
- * GTK_STYLE_CLASS_BUTTON:
- *
- * A CSS class to match buttons.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_BUTTON "button"
-
-/**
- * GTK_STYLE_CLASS_LIST:
- *
- * A CSS class to match lists.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LIST "list"
-
-/**
- * GTK_STYLE_CLASS_LIST_ROW:
- *
- * A CSS class to match list rows.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LIST_ROW "list-row"
-
-/**
- * GTK_STYLE_CLASS_CALENDAR:
- *
- * A CSS class to match calendars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CALENDAR "calendar"
-
-/**
- * GTK_STYLE_CLASS_SLIDER:
- *
- * A CSS class to match sliders.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SLIDER "slider"
-
-/**
- * GTK_STYLE_CLASS_BACKGROUND:
- *
- * A CSS class to match the window background.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_BACKGROUND "background"
-
-/**
- * GTK_STYLE_CLASS_RUBBERBAND:
- *
- * A CSS class to match the rubberband selection rectangle.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_RUBBERBAND "rubberband"
-
-/**
- * GTK_STYLE_CLASS_CSD:
- *
- * A CSS class that gets added to windows which have client-side decorations.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CSD "csd"
-
-/**
- * GTK_STYLE_CLASS_TOOLTIP:
- *
- * A CSS class to match tooltip windows.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TOOLTIP "tooltip"
-
-/**
- * GTK_STYLE_CLASS_MENU:
- *
- * A CSS class to match menus.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MENU "menu"
-
-/**
- * GTK_STYLE_CLASS_CONTEXT_MENU:
- *
- * A CSS class to match context menus.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CONTEXT_MENU "context-menu"
-
-/**
- * GTK_STYLE_CLASS_TOUCH_SELECTION:
- *
- * A CSS class for touch selection popups on entries
- * and text views.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TOUCH_SELECTION "touch-selection"
-
-/**
- * GTK_STYLE_CLASS_MENUBAR:
- *
- * A CSS class to menubars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MENUBAR "menubar"
-
-/**
- * GTK_STYLE_CLASS_MENUITEM:
- *
- * A CSS class to match menu items.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MENUITEM "menuitem"
-
-/**
- * GTK_STYLE_CLASS_TOOLBAR:
- *
- * A CSS class to match toolbars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TOOLBAR "toolbar"
-
-/**
- * GTK_STYLE_CLASS_STATUSBAR:
- *
- * A CSS class to match statusbars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_STATUSBAR "statusbar"
-
-/**
- * GTK_STYLE_CLASS_RADIO:
- *
- * A CSS class to match radio buttons.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_RADIO "radio"
-
-/**
- * GTK_STYLE_CLASS_CHECK:
- *
- * A CSS class to match check boxes.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CHECK "check"
-
-/**
- * GTK_STYLE_CLASS_DEFAULT:
- *
- * A CSS class to match the default widget.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_DEFAULT "default"
-
-/**
- * GTK_STYLE_CLASS_TROUGH:
- *
- * A CSS class to match troughs, as in scrollbars and progressbars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TROUGH "trough"
-
-/**
- * GTK_STYLE_CLASS_SCROLLBAR:
- *
- * A CSS class to match scrollbars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SCROLLBAR "scrollbar"
-
-/**
- * GTK_STYLE_CLASS_SCROLLBARS_JUNCTION:
- *
- * A CSS class to match the junction area between a horizontal
- * and vertical scrollbar, when they’re both shown.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SCROLLBARS_JUNCTION "scrollbars-junction"
-
-/**
- * GTK_STYLE_CLASS_SCALE:
- *
- * A CSS class to match scale widgets.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SCALE "scale"
-
-/**
- * GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE:
- *
- * A CSS class to match scale widgets with marks attached,
- * all the marks are above for horizontal #GtkScale.
- * left for vertical #GtkScale.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE "scale-has-marks-above"
-
-/**
- * GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW:
- *
- * A CSS class to match scale widgets with marks attached,
- * all the marks are below for horizontal #GtkScale,
- * right for vertical #GtkScale.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW "scale-has-marks-below"
-
-/**
- * GTK_STYLE_CLASS_HEADER:
- *
- * A CSS class to match a header element.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_HEADER "header"
-
-/**
- * GTK_STYLE_CLASS_ACCELERATOR:
- *
- * A CSS class to match an accelerator.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_ACCELERATOR "accelerator"
-
-/**
- * GTK_STYLE_CLASS_RAISED:
- *
- * A CSS class to match a raised control, such as a raised
- * button on a toolbar.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_RAISED "raised"
-
-/**
- * GTK_STYLE_CLASS_LINKED:
- *
- * A CSS class to match a linked area, such as a box containing buttons
- * belonging to the same control.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LINKED "linked"
-
-/**
- * GTK_STYLE_CLASS_DOCK:
- *
- * A CSS class defining a dock area.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_DOCK "dock"
-
-/**
- * GTK_STYLE_CLASS_PROGRESSBAR:
- *
- * A CSS class to use when rendering activity as a progressbar.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_PROGRESSBAR "progressbar"
-
-/**
- * GTK_STYLE_CLASS_SPINNER:
- *
- * A CSS class to use when rendering activity as a “spinner”.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SPINNER "spinner"
-
-/**
- * GTK_STYLE_CLASS_MARK:
- *
- * A CSS class defining marks in a widget, such as in scales.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MARK "mark"
-
-/**
- * GTK_STYLE_CLASS_EXPANDER:
- *
- * A CSS class defining an expander, such as those in treeviews.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_EXPANDER "expander"
-
-/**
- * GTK_STYLE_CLASS_SPINBUTTON:
- *
- * A CSS class defining a spinbutton.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SPINBUTTON "spinbutton"
-
-/**
- * GTK_STYLE_CLASS_NOTEBOOK:
- *
- * A CSS class defining a notebook.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_NOTEBOOK "notebook"
-
-/**
- * GTK_STYLE_CLASS_VIEW:
- *
- * A CSS class defining a view, such as iconviews or treeviews.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_VIEW "view"
-
-/**
- * GTK_STYLE_CLASS_SIDEBAR:
- *
- * A CSS class defining a sidebar, such as the left side in
- * a file chooser.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SIDEBAR "sidebar"
-
-/**
- * GTK_STYLE_CLASS_IMAGE:
- *
- * A CSS class defining an image, such as the icon in an entry.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_IMAGE "image"
-
-/**
- * GTK_STYLE_CLASS_HIGHLIGHT:
- *
- * A CSS class defining a highlighted area, such as headings in
- * assistants and calendars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_HIGHLIGHT "highlight"
-
-/**
- * GTK_STYLE_CLASS_FRAME:
- *
- * A CSS class defining a frame delimiting content, such as
- * #GtkFrame or the scrolled window frame around the
- * scrollable area.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_FRAME "frame"
-
-/**
- * GTK_STYLE_CLASS_DND:
- *
- * A CSS class for a drag-and-drop indicator.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_DND "dnd"
-
-/**
- * GTK_STYLE_CLASS_PANE_SEPARATOR:
- *
- * A CSS class for a pane separator, such as those in #GtkPaned.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
-
-/**
- * GTK_STYLE_CLASS_SEPARATOR:
- *
- * A CSS class for a separator.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SEPARATOR "separator"
-
-/**
- * GTK_STYLE_CLASS_INFO:
- *
- * A CSS class for an area displaying an informational message,
- * such as those in infobars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_INFO "info"
-
-/**
- * GTK_STYLE_CLASS_WARNING:
- *
- * A CSS class for an area displaying a warning message,
- * such as those in infobars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_WARNING "warning"
-
-/**
- * GTK_STYLE_CLASS_QUESTION:
- *
- * A CSS class for an area displaying a question to the user,
- * such as those in infobars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_QUESTION "question"
-
-/**
- * GTK_STYLE_CLASS_ERROR:
- *
- * A CSS class for an area displaying an error message,
- * such as those in infobars.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_ERROR "error"
-
-/**
- * GTK_STYLE_CLASS_HORIZONTAL:
- *
- * A CSS class for horizontally layered widgets.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_HORIZONTAL "horizontal"
-
-/**
- * GTK_STYLE_CLASS_VERTICAL:
- *
- * A CSS class for vertically layered widgets.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_VERTICAL "vertical"
-
-/**
- * GTK_STYLE_CLASS_TOP:
- *
- * A CSS class to indicate an area at the top of a widget.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TOP "top"
-
-/**
- * GTK_STYLE_CLASS_BOTTOM:
- *
- * A CSS class to indicate an area at the bottom of a widget.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_BOTTOM "bottom"
-
-/**
- * GTK_STYLE_CLASS_LEFT:
- *
- * A CSS class to indicate an area at the left of a widget.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LEFT "left"
-
-/**
- * GTK_STYLE_CLASS_RIGHT:
- *
- * A CSS class to indicate an area at the right of a widget.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_RIGHT "right"
-
-/**
- * GTK_STYLE_CLASS_PULSE:
- *
- * A CSS class to use when rendering a pulse in an indeterminate progress bar.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_PULSE "pulse"
-
-/**
- * GTK_STYLE_CLASS_ARROW:
- *
- * A CSS class used when rendering an arrow element.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_ARROW "arrow"
-
-/**
- * GTK_STYLE_CLASS_OSD:
- *
- * A CSS class used when rendering an OSD (On Screen Display) element,
- * on top of another container.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_OSD "osd"
-
-/**
- * GTK_STYLE_CLASS_LEVEL_BAR:
- *
- * A CSS class used when rendering a level indicator, such
- * as a battery charge level, or a password strength.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_LEVEL_BAR "level-bar"
-
-/**
- * GTK_STYLE_CLASS_CURSOR_HANDLE:
- *
- * A CSS class used when rendering a drag handle for
- * text selection.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_CURSOR_HANDLE "cursor-handle"
-
-/**
- * GTK_STYLE_CLASS_INSERTION_CURSOR:
- *
- * A CSS class used when rendering a drag handle for
- * the insertion cursor position.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_INSERTION_CURSOR "insertion-cursor"
-
-/**
- * GTK_STYLE_CLASS_TITLEBAR:
- *
- * A CSS class used when rendering a titlebar in a toplevel window.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TITLEBAR "titlebar"
-
-/**
- * GTK_STYLE_CLASS_TITLE:
- *
- * A CSS class used for the title label in a titlebar in
- * a toplevel window.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_TITLE "title"
-
-/**
- * GTK_STYLE_CLASS_SUBTITLE:
- *
- * A CSS class used for the subtitle label in a titlebar in
- * a toplevel window.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SUBTITLE "subtitle"
-
-/**
- * GTK_STYLE_CLASS_NEEDS_ATTENTION:
- *
- * A CSS class used when an element needs the user attention,
- * for instance a button in a stack switcher corresponding to
- * a hidden page that changed state.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_NEEDS_ATTENTION "needs-attention"
-
-/**
- * GTK_STYLE_CLASS_SUGGESTED_ACTION:
- *
- * A CSS class used when an action (usually a button) is the
- * primary suggested action in a specific context.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_SUGGESTED_ACTION "suggested-action"
-
-/**
- * GTK_STYLE_CLASS_DESTRUCTIVE_ACTION:
- *
- * A CSS class used when an action (usually a button) is
- * one that is expected to remove or destroy something visible
- * to the user.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action"
-
-/**
- * GTK_STYLE_CLASS_POPOVER:
- *
- * A CSS class that matches popovers.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_POPOVER "popover"
-
-/* Predefined set of widget regions */
-
-/**
- * GTK_STYLE_CLASS_POPUP:
- *
- * A CSS class that is added to the toplevel windows used for menus.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_POPUP "popup"
-
-/**
- * GTK_STYLE_CLASS_MESSAGE_DIALOG:
- *
- * A CSS class that is added to message dialogs.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MESSAGE_DIALOG "message-dialog"
-
-/**
- * GTK_STYLE_CLASS_FLAT:
- *
- * A CSS class that is added when widgets that usually have
- * a frame or border (like buttons or entries) should appear
- * without it.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_FLAT "flat"
-
-/**
- * GTK_STYLE_CLASS_READ_ONLY:
- *
- * A CSS class used to indicate a read-only state.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_READ_ONLY "read-only"
-
-/**
- * GTK_STYLE_CLASS_OVERSHOOT:
- *
- * A CSS class that is added on the visual hints that happen
- * when scrolling is attempted past the limits of a scrollable
- * area.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_OVERSHOOT "overshoot"
-
-/**
- * GTK_STYLE_CLASS_UNDERSHOOT:
- *
- * A CSS class that is added on the visual hints that happen
- * where content is 'scrolled off' and can be made visible
- * by scrolling.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_UNDERSHOOT "undershoot"
-
-/**
- * GTK_STYLE_CLASS_PAPER:
- *
- * A CSS class that is added to areas that should look like paper.
- *
- * This is used in print previews and themes are encouraged to
- * style it as black text on white background.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_PAPER "paper"
-
-/**
- * GTK_STYLE_CLASS_MONOSPACE:
- *
- * A CSS class that is added to text view that should use
- * a monospace font.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_MONOSPACE "monospace"
-
-/**
- * GTK_STYLE_CLASS_WIDE:
- *
- * A CSS class to indicate that a UI element should be 'wide'.
- * Used by #GtkPaned.
- *
- * Refer to individual widget documentation for used style classes.
- */
-#define GTK_STYLE_CLASS_WIDE "wide"
 
 GDK_AVAILABLE_IN_ALL
 GType gtk_style_context_get_type (void) G_GNUC_CONST;
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 4317654df1..7d7d3e37ab 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1903,7 +1903,7 @@ gtk_text_init (GtkText *self)
     {
       priv->undershoot_node[i] = gtk_css_node_new ();
       gtk_css_node_set_name (priv->undershoot_node[i], g_quark_from_static_string ("undershoot"));
-      gtk_css_node_add_class (priv->undershoot_node[i], g_quark_from_static_string (i == 0 ? 
GTK_STYLE_CLASS_LEFT : GTK_STYLE_CLASS_RIGHT));
+      gtk_css_node_add_class (priv->undershoot_node[i], g_quark_from_static_string (i == 0 ? "left" : 
"right"));
       gtk_css_node_set_parent (priv->undershoot_node[i], widget_node);
       gtk_css_node_set_state (priv->undershoot_node[i], gtk_css_node_get_state (widget_node) & 
~GTK_STATE_FLAG_DROP_ACTIVE);
       g_object_unref (priv->undershoot_node[i]);
@@ -5383,11 +5383,11 @@ gtk_text_set_editable (GtkText  *self,
           priv->preedit_length = 0;
           priv->preedit_cursor = 0;
 
-          gtk_widget_remove_css_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
+          gtk_widget_remove_css_class (GTK_WIDGET (self), "read-only");
         }
       else
         {
-          gtk_widget_add_css_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
+          gtk_widget_add_css_class (GTK_WIDGET (self), "read-only");
         }
 
       priv->editable = is_editable;
@@ -6083,7 +6083,7 @@ gtk_text_selection_bubble_popup_show (gpointer user_data)
 
   priv->selection_bubble = gtk_popover_new ();
   gtk_widget_set_parent (priv->selection_bubble, GTK_WIDGET (self));
-  gtk_widget_add_css_class (priv->selection_bubble, GTK_STYLE_CLASS_TOUCH_SELECTION);
+  gtk_widget_add_css_class (priv->selection_bubble, "touch-selection");
   gtk_popover_set_position (GTK_POPOVER (priv->selection_bubble), GTK_POS_BOTTOM);
   gtk_popover_set_autohide (GTK_POPOVER (priv->selection_bubble), FALSE);
   g_signal_connect (priv->selection_bubble, "notify::visible",
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index 1cbd2b04d0..4353a6226d 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -404,21 +404,21 @@ gtk_text_handle_update_for_role (GtkTextHandle *handle)
 
   if (handle->role == GTK_TEXT_HANDLE_ROLE_CURSOR)
     {
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_INSERTION_CURSOR);
+      gtk_widget_remove_css_class (widget, "top");
+      gtk_widget_add_css_class (widget, "bottom");
+      gtk_widget_add_css_class (widget, "insertion-cursor");
     }
   else if (handle->role == GTK_TEXT_HANDLE_ROLE_SELECTION_END)
     {
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_INSERTION_CURSOR);
+      gtk_widget_remove_css_class (widget, "top");
+      gtk_widget_add_css_class (widget, "bottom");
+      gtk_widget_remove_css_class (widget, "insertion-cursor");
     }
   else if (handle->role == GTK_TEXT_HANDLE_ROLE_SELECTION_START)
     {
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_INSERTION_CURSOR);
+      gtk_widget_add_css_class (widget, "top");
+      gtk_widget_remove_css_class (widget, "bottom");
+      gtk_widget_remove_css_class (widget, "insertion-cursor");
     }
 }
 
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 3b450dd552..53fe1dfd1a 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -1057,7 +1057,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
   /**
    * GtkTextView:monospace:
    *
-   * If %TRUE, set the %GTK_STYLE_CLASS_MONOSPACE style class on the
+   * If %TRUE, set the .monospace style class on the
    * text view to indicate that a monospace font is desired.
    */
   g_object_class_install_property (gobject_class,
@@ -1842,7 +1842,7 @@ gtk_text_view_init (GtkTextView *text_view)
   gtk_widget_set_focusable (widget, TRUE);
   gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
 
-  gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (widget, "view");
 
   gtk_widget_set_cursor_from_name (widget, "text");
 
@@ -8824,7 +8824,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
 
   priv->selection_bubble = gtk_popover_new ();
   gtk_widget_set_parent (priv->selection_bubble, GTK_WIDGET (text_view));
-  gtk_widget_add_css_class (priv->selection_bubble, GTK_STYLE_CLASS_TOUCH_SELECTION);
+  gtk_widget_add_css_class (priv->selection_bubble, "touch-selection");
   gtk_popover_set_position (GTK_POPOVER (priv->selection_bubble), GTK_POS_BOTTOM);
   gtk_popover_set_autohide (GTK_POPOVER (priv->selection_bubble), FALSE);
   g_signal_connect (priv->selection_bubble, "notify::visible",
@@ -9578,9 +9578,9 @@ gtk_text_view_set_monospace (GtkTextView *text_view,
   if (has_monospace != monospace)
     {
       if (monospace)
-        gtk_widget_add_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+        gtk_widget_add_css_class (GTK_WIDGET (text_view), "monospace");
       else
-        gtk_widget_remove_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+        gtk_widget_remove_css_class (GTK_WIDGET (text_view), "monospace");
 
       g_object_notify (G_OBJECT (text_view), "monospace");
     }
@@ -9599,7 +9599,7 @@ gtk_text_view_get_monospace (GtkTextView *text_view)
 {
   g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE);
 
-  return gtk_widget_has_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+  return gtk_widget_has_css_class (GTK_WIDGET (text_view), "monospace");
 }
 
 static void
diff --git a/gtk/gtktextviewchild.c b/gtk/gtktextviewchild.c
index 5046a249b9..dc7ad283ad 100644
--- a/gtk/gtktextviewchild.c
+++ b/gtk/gtktextviewchild.c
@@ -283,22 +283,22 @@ gtk_text_view_child_constructed (GObject *object)
     {
     case GTK_TEXT_WINDOW_LEFT:
       gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
-      gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_LEFT));
+      gtk_css_node_add_class (css_node, g_quark_from_static_string ("left"));
       break;
 
     case GTK_TEXT_WINDOW_RIGHT:
       gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
-      gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_RIGHT));
+      gtk_css_node_add_class (css_node, g_quark_from_static_string ("right"));
       break;
 
     case GTK_TEXT_WINDOW_TOP:
       gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
-      gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_TOP));
+      gtk_css_node_add_class (css_node, g_quark_from_static_string ("top"));
       break;
 
     case GTK_TEXT_WINDOW_BOTTOM:
       gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
-      gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_BOTTOM));
+      gtk_css_node_add_class (css_node, g_quark_from_static_string ("bottom"));
       break;
 
     case GTK_TEXT_WINDOW_TEXT:
diff --git a/gtk/gtktreepopover.c b/gtk/gtktreepopover.c
index 802c54f72c..0cca9bcaf6 100644
--- a/gtk/gtktreepopover.c
+++ b/gtk/gtktreepopover.c
@@ -261,7 +261,7 @@ gtk_tree_popover_init (GtkTreePopover *popover)
   gtk_stack_set_interpolate_size (GTK_STACK (stack), TRUE);
   gtk_popover_set_child (GTK_POPOVER (popover), stack);
 
-  gtk_widget_add_css_class (GTK_WIDGET (popover), GTK_STYLE_CLASS_MENU);
+  gtk_widget_add_css_class (GTK_WIDGET (popover), "menu");
 }
 
 static GtkCellArea *
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 98d9f40e5c..6e7de301cd 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1675,7 +1675,7 @@ gtk_tree_view_init (GtkTreeView *tree_view)
   gtk_tree_view_do_set_vadjustment (tree_view, NULL);
   gtk_tree_view_do_set_hadjustment (tree_view, NULL);
 
-  gtk_widget_add_css_class (GTK_WIDGET (tree_view), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (tree_view), "view");
 
   widget_node = gtk_widget_get_css_node (GTK_WIDGET (tree_view));
   priv->header_node = gtk_css_node_new ();
@@ -2714,7 +2714,7 @@ gtk_tree_view_get_expander_size (GtkTreeView *tree_view)
 
   context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
+  gtk_style_context_add_class (context, "expander");
 
   style = gtk_style_context_lookup_style (context);
   min_width = _gtk_css_number_value_get (style->size->min_width, 100);
@@ -3171,7 +3171,7 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view)
   button = gtk_tree_view_column_get_button (priv->drag_column);
 
   context = gtk_widget_get_style_context (button);
-  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_DND);
+  gtk_style_context_remove_class (context, "dnd");
 
   gtk_tree_view_update_button_position (tree_view, priv->drag_column);
   gtk_widget_queue_allocate (widget);
@@ -4433,7 +4433,7 @@ gtk_tree_view_bin_snapshot (GtkWidget   *widget,
   if (gtk_tree_view_get_height (tree_view) < bin_window_height)
     {
       gtk_style_context_save (context);
-      gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
+      gtk_style_context_add_class (context, "cell");
 
       gtk_snapshot_render_background (snapshot, context,
                                       0, gtk_tree_view_get_height (tree_view),
@@ -4634,7 +4634,7 @@ gtk_tree_view_bin_snapshot (GtkWidget   *widget,
           state = gtk_cell_renderer_get_state (NULL, widget, flags);
           gtk_style_context_set_state (context, state);
 
-          gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
+          gtk_style_context_add_class (context, "cell");
 
          if (node == priv->cursor_node && has_can_focus_cell
               && ((column == priv->focus_column
@@ -4677,7 +4677,7 @@ gtk_tree_view_bin_snapshot (GtkWidget   *widget,
                   GdkRGBA color;
 
                   gtk_style_context_save (context);
-                  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+                  gtk_style_context_add_class (context, "separator");
 
                   gtk_style_context_get_color (context, &color);
                   gtk_snapshot_append_color (snapshot,
@@ -4717,7 +4717,7 @@ gtk_tree_view_bin_snapshot (GtkWidget   *widget,
                   GdkRGBA color;
 
                   gtk_style_context_save (context);
-                  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+                  gtk_style_context_add_class (context, "separator");
 
                   gtk_style_context_get_color (context, &color);
                   gtk_snapshot_append_color (snapshot,
@@ -5040,7 +5040,7 @@ gtk_tree_view_snapshot (GtkWidget   *widget,
                           ));
 
   gtk_style_context_save (context);
-  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VIEW);
+  gtk_style_context_remove_class (context, "view");
 
   for (list = priv->columns; list != NULL; list = list->next)
     {
@@ -5545,7 +5545,7 @@ get_separator_height (GtkTreeView *tree_view)
 
   context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+  gtk_style_context_add_class (context, "separator");
 
   style = gtk_style_context_lookup_style (context);
   d = _gtk_css_number_value_get (style->size->min_height, 100);
@@ -5612,7 +5612,7 @@ validate_row (GtkTreeView   *tree_view,
 
   context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
+  gtk_style_context_add_class (context, "cell");
 
   for (list = priv->columns; list; list = list->next)
     {
@@ -9089,7 +9089,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
   button = gtk_tree_view_column_get_button (column);
 
   context = gtk_widget_get_style_context (button);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_DND);
+  gtk_style_context_add_class (context, "dnd");
 
   gtk_widget_get_allocation (button, &button_allocation);
   priv->drag_column_x = button_allocation.x;
@@ -9247,7 +9247,7 @@ gtk_tree_view_snapshot_arrow (GtkTreeView   *tree_view,
   gtk_style_context_save (context);
 
   gtk_style_context_set_state (context, state);
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
+  gtk_style_context_add_class (context, "expander");
 
   gtk_snapshot_save (snapshot);
   gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (area.x, area.y));
@@ -13284,7 +13284,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView  *tree_view,
               GdkRGBA color;
 
               gtk_style_context_save (context);
-              gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+              gtk_style_context_add_class (context, "separator");
 
               gtk_style_context_get_color (context, &color);
               gtk_snapshot_append_color (snapshot,
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index f53a504c5e..1348b2c5e0 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -475,7 +475,7 @@ gtk_viewport_init (GtkViewport *viewport)
   viewport->hadjustment = NULL;
   viewport->vadjustment = NULL;
 
-  gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_FRAME);
+  gtk_widget_add_css_class (widget, "frame");
   viewport_set_adjustment (viewport, GTK_ORIENTATION_HORIZONTAL, NULL);
   viewport_set_adjustment (viewport, GTK_ORIENTATION_VERTICAL, NULL);
 }
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8f92c09a88..771bae0841 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5109,9 +5109,9 @@ _gtk_widget_set_has_default (GtkWidget *widget,
   priv->has_default = has_default;
 
   if (has_default)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_DEFAULT);
+    gtk_widget_add_css_class (widget, "default");
   else
-    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_DEFAULT);
+    gtk_widget_remove_css_class (widget, "default");
 }
 
 /**
@@ -12084,13 +12084,13 @@ gtk_widget_update_orientation (GtkWidget      *widget,
 
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_HORIZONTAL);
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_VERTICAL);
+      gtk_widget_add_css_class (widget, "horizontal");
+      gtk_widget_remove_css_class (widget, "vertical");
     }
   else
     {
-      gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_VERTICAL);
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_HORIZONTAL);
+      gtk_widget_add_css_class (widget, "vertical");
+      gtk_widget_remove_css_class (widget, "horizontal");
     }
 }
 
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fddca6ed44..5807205741 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1491,7 +1491,7 @@ gtk_window_init (GtkWindow *window)
                     G_CALLBACK (gtk_window_on_theme_variant_changed), window);
 #endif
 
-  gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BACKGROUND);
+  gtk_widget_add_css_class (widget, "background");
 
   priv->scale = gtk_widget_get_scale_factor (widget);
 
@@ -2746,7 +2746,7 @@ gtk_window_enable_csd (GtkWindow *window)
 
   /* We need a visual with alpha for client shadows */
   if (priv->use_client_shadow)
-    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_CSD);
+    gtk_widget_add_css_class (widget, "csd");
   else
     gtk_widget_add_css_class (widget, "solid-csd");
 
@@ -2796,7 +2796,7 @@ gtk_window_set_titlebar (GtkWindow *window,
   if (titlebar == NULL)
     {
       priv->client_decorated = FALSE;
-      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_CSD);
+      gtk_widget_remove_css_class (widget, "csd");
 
       goto out;
     }
@@ -2807,7 +2807,7 @@ gtk_window_set_titlebar (GtkWindow *window,
   priv->title_box = titlebar;
   gtk_widget_insert_before (priv->title_box, widget, NULL);
 
-  gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
+  gtk_widget_add_css_class (titlebar, "titlebar");
 
 out:
   if (was_mapped)
@@ -4371,7 +4371,7 @@ gtk_window_realize (GtkWidget *widget)
             if (priv->title_box == NULL)
               {
                 priv->titlebar = gtk_header_bar_new ();
-                gtk_widget_add_css_class (priv->titlebar, GTK_STYLE_CLASS_TITLEBAR);
+                gtk_widget_add_css_class (priv->titlebar, "titlebar");
                 gtk_widget_add_css_class (priv->titlebar, "default-decoration");
 
                 gtk_widget_insert_before (priv->titlebar, widget, NULL);
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index ff746657cd..acea1268ac 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1519,7 +1519,7 @@ constructed (GObject *object)
 
   if (label)
     {
-      gtk_widget_add_css_class (label, GTK_STYLE_CLASS_DIM_LABEL);
+      gtk_widget_add_css_class (label, "dim-label");
       gtk_box_append (GTK_BOX (box), label);
     }
 
@@ -1533,7 +1533,7 @@ constructed (GObject *object)
   if (!can_modify)
     {
       label = gtk_label_new ("");
-      gtk_widget_add_css_class (label, GTK_STYLE_CLASS_DIM_LABEL);
+      gtk_widget_add_css_class (label, "dim-label");
       gtk_box_append (GTK_BOX (box), label);
 
       readonly_changed (self->object, spec, label);
diff --git a/gtk/inspector/size-groups.c b/gtk/inspector/size-groups.c
index 21c351b835..882794c10a 100644
--- a/gtk/inspector/size-groups.c
+++ b/gtk/inspector/size-groups.c
@@ -232,7 +232,7 @@ add_size_group (GtkInspectorSizeGroups *sl,
   frame = gtk_frame_new (NULL);
   gtk_box_append (GTK_BOX (sl), frame);
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-  gtk_widget_add_css_class (box, GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (box, "view");
   gtk_frame_set_child (GTK_FRAME (frame), box);
 
   box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
diff --git a/tests/testrevealer2.c b/tests/testrevealer2.c
index 736bdadfde..7aeb012e9a 100644
--- a/tests/testrevealer2.c
+++ b/tests/testrevealer2.c
@@ -42,7 +42,7 @@ on_activate (GApplication *app,
 
       sidebar = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
       gtk_widget_set_size_request (sidebar, 150, -1);
-      gtk_widget_add_css_class (sidebar, GTK_STYLE_CLASS_SIDEBAR);
+      gtk_widget_add_css_class (sidebar, "sidebar");
       gtk_revealer_set_child (GTK_REVEALER (revealer), sidebar);
 
       img = gtk_image_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]