[gtk] Rename gtk_widget{get,set,has}_style_class to _css_class



commit 655711fef29570254477864e25f0719a7762b2a7
Author: Timm Bäder <mail baedert org>
Date:   Thu Feb 6 17:32:26 2020 +0100

    Rename gtk_widget{get,set,has}_style_class to _css_class
    
    We want to use css instead of style everywhere now.

 docs/reference/gtk/gtk4-sections.txt |  6 ++--
 gtk/gtkappchooserdialog.c            |  4 +--
 gtk/gtkbutton.c                      | 14 ++++----
 gtk/gtkcalendar.c                    | 16 ++++-----
 gtk/gtkcheckbutton.c                 |  2 +-
 gtk/gtkcolorbutton.c                 |  2 +-
 gtk/gtkcolorchooserwidget.c          |  8 ++---
 gtk/gtkcoloreditor.c                 |  6 ++--
 gtk/gtkcolorscale.c                  |  2 +-
 gtk/gtkcolorswatch.c                 | 10 +++---
 gtk/gtkcombobox.c                    |  6 ++--
 gtk/gtkdialog.c                      |  6 ++--
 gtk/gtkemojichooser.c                |  2 +-
 gtk/gtkentry.c                       | 10 +++---
 gtk/gtkentrycompletion.c             |  2 +-
 gtk/gtkexpander.c                    |  2 +-
 gtk/gtkfontbutton.c                  |  2 +-
 gtk/gtkframe.c                       |  4 +--
 gtk/gtkheaderbar.c                   | 42 +++++++++++------------
 gtk/gtkiconview.c                    |  2 +-
 gtk/gtkinfobar.c                     | 10 +++---
 gtk/gtklinkbutton.c                  |  2 +-
 gtk/gtklistbox.c                     | 10 +++---
 gtk/gtklockbutton.c                  |  2 +-
 gtk/gtkmenubutton.c                  |  2 +-
 gtk/gtkmenusectionbox.c              | 14 ++++----
 gtk/gtkmessagedialog.c               |  2 +-
 gtk/gtkmodelbutton.c                 | 50 +++++++++++++--------------
 gtk/gtknotebook.c                    | 24 ++++++-------
 gtk/gtkorientable.c                  |  8 ++---
 gtk/gtkoverlaylayout.c               | 24 ++++++-------
 gtk/gtkpaned.c                       |  6 ++--
 gtk/gtkpasswordentry.c               |  4 +--
 gtk/gtkpathbar.c                     | 10 +++---
 gtk/gtkplacessidebar.c               | 10 +++---
 gtk/gtkplacesview.c                  |  8 ++---
 gtk/gtkpopovermenu.c                 |  2 +-
 gtk/gtkprogressbar.c                 | 28 +++++++--------
 gtk/gtkrange.c                       | 24 ++++++-------
 gtk/gtkscale.c                       | 28 +++++++--------
 gtk/gtkscalebutton.c                 |  2 +-
 gtk/gtkscrolledwindow.c              | 28 +++++++--------
 gtk/gtksearchbar.c                   |  2 +-
 gtk/gtksearchentry.c                 |  2 +-
 gtk/gtkshortcutlabel.c               |  4 +--
 gtk/gtkshortcutssection.c            |  6 ++--
 gtk/gtkshortcutswindow.c             | 10 +++---
 gtk/gtksidebarrow.c                  |  2 +-
 gtk/gtkspinbutton.c                  |  4 +--
 gtk/gtkstacksidebar.c                |  6 ++--
 gtk/gtkstackswitcher.c               | 14 ++++----
 gtk/gtktext.c                        | 12 +++----
 gtk/gtktexthandle.c                  |  6 ++--
 gtk/gtktextview.c                    | 16 ++++-----
 gtk/gtktogglebutton.c                |  2 +-
 gtk/gtktreepopover.c                 |  8 ++---
 gtk/gtktreeview.c                    |  2 +-
 gtk/gtkviewport.c                    |  6 ++--
 gtk/gtkwidget.c                      | 66 ++++++++++++++++++------------------
 gtk/gtkwidget.h                      | 12 +++----
 gtk/gtkwindow.c                      | 40 +++++++++++-----------
 61 files changed, 333 insertions(+), 333 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 939e29802b..876c625b4b 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4189,9 +4189,9 @@ gtk_widget_insert_after
 gtk_widget_set_layout_manager
 gtk_widget_get_layout_manager
 gtk_widget_should_layout
-gtk_widget_add_style_class
-gtk_widget_remove_style_class
-gtk_widget_has_style_class
+gtk_widget_add_css_class
+gtk_widget_remove_css_class
+gtk_widget_has_css_class
 
 <SUBSECTION>
 gtk_widget_get_style_context
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 99186df153..0ccb5b72d5 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -452,8 +452,8 @@ setup_search (GtkAppChooserDialog *self)
       gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
       image = gtk_image_new_from_icon_name ("edit-find-symbolic");
       gtk_container_add (GTK_CONTAINER (button), image);
-      gtk_widget_add_style_class (button, "image-button");
-      gtk_widget_remove_style_class (button, "text-button");
+      gtk_widget_add_css_class (button, "image-button");
+      gtk_widget_remove_css_class (button, "text-button");
 
       header = gtk_dialog_get_header_bar (GTK_DIALOG (self));
       gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 756e40ea02..c69024e84c 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -664,9 +664,9 @@ gtk_button_set_relief (GtkButton      *button,
   if (old_relief != relief)
     {
       if (relief == GTK_RELIEF_NONE)
-        gtk_widget_add_style_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
+        gtk_widget_add_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
+        gtk_widget_remove_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT);
 
       g_object_notify_by_pspec (G_OBJECT (button), props[PROP_RELIEF]);
     }
@@ -685,7 +685,7 @@ gtk_button_get_relief (GtkButton *button)
 {
   g_return_val_if_fail (GTK_IS_BUTTON (button), GTK_RELIEF_NORMAL);
 
-  if (gtk_widget_has_style_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT))
+  if (gtk_widget_has_css_class (GTK_WIDGET (button), GTK_STYLE_CLASS_FLAT))
     return GTK_RELIEF_NONE;
   else
     return GTK_RELIEF_NORMAL;
@@ -803,8 +803,8 @@ gtk_button_set_label (GtkButton   *button,
           gtk_label_set_xalign (GTK_LABEL (child), 0.0);
         }
       gtk_container_add (GTK_CONTAINER (button), child);
-      gtk_widget_remove_style_class (GTK_WIDGET (button), "image-button");
-      gtk_widget_add_style_class (GTK_WIDGET (button), "text-button");
+      gtk_widget_remove_css_class (GTK_WIDGET (button), "image-button");
+      gtk_widget_add_css_class (GTK_WIDGET (button), "text-button");
     }
 
   gtk_label_set_label (GTK_LABEL (child), label);
@@ -949,8 +949,8 @@ gtk_button_set_icon_name (GtkButton  *button,
 
       child = gtk_image_new_from_icon_name (icon_name);
       gtk_container_add (GTK_CONTAINER (button), child);
-      gtk_widget_remove_style_class (GTK_WIDGET (button), "text-button");
-      gtk_widget_add_style_class (GTK_WIDGET (button), "image-button");
+      gtk_widget_remove_css_class (GTK_WIDGET (button), "text-button");
+      gtk_widget_add_css_class (GTK_WIDGET (button), "image-button");
     }
   else
     {
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 78a702aa73..b614001534 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -520,15 +520,15 @@ gtk_calendar_init (GtkCalendar *calendar)
 
   gtk_widget_set_can_focus (widget, TRUE);
 
-  gtk_widget_add_style_class (GTK_WIDGET (calendar), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (calendar), GTK_STYLE_CLASS_VIEW);
 
   priv->header_box = g_object_new (GTK_TYPE_BOX,
                                    "css-name", "header",
                                    NULL);
   priv->year_label = gtk_label_new ("");
-  gtk_widget_add_style_class (priv->year_label, "year");
+  gtk_widget_add_css_class (priv->year_label, "year");
   priv->month_name_stack = gtk_stack_new ();
-  gtk_widget_add_style_class (priv->month_name_stack, "month");
+  gtk_widget_add_css_class (priv->month_name_stack, "month");
   priv->arrow_widgets[0] = gtk_button_new_from_icon_name ("pan-start-symbolic");
   g_signal_connect_swapped (priv->arrow_widgets[0], "clicked", G_CALLBACK (calendar_set_month_prev), 
calendar);
   priv->arrow_widgets[1] = gtk_button_new_from_icon_name ("pan-end-symbolic");
@@ -642,7 +642,7 @@ gtk_calendar_init (GtkCalendar *calendar)
 
       gtk_widget_set_hexpand (label, TRUE);
       gtk_widget_set_vexpand (label, TRUE);
-      gtk_widget_add_style_class (label, "day-name");
+      gtk_widget_add_css_class (label, "day-name");
       gtk_grid_attach (GTK_GRID (priv->grid), label, 1 + i, 0, 1, 1);
 
       priv->day_name_labels[i] = label;
@@ -655,7 +655,7 @@ gtk_calendar_init (GtkCalendar *calendar)
 
       gtk_widget_set_hexpand (label, TRUE);
       gtk_widget_set_vexpand (label, TRUE);
-      gtk_widget_add_style_class (label, "week-number");
+      gtk_widget_add_css_class (label, "week-number");
       gtk_grid_attach (GTK_GRID (priv->grid), label, 0, 1 + i, 1, 1);
 
       priv->week_number_labels[i] = label;
@@ -672,7 +672,7 @@ gtk_calendar_init (GtkCalendar *calendar)
 
           gtk_widget_set_hexpand (label, TRUE);
           gtk_widget_set_vexpand (label, TRUE);
-          gtk_widget_add_style_class (label, "day-number");
+          gtk_widget_add_css_class (label, "day-number");
           gtk_grid_attach (GTK_GRID (priv->grid), label, 1 + x, 1 + y, 1, 1);
 
           priv->day_number_labels[y][x] = label;
@@ -1593,9 +1593,9 @@ gtk_calendar_select_day (GtkCalendar *self,
 
         if (priv->day_month[y][x] == MONTH_PREV ||
             priv->day_month[y][x] == MONTH_NEXT)
-          gtk_widget_add_style_class (label, "other-month");
+          gtk_widget_add_css_class (label, "other-month");
         else
-          gtk_widget_remove_style_class (label, "other-month");
+          gtk_widget_remove_css_class (label, "other-month");
 
         if (priv->marked_date[day-1])
           gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE);
diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c
index a6790ca1af..795e41c2de 100644
--- a/gtk/gtkcheckbutton.c
+++ b/gtk/gtkcheckbutton.c
@@ -395,7 +395,7 @@ gtk_check_button_init (GtkCheckButton *check_button)
 
   gtk_widget_set_receives_default (GTK_WIDGET (check_button), FALSE);
 
-  gtk_widget_remove_style_class (GTK_WIDGET (check_button), "toggle");
+  gtk_widget_remove_css_class (GTK_WIDGET (check_button), "toggle");
 
   priv->draw_indicator = TRUE;
   draw_indicator_changed (check_button);
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 13908fc957..77e5086941 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -339,7 +339,7 @@ gtk_color_button_init (GtkColorButton *button)
   g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_button_drag_begin), button);
   gtk_widget_add_controller (priv->button, GTK_EVENT_CONTROLLER (source));
 
-  gtk_widget_add_style_class (priv->button, "color");
+  gtk_widget_add_css_class (priv->button, "color");
 }
 
 static void
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c
index ff2aa7cfd4..0b6b3afe4b 100644
--- a/gtk/gtkcolorchooserwidget.c
+++ b/gtk/gtkcolorchooserwidget.c
@@ -379,18 +379,18 @@ add_palette (GtkColorChooserWidget  *cc,
       if (orientation == GTK_ORIENTATION_HORIZONTAL)
         {
           if (pos == left)
-            gtk_widget_add_style_class (p, GTK_STYLE_CLASS_LEFT);
+            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_LEFT);
           else if (pos == right)
-            gtk_widget_add_style_class (p, GTK_STYLE_CLASS_RIGHT);
+            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_RIGHT);
 
           gtk_grid_attach (GTK_GRID (grid), p, pos, line, 1, 1);
         }
       else
         {
           if (pos == 0)
-            gtk_widget_add_style_class (p, GTK_STYLE_CLASS_TOP);
+            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_TOP);
           else if (pos == colors_per_line - 1)
-            gtk_widget_add_style_class (p, GTK_STYLE_CLASS_BOTTOM);
+            gtk_widget_add_css_class (p, GTK_STYLE_CLASS_BOTTOM);
 
           gtk_grid_attach (GTK_GRID (grid), p, line, pos, 1, 1);
        }
diff --git a/gtk/gtkcoloreditor.c b/gtk/gtkcoloreditor.c
index 0b21551c48..e4d610ec78 100644
--- a/gtk/gtkcoloreditor.c
+++ b/gtk/gtkcoloreditor.c
@@ -386,9 +386,9 @@ gtk_color_editor_init (GtkColorEditor *editor)
   gtk_widget_init_template (GTK_WIDGET (editor));
 
   if (gtk_widget_get_direction (editor->priv->h_slider) == GTK_TEXT_DIR_RTL)
-    gtk_widget_add_style_class (editor->priv->h_slider, "marks-before");
+    gtk_widget_add_css_class (editor->priv->h_slider, "marks-before");
   else
-    gtk_widget_add_style_class (editor->priv->h_slider, "marks-after");
+    gtk_widget_add_css_class (editor->priv->h_slider, "marks-after");
 
   /* Create the scaled popup adjustments manually here because connecting user data is not
    * supported by template GtkBuilder xml (it would be possible to set this up in the xml
@@ -417,7 +417,7 @@ gtk_color_editor_init (GtkColorEditor *editor)
   g_signal_connect (controller, "key-pressed", G_CALLBACK (popup_key_pressed), editor);
   gtk_widget_add_controller (editor->priv->a_entry, controller);
 
-  gtk_widget_remove_style_class (editor->priv->swatch, "activatable");
+  gtk_widget_remove_css_class (editor->priv->swatch, "activatable");
 
   editor->priv->picker = gtk_color_picker_new ();
   if (editor->priv->picker == NULL)
diff --git a/gtk/gtkcolorscale.c b/gtk/gtkcolorscale.c
index 2e54959a8d..d4bc48452a 100644
--- a/gtk/gtkcolorscale.c
+++ b/gtk/gtkcolorscale.c
@@ -157,7 +157,7 @@ gtk_color_scale_init (GtkColorScale *scale)
                                               GTK_PHASE_TARGET);
   gtk_widget_add_controller (GTK_WIDGET (scale), GTK_EVENT_CONTROLLER (gesture));
 
-  gtk_widget_add_style_class (GTK_WIDGET (scale), "color");
+  gtk_widget_add_css_class (GTK_WIDGET (scale), "color");
 }
 
 static void
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 44edf1e005..270556ed78 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -558,7 +558,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
                     G_CALLBACK (key_controller_key_pressed), swatch);
   gtk_widget_add_controller (GTK_WIDGET (swatch), controller);
 
-  gtk_widget_add_style_class (GTK_WIDGET (swatch), "activatable");
+  gtk_widget_add_css_class (GTK_WIDGET (swatch), "activatable");
 
   priv->overlay_widget = g_object_new (GTK_TYPE_IMAGE,
                                                "css-name", "overlay",
@@ -611,13 +611,13 @@ gtk_color_swatch_set_rgba (GtkColorSwatch *swatch,
 
   if (INTENSITY (priv->color.red, priv->color.green, priv->color.blue) > 0.5)
     {
-      gtk_widget_add_style_class (GTK_WIDGET (swatch), "light");
-      gtk_widget_remove_style_class (GTK_WIDGET (swatch), "dark");
+      gtk_widget_add_css_class (GTK_WIDGET (swatch), "light");
+      gtk_widget_remove_css_class (GTK_WIDGET (swatch), "dark");
     }
   else
     {
-      gtk_widget_add_style_class (GTK_WIDGET (swatch), "dark");
-      gtk_widget_remove_style_class (GTK_WIDGET (swatch), "light");
+      gtk_widget_add_css_class (GTK_WIDGET (swatch), "dark");
+      gtk_widget_remove_css_class (GTK_WIDGET (swatch), "light");
 
     }
 
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 1313ea444b..e500a765f6 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -847,8 +847,8 @@ gtk_combo_box_init (GtkComboBox *combo_box)
   g_type_ensure (GTK_TYPE_TREE_POPOVER);
   gtk_widget_init_template (GTK_WIDGET (combo_box));
 
-  gtk_widget_remove_style_class (priv->button, "toggle");
-  gtk_widget_add_style_class (priv->button, "combo");
+  gtk_widget_remove_css_class (priv->button, "toggle");
+  gtk_widget_add_css_class (priv->button, "combo");
 
   gtk_tree_popover_set_row_separator_func (GTK_TREE_POPOVER (priv->popup_widget),
                                            (GtkTreeViewRowSeparatorFunc)gtk_combo_box_row_separator_func,
@@ -1031,7 +1031,7 @@ gtk_combo_box_create_child (GtkComboBox *combo_box)
       entry = gtk_entry_new ();
       gtk_container_add (GTK_CONTAINER (combo_box), entry);
 
-      gtk_widget_add_style_class (GTK_WIDGET (entry), "combo");
+      gtk_widget_add_css_class (GTK_WIDGET (entry), "combo");
 
       g_signal_connect (combo_box, "changed",
                         G_CALLBACK (gtk_combo_box_entry_active_changed), NULL);
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 598c54b24a..dfd98edc5b 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -399,10 +399,10 @@ update_suggested_action (GtkDialog *dialog)
         {
           GtkWidget *child = l->data;
 
-          if (gtk_widget_has_style_class (child, GTK_STYLE_CLASS_DEFAULT))
-            gtk_widget_add_style_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
+          if (gtk_widget_has_css_class (child, GTK_STYLE_CLASS_DEFAULT))
+            gtk_widget_add_css_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
           else
-            gtk_widget_remove_style_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
+            gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_SUGGESTED_ACTION);
         }
       g_list_free (children);
     }
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index 95a1715acf..564bd13df2 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -290,7 +290,7 @@ show_variations (GtkEmojiChooser *chooser,
   parent_popover = gtk_widget_get_ancestor (child, GTK_TYPE_POPOVER);
   popover = gtk_popover_new (child);
   view = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_add_style_class (view, "view");
+  gtk_widget_add_css_class (view, "view");
   box = gtk_flow_box_new ();
   gtk_flow_box_set_homogeneous (GTK_FLOW_BOX (box), TRUE);
   gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (box), 6);
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 9823120f4a..001c434880 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -1348,8 +1348,8 @@ update_icon_style (GtkWidget            *widget,
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
     icon_pos = 1 - icon_pos;
 
-  gtk_widget_add_style_class (icon_info->widget, sides[icon_pos]);
-  gtk_widget_remove_style_class (icon_info->widget, sides[1 - icon_pos]);
+  gtk_widget_add_css_class (icon_info->widget, sides[icon_pos]);
+  gtk_widget_remove_css_class (icon_info->widget, sides[1 - icon_pos]);
 }
 
 static void
@@ -2213,9 +2213,9 @@ gtk_entry_set_has_frame (GtkEntry *entry,
     return;
 
   if (setting)
-    gtk_widget_remove_style_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_remove_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
   else
-    gtk_widget_add_style_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
+    gtk_widget_add_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FLAT);
 
   g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_HAS_FRAME]);
 }
@@ -2233,7 +2233,7 @@ gtk_entry_get_has_frame (GtkEntry *entry)
 {
   g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE);
 
-  return !gtk_widget_has_style_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FRAME);
+  return !gtk_widget_has_css_class (GTK_WIDGET (entry), GTK_STYLE_CLASS_FRAME);
 }
 
 /**
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 380dd5038b..c5a95c9748 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -585,7 +585,7 @@ gtk_entry_completion_constructed (GObject *object)
   gtk_popover_set_position (GTK_POPOVER (priv->popup_window), GTK_POS_BOTTOM);
   gtk_popover_set_autohide (GTK_POPOVER (priv->popup_window), FALSE);
   gtk_popover_set_has_arrow (GTK_POPOVER (priv->popup_window), FALSE);
-  gtk_widget_add_style_class (priv->popup_window, "entry-completion");
+  gtk_widget_add_css_class (priv->popup_window, "entry-completion");
 
   controller = gtk_event_controller_key_new ();
   g_signal_connect (controller, "key-pressed",
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 63dcf42c52..720c167051 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -370,7 +370,7 @@ gtk_expander_init (GtkExpander *expander)
   gtk_container_add (GTK_CONTAINER (priv->box), priv->title_widget);
 
   priv->arrow_widget = gtk_builtin_icon_new ("expander");
-  gtk_widget_add_style_class (priv->arrow_widget, GTK_STYLE_CLASS_HORIZONTAL);
+  gtk_widget_add_css_class (priv->arrow_widget, GTK_STYLE_CLASS_HORIZONTAL);
   gtk_container_add (GTK_CONTAINER (priv->title_widget), priv->arrow_widget);
 
   formats = gdk_content_formats_new (NULL, 0);
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index f9ef7ad7b3..1e5cf9889e 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -591,7 +591,7 @@ gtk_font_button_init (GtkFontButton *font_button)
 
   gtk_font_button_take_font_desc (font_button, NULL);
 
-  gtk_widget_add_style_class (priv->button, "font");
+  gtk_widget_add_css_class (priv->button, "font");
 }
 
 static void
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index ab7ccb429c..961c4a23b3 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -534,9 +534,9 @@ gtk_frame_set_shadow_type (GtkFrame      *frame,
       priv->shadow_type = type;
 
       if (type == GTK_SHADOW_NONE)
-        gtk_widget_add_style_class (GTK_WIDGET (frame), "flat");
+        gtk_widget_add_css_class (GTK_WIDGET (frame), "flat");
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (frame), "flat");
+        gtk_widget_remove_css_class (GTK_WIDGET (frame), "flat");
 
       g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_SHADOW_TYPE]);
     }
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index b00dc0b6cd..0c708ee851 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -173,7 +173,7 @@ init_sizing_box (GtkHeaderBar *bar)
   priv->label_sizing_box = g_object_ref_sink (w);
 
   w = gtk_label_new (NULL);
-  gtk_widget_add_style_class (w, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (w, GTK_STYLE_CLASS_TITLE);
   gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
   gtk_label_set_wrap (GTK_LABEL (w), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
@@ -181,7 +181,7 @@ init_sizing_box (GtkHeaderBar *bar)
   gtk_label_set_width_chars (GTK_LABEL (w), MIN_TITLE_CHARS);
 
   w = gtk_label_new (NULL);
-  gtk_widget_add_style_class (w, GTK_STYLE_CLASS_SUBTITLE);
+  gtk_widget_add_css_class (w, GTK_STYLE_CLASS_SUBTITLE);
   gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
   gtk_label_set_wrap (GTK_LABEL (w), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
@@ -204,7 +204,7 @@ create_title_box (const char *title,
   gtk_widget_set_valign (label_box, GTK_ALIGN_CENTER);
 
   title_label = gtk_label_new (title);
-  gtk_widget_add_style_class (title_label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (title_label, GTK_STYLE_CLASS_TITLE);
   gtk_label_set_wrap (GTK_LABEL (title_label), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (title_label), TRUE);
   gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END);
@@ -212,7 +212,7 @@ create_title_box (const char *title,
   gtk_label_set_width_chars (GTK_LABEL (title_label), MIN_TITLE_CHARS);
 
   subtitle_label = gtk_label_new (subtitle);
-  gtk_widget_add_style_class (subtitle_label, GTK_STYLE_CLASS_SUBTITLE);
+  gtk_widget_add_css_class (subtitle_label, GTK_STYLE_CLASS_SUBTITLE);
   gtk_label_set_wrap (GTK_LABEL (subtitle_label), FALSE);
   gtk_label_set_single_line_mode (GTK_LABEL (subtitle_label), TRUE);
   gtk_label_set_ellipsize (GTK_LABEL (subtitle_label), PANGO_ELLIPSIZE_END);
@@ -365,7 +365,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
           t = g_strsplit (tokens[i], ",", -1);
 
           separator = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
-          gtk_widget_add_style_class (separator, "titlebutton");
+          gtk_widget_add_css_class (separator, "titlebutton");
 
           box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
 
@@ -381,8 +381,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
                   button = gtk_image_new ();
                   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
                   priv->titlebar_icon = button;
-                  gtk_widget_add_style_class (button, "titlebutton");
-                  gtk_widget_add_style_class (button, "icon");
+                  gtk_widget_add_css_class (button, "titlebutton");
+                  gtk_widget_add_css_class (button, "icon");
                   gtk_widget_set_size_request (button, 20, 20);
 
                   if (!_gtk_header_bar_update_window_icon (bar, window))
@@ -399,8 +399,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
                   button = gtk_menu_button_new ();
                   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
                   gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
-                  gtk_widget_add_style_class (button, "titlebutton");
-                  gtk_widget_add_style_class (button, "menu");
+                  gtk_widget_add_css_class (button, "titlebutton");
+                  gtk_widget_add_css_class (button, "menu");
                   image = gtk_image_new ();
                   gtk_menu_button_add_child (GTK_MENU_BUTTON (button), image);
                   gtk_widget_set_can_focus (button, FALSE);
@@ -420,8 +420,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
                 {
                   button = gtk_button_new ();
                   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
-                  gtk_widget_add_style_class (button, "titlebutton");
-                  gtk_widget_add_style_class (button, "minimize");
+                  gtk_widget_add_css_class (button, "titlebutton");
+                  gtk_widget_add_css_class (button, "minimize");
                   image = gtk_image_new_from_icon_name ("window-minimize-symbolic");
                   g_object_set (image, "use-fallback", TRUE, NULL);
                   gtk_container_add (GTK_CONTAINER (button), image);
@@ -443,8 +443,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
                   icon_name = maximized ? "window-restore-symbolic" : "window-maximize-symbolic";
                   button = gtk_button_new ();
                   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
-                  gtk_widget_add_style_class (button, "titlebutton");
-                  gtk_widget_add_style_class (button, "maximize");
+                  gtk_widget_add_css_class (button, "titlebutton");
+                  gtk_widget_add_css_class (button, "maximize");
                   image = gtk_image_new_from_icon_name (icon_name);
                   g_object_set (image, "use-fallback", TRUE, NULL);
                   gtk_container_add (GTK_CONTAINER (button), image);
@@ -462,8 +462,8 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
                   button = gtk_button_new ();
                   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
                   image = gtk_image_new_from_icon_name ("window-close-symbolic");
-                  gtk_widget_add_style_class (button, "titlebutton");
-                  gtk_widget_add_style_class (button, "close");
+                  gtk_widget_add_css_class (button, "titlebutton");
+                  gtk_widget_add_css_class (button, "close");
                   g_object_set (image, "use-fallback", TRUE, NULL);
                   gtk_container_add (GTK_CONTAINER (button), image);
                   gtk_widget_set_can_focus (button, FALSE);
@@ -497,9 +497,9 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
             gtk_box_reorder_child_after (GTK_BOX (box), separator, NULL);
 
           if (i == 0)
-            gtk_widget_add_style_class (box, GTK_STYLE_CLASS_LEFT);
+            gtk_widget_add_css_class (box, GTK_STYLE_CLASS_LEFT);
           else
-            gtk_widget_add_style_class (box, GTK_STYLE_CLASS_RIGHT);
+            gtk_widget_add_css_class (box, GTK_STYLE_CLASS_RIGHT);
 
           if (i == 0)
             {
@@ -570,9 +570,9 @@ update_default_decoration (GtkHeaderBar *bar)
     }
 
   if (have_children || priv->custom_title != NULL)
-    gtk_widget_remove_style_class (GTK_WIDGET (bar), "default-decoration");
+    gtk_widget_remove_css_class (GTK_WIDGET (bar), "default-decoration");
   else
-    gtk_widget_add_style_class (GTK_WIDGET (bar), "default-decoration");
+    gtk_widget_add_css_class (GTK_WIDGET (bar), "default-decoration");
 }
 
 void
@@ -1233,11 +1233,11 @@ gtk_header_bar_init (GtkHeaderBar *bar)
 
   layout = gtk_widget_get_layout_manager (GTK_WIDGET (bar));
   priv->start_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_add_style_class (priv->start_box, "start");
+  gtk_widget_add_css_class (priv->start_box, "start");
   gtk_widget_set_parent (priv->start_box, GTK_WIDGET (bar));
   gtk_center_layout_set_start_widget (GTK_CENTER_LAYOUT (layout), priv->start_box);
   priv->end_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_add_style_class (priv->end_box, "end");
+  gtk_widget_add_css_class (priv->end_box, "end");
   gtk_widget_set_parent (priv->end_box, GTK_WIDGET (bar));
   gtk_center_layout_set_end_widget (GTK_CENTER_LAYOUT (layout), priv->end_box);
 
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 8a3ee9ff6b..1d8c7901ea 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -956,7 +956,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_style_class (GTK_WIDGET (icon_view), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (icon_view), GTK_STYLE_CLASS_VIEW);
 
   gesture = gtk_gesture_click_new ();
   g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_icon_view_button_press),
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 82004de802..53ded51055 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -531,7 +531,7 @@ gtk_info_bar_init (GtkInfoBar *info_bar)
   priv->close_button = gtk_button_new_from_icon_name ("window-close-symbolic");
   gtk_widget_hide (priv->close_button);
   gtk_widget_set_valign (priv->close_button, GTK_ALIGN_CENTER);
-  gtk_widget_add_style_class (priv->close_button, "close");
+  gtk_widget_add_css_class (priv->close_button, "close");
   gtk_container_add (GTK_CONTAINER (main_box), priv->close_button);
   g_signal_connect (priv->close_button, "clicked",
                     G_CALLBACK (close_button_clicked_cb), info_bar);
@@ -802,9 +802,9 @@ update_default_response (GtkInfoBar *info_bar,
   priv->default_response_sensitive = sensitive;
 
   if (response_id && sensitive)
-    gtk_widget_add_style_class (GTK_WIDGET (info_bar), "action");
+    gtk_widget_add_css_class (GTK_WIDGET (info_bar), "action");
   else
-    gtk_widget_remove_style_class (GTK_WIDGET (info_bar), "action");
+    gtk_widget_remove_css_class (GTK_WIDGET (info_bar), "action");
 }
 
 /**
@@ -1162,7 +1162,7 @@ gtk_info_bar_set_message_type (GtkInfoBar     *info_bar,
       };
 
       if (type_class[priv->message_type])
-        gtk_widget_remove_style_class (GTK_WIDGET (info_bar), type_class[priv->message_type]);
+        gtk_widget_remove_css_class (GTK_WIDGET (info_bar), type_class[priv->message_type]);
 
       priv->message_type = message_type;
 
@@ -1206,7 +1206,7 @@ gtk_info_bar_set_message_type (GtkInfoBar     *info_bar,
         }
 
       if (type_class[priv->message_type])
-        gtk_widget_add_style_class (GTK_WIDGET (info_bar), type_class[priv->message_type]);
+        gtk_widget_add_css_class (GTK_WIDGET (info_bar), type_class[priv->message_type]);
 
       g_object_notify_by_pspec (G_OBJECT (info_bar), props[PROP_MESSAGE_TYPE]);
     }
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index be28f64613..129ff90a87 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -346,7 +346,7 @@ gtk_link_button_init (GtkLinkButton *link_button)
                     link_button);
   gtk_widget_add_controller (GTK_WIDGET (link_button), GTK_EVENT_CONTROLLER (gesture));
 
-  gtk_widget_add_style_class (GTK_WIDGET (link_button), "link");
+  gtk_widget_add_css_class (GTK_WIDGET (link_button), "link");
 
   gtk_widget_set_cursor_from_name (GTK_WIDGET (link_button), "pointer");
 }
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 580dcf44a7..c36c73d2ef 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -3166,9 +3166,9 @@ gtk_list_box_update_row_style (GtkListBox    *box,
 
   if (ROW_PRIV (row)->activatable ||
       (ROW_PRIV (row)->selectable && can_select))
-    gtk_widget_add_style_class (GTK_WIDGET (row), "activatable");
+    gtk_widget_add_css_class (GTK_WIDGET (row), "activatable");
   else
-    gtk_widget_remove_style_class (GTK_WIDGET (row), "activatable");
+    gtk_widget_remove_css_class (GTK_WIDGET (row), "activatable");
 }
 
 static void
@@ -3494,7 +3494,7 @@ gtk_list_box_row_init (GtkListBoxRow *row)
   ROW_PRIV (row)->activatable = TRUE;
   ROW_PRIV (row)->selectable = TRUE;
 
-  gtk_widget_add_style_class (GTK_WIDGET (row), "activatable");
+  gtk_widget_add_css_class (GTK_WIDGET (row), "activatable");
 }
 
 static void
@@ -3666,9 +3666,9 @@ gtk_list_box_set_show_separators (GtkListBox *box,
   priv->show_separators = show_separators;
 
   if (show_separators)
-    gtk_widget_add_style_class (GTK_WIDGET (box), "separators");
+    gtk_widget_add_css_class (GTK_WIDGET (box), "separators");
   else
-    gtk_widget_remove_style_class (GTK_WIDGET (box), "separators");
+    gtk_widget_remove_css_class (GTK_WIDGET (box), "separators");
 
   g_object_notify_by_pspec (G_OBJECT (box), properties[PROP_SHOW_SEPARATORS]);
 }
diff --git a/gtk/gtklockbutton.c b/gtk/gtklockbutton.c
index 5312b07434..1c57cb112e 100644
--- a/gtk/gtklockbutton.c
+++ b/gtk/gtklockbutton.c
@@ -256,7 +256,7 @@ gtk_lock_button_init (GtkLockButton *button)
 
   update_state (button);
 
-  gtk_widget_add_style_class (GTK_WIDGET (button), I_("lock"));
+  gtk_widget_add_css_class (GTK_WIDGET (button), I_("lock"));
 }
 
 static void
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 15a6de1644..3f6a4da5fd 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -481,7 +481,7 @@ gtk_menu_button_init (GtkMenuButton *menu_button)
 
   gtk_widget_set_sensitive (priv->button, FALSE);
 
-  gtk_widget_add_style_class (GTK_WIDGET (menu_button), "popup");
+  gtk_widget_add_css_class (GTK_WIDGET (menu_button), "popup");
 }
 
 /**
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c
index e2bfc99e40..107355eb24 100644
--- a/gtk/gtkmenusectionbox.c
+++ b/gtk/gtkmenusectionbox.c
@@ -350,13 +350,13 @@ gtk_menu_section_box_insert_func (GtkMenuTrackerItem *item,
         {
           g_object_bind_property (item, "verb-icon", widget, "icon", G_BINDING_SYNC_CREATE);
           g_object_set (widget, "iconic", TRUE, NULL);
-          gtk_widget_add_style_class (widget, "flat");
+          gtk_widget_add_css_class (widget, "flat");
         }
       else if (box->circular)
         {
           g_object_bind_property (item, "verb-icon", widget, "icon", G_BINDING_SYNC_CREATE);
           g_object_set (widget, "iconic", TRUE, NULL);
-          gtk_widget_add_style_class (widget, "circular");
+          gtk_widget_add_css_class (widget, "circular");
         }
       else
         g_object_bind_property (item, "icon", widget, "icon", G_BINDING_SYNC_CREATE);
@@ -556,8 +556,8 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
     {
       gtk_box_set_homogeneous (box->item_box, TRUE);
       gtk_orientable_set_orientation (GTK_ORIENTABLE (box->item_box), GTK_ORIENTATION_HORIZONTAL);
-      gtk_widget_add_style_class (GTK_WIDGET (box->item_box), "linked");
-      gtk_widget_add_style_class (GTK_WIDGET (box->item_box), "horizontal-buttons");
+      gtk_widget_add_css_class (GTK_WIDGET (box->item_box), "linked");
+      gtk_widget_add_css_class (GTK_WIDGET (box->item_box), "horizontal-buttons");
       box->iconic = TRUE;
 
       if (text_direction)
@@ -580,7 +580,7 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
       box->inline_buttons = TRUE;
 
       gtk_orientable_set_orientation (GTK_ORIENTABLE (box->item_box), GTK_ORIENTATION_HORIZONTAL);
-      gtk_widget_add_style_class (GTK_WIDGET (box->item_box), "inline-buttons");
+      gtk_widget_add_css_class (GTK_WIDGET (box->item_box), "inline-buttons");
 
       spacer = gtk_builtin_icon_new ("none");
       gtk_container_add (GTK_CONTAINER (box->item_box), spacer);
@@ -605,7 +605,7 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item,
     {
       gtk_box_set_homogeneous (box->item_box, TRUE);
       gtk_orientable_set_orientation (GTK_ORIENTABLE (box->item_box), GTK_ORIENTATION_HORIZONTAL);
-      gtk_widget_add_style_class (GTK_WIDGET (box->item_box), "circular-buttons");
+      gtk_widget_add_css_class (GTK_WIDGET (box->item_box), "circular-buttons");
       box->circular = TRUE;
     }
 
@@ -623,7 +623,7 @@ 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_style_class (title, GTK_STYLE_CLASS_SEPARATOR);
+      gtk_widget_add_css_class (title, GTK_STYLE_CLASS_SEPARATOR);
       gtk_widget_set_halign (title, GTK_ALIGN_START);
       gtk_container_add (GTK_CONTAINER (box->separator), title);
 
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 769b3af410..5b434049b3 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -366,7 +366,7 @@ gtk_message_dialog_constructed (GObject *object)
       gtk_widget_set_margin_bottom (label, 6);
       gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
       gtk_widget_set_hexpand (label, TRUE);
-      gtk_widget_add_style_class (label, "title");
+      gtk_widget_add_css_class (label, "title");
       gtk_container_add (GTK_CONTAINER (box), label);
       g_signal_connect_object (dialog, "notify::title", G_CALLBACK (update_title), label, 0);
 
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index b7035adf4f..aea36907dd 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -293,14 +293,14 @@ update_node_ordering (GtkModelButton *button)
     {
       if (button->start_indicator)
         {
-          gtk_widget_add_style_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_style_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_remove_css_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
         }
 
       if (button->end_indicator)
         {
-          gtk_widget_add_style_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_style_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_remove_css_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
         }
 
       child = gtk_widget_get_first_child (GTK_WIDGET (button));
@@ -315,14 +315,14 @@ update_node_ordering (GtkModelButton *button)
     {
       if (button->start_indicator)
         {
-          gtk_widget_add_style_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_style_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (button->start_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_remove_css_class (button->start_indicator, GTK_STYLE_CLASS_LEFT);
         }
 
       if (button->end_indicator)
         {
-          gtk_widget_add_style_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_style_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (button->end_indicator, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_remove_css_class (button->end_indicator, GTK_STYLE_CLASS_RIGHT);
 
         }
 
@@ -346,13 +346,13 @@ update_end_indicator (GtkModelButton *self)
 
   if (is_ltr)
     {
-      gtk_widget_add_style_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
-      gtk_widget_remove_style_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_add_css_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_remove_css_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
     }
   else
     {
-      gtk_widget_add_style_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
-      gtk_widget_remove_style_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_add_css_class (self->end_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_remove_css_class (self->end_indicator, GTK_STYLE_CLASS_RIGHT);
     }
 }
 
@@ -385,13 +385,13 @@ update_start_indicator (GtkModelButton *self)
 
   if (is_ltr)
     {
-      gtk_widget_add_style_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
-      gtk_widget_remove_style_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_add_css_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_remove_css_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
     }
   else
     {
-      gtk_widget_add_style_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
-      gtk_widget_remove_style_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
+      gtk_widget_add_css_class (self->start_indicator, GTK_STYLE_CLASS_RIGHT);
+      gtk_widget_remove_css_class (self->start_indicator, GTK_STYLE_CLASS_LEFT);
     }
 
 }
@@ -536,12 +536,12 @@ gtk_model_button_set_role (GtkModelButton *self,
 
   if (role == GTK_BUTTON_ROLE_TITLE)
     {
-      gtk_widget_add_style_class (GTK_WIDGET (self), "title");
+      gtk_widget_add_css_class (GTK_WIDGET (self), "title");
       gtk_widget_set_halign (self->label, GTK_ALIGN_CENTER);
     }
   else
     {
-      gtk_widget_remove_style_class (GTK_WIDGET (self), "title");
+      gtk_widget_remove_css_class (GTK_WIDGET (self), "title");
       gtk_widget_set_halign (self->label, GTK_ALIGN_START);
     }
 
@@ -663,17 +663,17 @@ gtk_model_button_set_iconic (GtkModelButton *self,
     {
       gtk_widget_hide (self->start_box);
       gtk_css_node_set_name (widget_node, g_quark_from_static_string ("button"));
-      gtk_widget_add_style_class (widget, "model");
-      gtk_widget_add_style_class (widget, "image-button");
-      gtk_widget_remove_style_class (widget, "flat");
+      gtk_widget_add_css_class (widget, "model");
+      gtk_widget_add_css_class (widget, "image-button");
+      gtk_widget_remove_css_class (widget, "flat");
     }
   else
     {
       gtk_widget_show (self->start_box);
       gtk_css_node_set_name (widget_node, g_quark_from_static_string ("modelbutton"));
-      gtk_widget_remove_style_class (widget, "model");
-      gtk_widget_remove_style_class (widget, "image-button");
-      gtk_widget_add_style_class (widget, "flat");
+      gtk_widget_remove_css_class (widget, "model");
+      gtk_widget_remove_css_class (widget, "image-button");
+      gtk_widget_add_css_class (widget, "flat");
     }
 
   self->centered = iconic;
@@ -1384,7 +1384,7 @@ gtk_model_button_init (GtkModelButton *self)
   gtk_widget_insert_after (self->start_box, GTK_WIDGET (self), NULL);
   update_node_ordering (self);
 
-  gtk_widget_add_style_class (GTK_WIDGET (self), "flat");
+  gtk_widget_add_css_class (GTK_WIDGET (self), "flat");
 
   controller = gtk_event_controller_motion_new ();
   g_signal_connect (controller, "enter", G_CALLBACK (enter_cb), self);
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index d72baa7dac..57fd7172f1 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1331,7 +1331,7 @@ gtk_notebook_init (GtkNotebook *notebook)
   priv->header_widget = g_object_new (GTK_TYPE_BOX,
                                       "css-name", "header",
                                       NULL);
-  gtk_widget_add_style_class (priv->header_widget, GTK_STYLE_CLASS_TOP);
+  gtk_widget_add_css_class (priv->header_widget, GTK_STYLE_CLASS_TOP);
   gtk_widget_hide (priv->header_widget);
   gtk_widget_set_parent (priv->header_widget, GTK_WIDGET (notebook));
 
@@ -1367,7 +1367,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_style_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+  gtk_widget_add_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
 
   layout = gtk_widget_get_layout_manager (GTK_WIDGET (notebook));
   gtk_orientable_set_orientation (GTK_ORIENTABLE (layout), GTK_ORIENTATION_VERTICAL);
@@ -2635,7 +2635,7 @@ static void
 tab_drag_begin (GtkNotebook     *notebook,
                 GtkNotebookPage *page)
 {
-  gtk_widget_add_style_class (page->tab_widget, GTK_STYLE_CLASS_DND);
+  gtk_widget_add_css_class (page->tab_widget, GTK_STYLE_CLASS_DND);
 }
 
 /* This function undoes the reparenting that happens both when drag_surface
@@ -2653,7 +2653,7 @@ tab_drag_end (GtkNotebook     *notebook,
       g_object_unref (page->tab_label);
     }
 
-  gtk_widget_remove_style_class (page->tab_widget, GTK_STYLE_CLASS_DND);
+  gtk_widget_remove_css_class (page->tab_widget, GTK_STYLE_CLASS_DND);
 }
 
 static void
@@ -3086,12 +3086,12 @@ update_arrow_nodes (GtkNotebook *notebook)
 
               if (i == ARROW_LEFT_BEFORE || i == ARROW_LEFT_AFTER)
                 {
-                  gtk_widget_add_style_class (priv->arrow_widget[i], "down");
+                  gtk_widget_add_css_class (priv->arrow_widget[i], "down");
                   gtk_widget_insert_after (priv->arrow_widget[i], priv->tabs_widget, next_widget);
                 }
               else
                 {
-                  gtk_widget_add_style_class (priv->arrow_widget[i], "up");
+                  gtk_widget_add_css_class (priv->arrow_widget[i], "up");
                   gtk_widget_insert_before (priv->arrow_widget[i], priv->tabs_widget, next_widget);
                 }
            }
@@ -6140,9 +6140,9 @@ gtk_notebook_set_show_border (GtkNotebook *notebook,
       priv->show_border = show_border;
 
       if (show_border)
-        gtk_widget_add_style_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_add_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_remove_css_class (GTK_WIDGET (notebook), GTK_STYLE_CLASS_FRAME);
 
       g_object_notify_by_pspec (G_OBJECT (notebook), properties[PROP_SHOW_BORDER]);
     }
@@ -6267,9 +6267,9 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
   for (i = 0; i < G_N_ELEMENTS (tab_pos_names); i++)
     {
       if (tab_pos == i)
-        gtk_widget_add_style_class (priv->header_widget, tab_pos_names[i]);
+        gtk_widget_add_css_class (priv->header_widget, tab_pos_names[i]);
       else
-        gtk_widget_remove_style_class (priv->header_widget, tab_pos_names[i]);
+        gtk_widget_remove_css_class (priv->header_widget, tab_pos_names[i]);
     }
 
   layout = gtk_widget_get_layout_manager (GTK_WIDGET (notebook));
@@ -7029,9 +7029,9 @@ gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
     {
       page->reorderable = reorderable;
       if (reorderable)
-        gtk_widget_add_style_class (page->tab_widget, "reorderable-page");
+        gtk_widget_add_css_class (page->tab_widget, "reorderable-page");
       else
-        gtk_widget_remove_style_class (page->tab_widget, "reorderable-page");
+        gtk_widget_remove_css_class (page->tab_widget, "reorderable-page");
 
       g_object_notify (G_OBJECT (page), "reorderable");
     }
diff --git a/gtk/gtkorientable.c b/gtk/gtkorientable.c
index 8cdefc70c4..4987a6c76c 100644
--- a/gtk/gtkorientable.c
+++ b/gtk/gtkorientable.c
@@ -119,12 +119,12 @@ _gtk_orientable_set_style_classes (GtkOrientable *orientable)
 
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {
-      gtk_widget_add_style_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
-      gtk_widget_remove_style_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
+      gtk_widget_add_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
+      gtk_widget_remove_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
     }
   else
     {
-      gtk_widget_add_style_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
-      gtk_widget_remove_style_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
+      gtk_widget_add_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
+      gtk_widget_remove_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
     }
 }
diff --git a/gtk/gtkoverlaylayout.c b/gtk/gtkoverlaylayout.c
index 7b703a22db..a05f58ee23 100644
--- a/gtk/gtkoverlaylayout.c
+++ b/gtk/gtkoverlaylayout.c
@@ -325,10 +325,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_style_class (widget, GTK_STYLE_CLASS_LEFT);
-  has_right = gtk_widget_has_style_class (widget, GTK_STYLE_CLASS_RIGHT);
-  has_top = gtk_widget_has_style_class (widget, GTK_STYLE_CLASS_TOP);
-  has_bottom = gtk_widget_has_style_class (widget, GTK_STYLE_CLASS_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);
 
   is_left = is_right = is_top = is_bottom = FALSE;
 
@@ -351,24 +351,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_style_class (widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_LEFT);
   else if (!has_left && is_left)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_LEFT);
 
   if (has_right && !is_right)
-    gtk_widget_remove_style_class (widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_RIGHT);
   else if (!has_right && is_right)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_RIGHT);
 
   if (has_top && !is_top)
-    gtk_widget_remove_style_class (widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_TOP);
   else if (!has_top && is_top)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_TOP);
 
   if (has_bottom && !is_bottom)
-    gtk_widget_remove_style_class (widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
   else if (!has_bottom && is_bottom)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
 }
 
 static void
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index e46ca43912..6e1cda89bf 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -2417,9 +2417,9 @@ gtk_paned_set_wide_handle (GtkPaned *paned,
   if (old_wide != wide)
     {
       if (wide)
-        gtk_widget_add_style_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
+        gtk_widget_add_css_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
       else
-        gtk_widget_remove_style_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
+        gtk_widget_remove_css_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
 
       g_object_notify_by_pspec (G_OBJECT (paned), paned_props[PROP_WIDE_HANDLE]);
     }
@@ -2440,5 +2440,5 @@ gtk_paned_get_wide_handle (GtkPaned *paned)
 
   g_return_val_if_fail (GTK_IS_PANED (paned), FALSE);
 
-  return gtk_widget_has_style_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
+  return gtk_widget_has_css_class (priv->handle_widget, GTK_STYLE_CLASS_WIDE);
 }
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c
index a3de52e488..f39531639b 100644
--- a/gtk/gtkpasswordentry.c
+++ b/gtk/gtkpasswordentry.c
@@ -149,11 +149,11 @@ gtk_password_entry_init (GtkPasswordEntry *entry)
 
   priv->icon = gtk_image_new_from_icon_name ("caps-lock-symbolic");
   gtk_widget_set_tooltip_text (priv->icon, _("Caps Lock is on"));
-  gtk_widget_add_style_class (priv->icon, "caps-lock-indicator");
+  gtk_widget_add_css_class (priv->icon, "caps-lock-indicator");
   gtk_widget_set_cursor (priv->icon, gtk_widget_get_cursor (priv->entry));
   gtk_widget_set_parent (priv->icon, GTK_WIDGET (entry));
 
-  gtk_widget_add_style_class (GTK_WIDGET (entry), I_("password"));
+  gtk_widget_add_css_class (GTK_WIDGET (entry), I_("password"));
 
   gtk_password_entry_set_extra_menu (entry, NULL);
 }
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 4972311e0d..51427ca6ec 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -232,7 +232,7 @@ gtk_path_bar_init (GtkPathBar *path_bar)
   g_signal_connect_swapped (priv->down_slider_button, "clicked",
                            G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
 
-  gtk_widget_add_style_class (GTK_WIDGET (path_bar), GTK_STYLE_CLASS_LINKED);
+  gtk_widget_add_css_class (GTK_WIDGET (path_bar), GTK_STYLE_CLASS_LINKED);
 
   priv->get_info_cancellable = NULL;
   priv->cancellables = NULL;
@@ -1142,21 +1142,21 @@ gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
 {
   const gchar *dir_name = get_dir_name (button_data);
 
-  gtk_widget_remove_style_class (button_data->button, "text-button");
-  gtk_widget_remove_style_class (button_data->button, "image-button");
+  gtk_widget_remove_css_class (button_data->button, "text-button");
+  gtk_widget_remove_css_class (button_data->button, "image-button");
 
   if (button_data->label != NULL)
     {
       gtk_label_set_text (GTK_LABEL (button_data->label), dir_name);
       if (button_data->image == NULL)
-        gtk_widget_add_style_class (button_data->button, "text-button");
+        gtk_widget_add_css_class (button_data->button, "text-button");
     }
 
   if (button_data->image != NULL)
     {
       set_button_image (path_bar, button_data);
       if (button_data->label == NULL)
-        gtk_widget_add_style_class (button_data->button, "image-button");
+        gtk_widget_add_css_class (button_data->button, "image-button");
     }
 
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button)) != current_dir)
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 5d8bb8caf7..4ed3f3ae3c 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -1436,7 +1436,7 @@ update_places (GtkPlacesSidebar *sidebar)
                                          _("New bookmark"), new_bookmark_icon, NULL, NULL,
                                          NULL, NULL, NULL, NULL, 0,
                                          _("Add a new bookmark"));
-  gtk_widget_add_style_class (sidebar->new_bookmark_row, "sidebar-new-bookmark-row");
+  gtk_widget_add_css_class (sidebar->new_bookmark_row, "sidebar-new-bookmark-row");
   g_object_unref (new_bookmark_icon);
 
   /* network */
@@ -2644,7 +2644,7 @@ create_rename_popover (GtkPlacesSidebar *sidebar)
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
   g_free (str);
   button = gtk_button_new_with_mnemonic (_("_Rename"));
-  gtk_widget_add_style_class (button, "suggested-action");
+  gtk_widget_add_css_class (button, "suggested-action");
   g_signal_connect (button, "clicked", G_CALLBACK (do_rename), sidebar);
   error = gtk_label_new ("");
   gtk_widget_set_halign (error, GTK_ALIGN_START);
@@ -2681,9 +2681,9 @@ update_popover_shadowing (GtkWidget *row,
   g_object_set_data (G_OBJECT (row), "popover-count", GINT_TO_POINTER (count));
 
   if (count > 0)
-    gtk_widget_add_style_class (row, "has-open-popup");
+    gtk_widget_add_css_class (row, "has-open-popup");
   else
-    gtk_widget_remove_style_class (row, "has-open-popup");
+    gtk_widget_remove_css_class (row, "has-open-popup");
 }
 
 static void
@@ -4051,7 +4051,7 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
                                   GTK_POLICY_AUTOMATIC);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sidebar->swin), GTK_SHADOW_IN);
 
-  gtk_widget_add_style_class (GTK_WIDGET (sidebar), "sidebar");
+  gtk_widget_add_css_class (GTK_WIDGET (sidebar), "sidebar");
 
   /* list box */
   sidebar->list_box = gtk_list_box_new ();
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index 250560f300..c1af705cf7 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -605,7 +605,7 @@ populate_servers (GtkPlacesView *view)
       gtk_widget_set_hexpand (label, TRUE);
       gtk_label_set_xalign (GTK_LABEL (label), 0.0);
       gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
-      gtk_widget_add_style_class (label, "dim-label");
+      gtk_widget_add_css_class (label, "dim-label");
       gtk_container_add (GTK_CONTAINER (grid), label);
 
       /* remove button */
@@ -613,7 +613,7 @@ populate_servers (GtkPlacesView *view)
       gtk_widget_set_halign (button, GTK_ALIGN_END);
       gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
-      gtk_widget_add_style_class (button, "sidebar-button");
+      gtk_widget_add_css_class (button, "sidebar-button");
       gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 2);
 
       gtk_container_add (GTK_CONTAINER (row), grid);
@@ -1900,9 +1900,9 @@ on_address_entry_text_changed (GtkPlacesView *view)
 out:
   gtk_widget_set_sensitive (priv->connect_button, supported);
   if (scheme && !supported)
-    gtk_widget_add_style_class (priv->address_entry, GTK_STYLE_CLASS_ERROR);
+    gtk_widget_add_css_class (priv->address_entry, GTK_STYLE_CLASS_ERROR);
   else
-    gtk_widget_add_style_class (priv->address_entry, GTK_STYLE_CLASS_ERROR);
+    gtk_widget_add_css_class (priv->address_entry, GTK_STYLE_CLASS_ERROR);
 
   g_free (address);
   g_free (scheme);
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index 3bacdc53f9..6befff191f 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -211,7 +211,7 @@ gtk_popover_menu_init (GtkPopoverMenu *popover)
   g_signal_connect (stack, "notify::visible-child-name",
                     G_CALLBACK (visible_submenu_changed), popover);
 
-  gtk_widget_add_style_class (GTK_WIDGET (popover), "menu");
+  gtk_widget_add_css_class (GTK_WIDGET (popover), "menu");
 
   controller = gtk_event_controller_key_new ();
   g_signal_connect (controller, "focus-out", G_CALLBACK (focus_out), popover);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index d0d8786d6b..42d53dd74b 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -281,14 +281,14 @@ update_fraction_classes (GtkProgressBar *pbar)
     }
 
   if (empty)
-    gtk_widget_add_style_class (priv->trough_widget, "empty");
+    gtk_widget_add_css_class (priv->trough_widget, "empty");
   else
-    gtk_widget_remove_style_class (priv->trough_widget, "empty");
+    gtk_widget_remove_css_class (priv->trough_widget, "empty");
 
   if (full)
-    gtk_widget_add_style_class (priv->trough_widget, "full");
+    gtk_widget_add_css_class (priv->trough_widget, "full");
   else
-    gtk_widget_remove_style_class (priv->trough_widget, "full");
+    gtk_widget_remove_css_class (priv->trough_widget, "full");
 }
 
 static void
@@ -341,24 +341,24 @@ update_node_classes (GtkProgressBar *pbar)
     }
 
   if (left)
-    gtk_widget_add_style_class (priv->progress_widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_add_css_class (priv->progress_widget, GTK_STYLE_CLASS_LEFT);
   else
-    gtk_widget_remove_style_class (priv->progress_widget, GTK_STYLE_CLASS_LEFT);
+    gtk_widget_remove_css_class (priv->progress_widget, GTK_STYLE_CLASS_LEFT);
 
   if (right)
-    gtk_widget_add_style_class (priv->progress_widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_add_css_class (priv->progress_widget, GTK_STYLE_CLASS_RIGHT);
   else
-    gtk_widget_remove_style_class (priv->progress_widget, GTK_STYLE_CLASS_RIGHT);
+    gtk_widget_remove_css_class (priv->progress_widget, GTK_STYLE_CLASS_RIGHT);
 
   if (top)
-    gtk_widget_add_style_class (priv->progress_widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_add_css_class (priv->progress_widget, GTK_STYLE_CLASS_TOP);
   else
-    gtk_widget_remove_style_class (priv->progress_widget, GTK_STYLE_CLASS_TOP);
+    gtk_widget_remove_css_class (priv->progress_widget, GTK_STYLE_CLASS_TOP);
 
   if (bottom)
-    gtk_widget_add_style_class (priv->progress_widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_add_css_class (priv->progress_widget, GTK_STYLE_CLASS_BOTTOM);
   else
-    gtk_widget_remove_style_class (priv->progress_widget, GTK_STYLE_CLASS_BOTTOM);
+    gtk_widget_remove_css_class (priv->progress_widget, GTK_STYLE_CLASS_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_style_class (priv->progress_widget, GTK_STYLE_CLASS_PULSE);
+  gtk_widget_add_css_class (priv->progress_widget, GTK_STYLE_CLASS_PULSE);
 
   inverted = priv->inverted;
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
@@ -701,7 +701,7 @@ gtk_progress_bar_act_mode_leave (GtkProgressBar *pbar)
     gtk_widget_remove_tick_callback (GTK_WIDGET (pbar), priv->tick_id);
   priv->tick_id = 0;
 
-  gtk_widget_remove_style_class (priv->progress_widget, GTK_STYLE_CLASS_PULSE);
+  gtk_widget_remove_css_class (priv->progress_widget, GTK_STYLE_CLASS_PULSE);
   update_node_classes (pbar);
 }
 
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index f05069fa32..9feab541fc 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -718,13 +718,13 @@ update_highlight_position (GtkRange *range)
 
   if (should_invert (range))
     {
-      gtk_widget_add_style_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_style_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_add_css_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_remove_css_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
     }
   else
     {
-      gtk_widget_add_style_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_remove_style_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_add_css_class (priv->highlight_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_remove_css_class (priv->highlight_widget, GTK_STYLE_CLASS_BOTTOM);
     }
 }
 
@@ -738,13 +738,13 @@ update_fill_position (GtkRange *range)
 
   if (should_invert (range))
     {
-      gtk_widget_add_style_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
-      gtk_widget_remove_style_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_add_css_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_remove_css_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
     }
   else
     {
-      gtk_widget_add_style_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
-      gtk_widget_remove_style_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
+      gtk_widget_add_css_class (priv->fill_widget, GTK_STYLE_CLASS_TOP);
+      gtk_widget_remove_css_class (priv->fill_widget, GTK_STYLE_CLASS_BOTTOM);
     }
 }
 
@@ -1664,7 +1664,7 @@ range_grab_add (GtkRange  *range,
    */
   priv->grab_location = location;
 
-  gtk_widget_add_style_class (GTK_WIDGET (range), "dragging");
+  gtk_widget_add_css_class (GTK_WIDGET (range), "dragging");
 }
 
 static void
@@ -1674,9 +1674,9 @@ update_zoom_state (GtkRange *range,
   GtkRangePrivate *priv = gtk_range_get_instance_private (range);
 
   if (enabled)
-    gtk_widget_add_style_class (GTK_WIDGET (range), "fine-tune");
+    gtk_widget_add_css_class (GTK_WIDGET (range), "fine-tune");
   else
-    gtk_widget_remove_style_class (GTK_WIDGET (range), "fine-tune");
+    gtk_widget_remove_css_class (GTK_WIDGET (range), "fine-tune");
 
   priv->zoom = enabled;
 }
@@ -1693,7 +1693,7 @@ range_grab_remove (GtkRange *range)
 
   update_zoom_state (range, FALSE);
 
-  gtk_widget_remove_style_class (GTK_WIDGET (range), "dragging");
+  gtk_widget_remove_css_class (GTK_WIDGET (range), "dragging");
 }
 
 static GtkScrollType
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index e49675934a..b08c30386c 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1046,17 +1046,17 @@ update_value_position (GtkScale *scale)
   if (!priv->value_widget)
     return;
 
-  gtk_widget_remove_style_class (priv->value_widget, GTK_STYLE_CLASS_TOP);
-  gtk_widget_remove_style_class (priv->value_widget, GTK_STYLE_CLASS_RIGHT);
-  gtk_widget_remove_style_class (priv->value_widget, GTK_STYLE_CLASS_BOTTOM);
-  gtk_widget_remove_style_class (priv->value_widget, GTK_STYLE_CLASS_LEFT);
+  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);
 
   switch (priv->value_pos)
     {
-    case GTK_POS_TOP:    gtk_widget_add_style_class (priv->value_widget, GTK_STYLE_CLASS_TOP); break;
-    case GTK_POS_RIGHT:  gtk_widget_add_style_class (priv->value_widget, GTK_STYLE_CLASS_RIGHT); break;
-    case GTK_POS_BOTTOM: gtk_widget_add_style_class (priv->value_widget, GTK_STYLE_CLASS_BOTTOM); break;
-    case GTK_POS_LEFT:   gtk_widget_add_style_class (priv->value_widget, GTK_STYLE_CLASS_LEFT); break;
+    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 ();
     }
@@ -1652,8 +1652,8 @@ gtk_scale_clear_marks (GtkScale *scale)
   g_clear_pointer (&priv->top_marks_widget, gtk_widget_unparent);
   g_clear_pointer (&priv->bottom_marks_widget, gtk_widget_unparent);
 
-  gtk_widget_remove_style_class (GTK_WIDGET (scale), "marks-before");
-  gtk_widget_remove_style_class (GTK_WIDGET (scale), "marks-after");
+  gtk_widget_remove_css_class (GTK_WIDGET (scale), "marks-before");
+  gtk_widget_remove_css_class (GTK_WIDGET (scale), "marks-after");
 
   _gtk_range_set_stop_values (GTK_RANGE (scale), NULL, 0);
 
@@ -1728,7 +1728,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                    (priv->value_widget &&
                                     (priv->value_pos == GTK_POS_TOP || priv->value_pos == GTK_POS_LEFT)) ?
                                      priv->value_widget : NULL);
-          gtk_widget_add_style_class (priv->top_marks_widget, GTK_STYLE_CLASS_TOP);
+          gtk_widget_add_css_class (priv->top_marks_widget, GTK_STYLE_CLASS_TOP);
         }
       marks_widget = priv->top_marks_widget;
     }
@@ -1747,7 +1747,7 @@ gtk_scale_add_mark (GtkScale        *scale,
                                     (priv->value_widget &&
                                      (priv->value_pos == GTK_POS_BOTTOM || priv->value_pos == 
GTK_POS_RIGHT)) ?
                                       priv->value_widget: NULL);
-          gtk_widget_add_style_class (priv->bottom_marks_widget, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_add_css_class (priv->bottom_marks_widget, GTK_STYLE_CLASS_BOTTOM);
         }
       marks_widget = priv->bottom_marks_widget;
     }
@@ -1802,10 +1802,10 @@ gtk_scale_add_mark (GtkScale        *scale,
   g_free (values);
 
   if (priv->top_marks_widget)
-    gtk_widget_add_style_class (GTK_WIDGET (scale), "marks-before");
+    gtk_widget_add_css_class (GTK_WIDGET (scale), "marks-before");
 
   if (priv->bottom_marks_widget)
-    gtk_widget_add_style_class (GTK_WIDGET (scale), "marks-after");
+    gtk_widget_add_css_class (GTK_WIDGET (scale), "marks-after");
 
   gtk_widget_queue_resize (widget);
 }
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 8f22f01311..740ca3efb0 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -383,7 +383,7 @@ gtk_scale_button_init (GtkScaleButton *button)
   g_object_ref_sink (priv->adjustment);
   gtk_range_set_adjustment (GTK_RANGE (priv->scale), priv->adjustment);
 
-  gtk_widget_add_style_class (GTK_WIDGET (button), "scale");
+  gtk_widget_add_css_class (GTK_WIDGET (button), "scale");
 
   controller = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL);
   g_signal_connect (controller, "scroll",
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index c992034499..2a9aef9700 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -469,13 +469,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_style_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
-          gtk_widget_remove_style_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
+          gtk_widget_add_css_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_remove_css_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
         }
       else
         {
-          gtk_widget_add_style_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
-          gtk_widget_remove_style_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_add_css_class (priv->hscrollbar, GTK_STYLE_CLASS_TOP);
+          gtk_widget_remove_css_class (priv->hscrollbar, GTK_STYLE_CLASS_BOTTOM);
         }
     }
 
@@ -489,13 +489,13 @@ update_scrollbar_positions (GtkScrolledWindow *scrolled_window)
           (priv->window_placement == GTK_CORNER_TOP_LEFT ||
            priv->window_placement == GTK_CORNER_BOTTOM_LEFT)))
         {
-          gtk_widget_add_style_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
-          gtk_widget_remove_style_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_add_css_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_remove_css_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
         }
       else
         {
-          gtk_widget_add_style_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
-          gtk_widget_remove_style_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
+          gtk_widget_add_css_class (priv->vscrollbar, GTK_STYLE_CLASS_LEFT);
+          gtk_widget_remove_css_class (priv->vscrollbar, GTK_STYLE_CLASS_RIGHT);
         }
     }
 }
@@ -1045,9 +1045,9 @@ indicator_set_over (Indicator *indicator,
   indicator->over = over;
 
   if (indicator->over)
-    gtk_widget_add_style_class (indicator->scrollbar, "hovering");
+    gtk_widget_add_css_class (indicator->scrollbar, "hovering");
   else
-    gtk_widget_remove_style_class (indicator->scrollbar, "hovering");
+    gtk_widget_remove_css_class (indicator->scrollbar, "hovering");
 
   gtk_widget_queue_resize (indicator->scrollbar);
 }
@@ -2445,9 +2445,9 @@ gtk_scrolled_window_set_shadow_type (GtkScrolledWindow *scrolled_window,
       priv->shadow_type = type;
 
       if (type != GTK_SHADOW_NONE)
-        gtk_widget_add_style_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_add_css_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_remove_css_class (GTK_WIDGET (scrolled_window), GTK_STYLE_CLASS_FRAME);
 
       g_object_notify_by_pspec (G_OBJECT (scrolled_window), properties[PROP_SHADOW_TYPE]);
     }
@@ -3764,7 +3764,7 @@ setup_indicator (GtkScrolledWindow *scrolled_window,
 
   indicator->scrollbar = scrollbar;
 
-  gtk_widget_add_style_class (scrollbar, "overlay-indicator");
+  gtk_widget_add_css_class (scrollbar, "overlay-indicator");
   g_signal_connect (adjustment, "value-changed",
                     G_CALLBACK (indicator_value_changed), indicator);
 
@@ -3785,7 +3785,7 @@ remove_indicator (GtkScrolledWindow *scrolled_window,
   scrollbar = indicator->scrollbar;
   indicator->scrollbar = NULL;
 
-  gtk_widget_remove_style_class (scrollbar, "overlay-indicator");
+  gtk_widget_remove_css_class (scrollbar, "overlay-indicator");
 
   adjustment = gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (scrollbar));
   g_signal_handlers_disconnect_by_data (adjustment, indicator);
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 1338b3e625..d69e941476 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -351,7 +351,7 @@ gtk_search_bar_init (GtkSearchBar *bar)
   gtk_widget_set_hexpand (priv->box_center, TRUE);
 
   priv->close_button = gtk_button_new_from_icon_name ("window-close-symbolic");
-  gtk_widget_add_style_class (priv->close_button, "close");
+  gtk_widget_add_css_class (priv->close_button, "close");
   gtk_center_box_set_end_widget (GTK_CENTER_BOX (priv->box_center), priv->close_button);
   gtk_widget_hide (priv->close_button);
 
diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c
index 6baf857b80..535aaf946a 100644
--- a/gtk/gtksearchentry.c
+++ b/gtk/gtksearchentry.c
@@ -540,7 +540,7 @@ gtk_search_entry_init (GtkSearchEntry *entry)
   g_signal_connect (press, "released", G_CALLBACK (gtk_search_entry_icon_release), entry);
   gtk_widget_add_controller (priv->icon, GTK_EVENT_CONTROLLER (press));
 
-  gtk_widget_add_style_class (GTK_WIDGET (entry), I_("search"));
+  gtk_widget_add_css_class (GTK_WIDGET (entry), I_("search"));
 }
 
 /**
diff --git a/gtk/gtkshortcutlabel.c b/gtk/gtkshortcutlabel.c
index 9dc6355333..55ca247589 100644
--- a/gtk/gtkshortcutlabel.c
+++ b/gtk/gtkshortcutlabel.c
@@ -258,7 +258,7 @@ dim_label (const gchar *text)
   GtkWidget *label;
 
   label = gtk_label_new (text);
-  gtk_widget_add_style_class (label, "dim-label");
+  gtk_widget_add_css_class (label, "dim-label");
 
   return label;
 }
@@ -284,7 +284,7 @@ display_shortcut (GtkWidget       *self,
       if (i < n_mods)
         gtk_widget_set_size_request (disp, 50, -1);
 
-      gtk_widget_add_style_class (disp, "keycap");
+      gtk_widget_add_css_class (disp, "keycap");
       gtk_label_set_use_markup (GTK_LABEL (disp), TRUE);
 
       gtk_widget_set_parent (disp, self);
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index bf68dd678f..5269ae86a6 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -433,7 +433,7 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
                                  "visible", FALSE,
                                  NULL);
 
-  gtk_widget_remove_style_class (GTK_WIDGET (self->switcher), GTK_STYLE_CLASS_LINKED);
+  gtk_widget_remove_css_class (GTK_WIDGET (self->switcher), GTK_STYLE_CLASS_LINKED);
 
   self->show_all = gtk_button_new_with_mnemonic (_("_Show All"));
   gtk_widget_hide (self->show_all);
@@ -729,7 +729,7 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
   {
     GtkWidget *w;
 
-    gtk_widget_add_style_class (GTK_WIDGET (self->switcher), "circular");
+    gtk_widget_add_css_class (GTK_WIDGET (self->switcher), "circular");
 
     for (w = gtk_widget_get_first_child (GTK_WIDGET (self->switcher));
          w != NULL;
@@ -737,7 +737,7 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self)
       {
         GtkWidget *label;
 
-        gtk_widget_add_style_class (w, "circular");
+        gtk_widget_add_css_class (w, "circular");
 
         label = gtk_bin_get_child (GTK_BIN (w));
         gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 84e7298964..14cb212e1c 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -917,18 +917,18 @@ 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_style_class (label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (label, GTK_STYLE_CLASS_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_style_class (label, GTK_STYLE_CLASS_TITLE);
+  gtk_widget_add_css_class (label, GTK_STYLE_CLASS_TITLE);
   gtk_stack_add_named (priv->title_stack, label, "search");
 
   priv->menu_button = g_object_new (GTK_TYPE_MENU_BUTTON,
                                     "focus-on-click", FALSE,
                                     NULL);
-  gtk_widget_add_style_class (GTK_WIDGET (priv->menu_button), "flat");
+  gtk_widget_add_css_class (GTK_WIDGET (priv->menu_button), "flat");
   gtk_stack_add_named (priv->title_stack, GTK_WIDGET (priv->menu_button), "sections");
 
   priv->popover = g_object_new (GTK_TYPE_POPOVER,
@@ -971,7 +971,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
                       "halign", GTK_ALIGN_CENTER,
                       "orientation", GTK_ORIENTATION_VERTICAL,
                       NULL);
-  gtk_widget_add_style_class (GTK_WIDGET (box), "shortcuts-search-results");
+  gtk_widget_add_css_class (GTK_WIDGET (box), "shortcuts-search-results");
   gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET (box));
   gtk_stack_add_named (priv->stack, scroller, "internal-search");
 
@@ -997,7 +997,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
                         "halign", GTK_ALIGN_CENTER,
                         "valign", GTK_ALIGN_CENTER,
                         NULL);
-  gtk_widget_add_style_class (empty, GTK_STYLE_CLASS_DIM_LABEL);
+  gtk_widget_add_css_class (empty, GTK_STYLE_CLASS_DIM_LABEL);
   gtk_grid_attach (GTK_GRID (empty),
                    g_object_new (GTK_TYPE_IMAGE,
                                  "icon-name", "edit-find-symbolic",
diff --git a/gtk/gtksidebarrow.c b/gtk/gtksidebarrow.c
index 35ce3d0534..b914553240 100644
--- a/gtk/gtksidebarrow.c
+++ b/gtk/gtksidebarrow.c
@@ -352,7 +352,7 @@ gtk_sidebar_row_set_property (GObject      *object,
                                    (GtkCallback) gtk_widget_destroy,
                                    NULL);
 
-            gtk_widget_add_style_class (GTK_WIDGET (self), "sidebar-placeholder-row");
+            gtk_widget_add_css_class (GTK_WIDGET (self), "sidebar-placeholder-row");
           }
 
         break;
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index c2e916b87b..e199433db9 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -965,7 +965,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
   gtk_widget_set_parent (priv->entry, GTK_WIDGET (spin_button));
 
   priv->down_button = gtk_button_new_from_icon_name ("value-decrease-symbolic");
-  gtk_widget_add_style_class (priv->down_button, "down");
+  gtk_widget_add_css_class (priv->down_button, "down");
   gtk_widget_set_can_focus (priv->down_button, FALSE);
   gtk_widget_set_parent (priv->down_button, GTK_WIDGET (spin_button));
 
@@ -980,7 +980,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
   gtk_widget_add_controller (GTK_WIDGET (priv->down_button), GTK_EVENT_CONTROLLER (gesture));
 
   priv->up_button = gtk_button_new_from_icon_name ("value-increase-symbolic");
-  gtk_widget_add_style_class (priv->up_button, "up");
+  gtk_widget_add_css_class (priv->up_button, "up");
   gtk_widget_set_can_focus (priv->up_button, FALSE);
   gtk_widget_set_parent (priv->up_button, GTK_WIDGET (spin_button));
 
diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c
index 82ef454312..03b909017d 100644
--- a/gtk/gtkstacksidebar.c
+++ b/gtk/gtkstacksidebar.c
@@ -172,7 +172,7 @@ gtk_stack_sidebar_init (GtkStackSidebar *self)
   g_signal_connect (self->list, "row-selected",
                     G_CALLBACK (gtk_stack_sidebar_row_selected), self);
 
-  gtk_widget_add_style_class (GTK_WIDGET (self), "sidebar");
+  gtk_widget_add_css_class (GTK_WIDGET (self), "sidebar");
 
   self->rows = g_hash_table_new (NULL, NULL);
 }
@@ -199,9 +199,9 @@ update_row (GtkStackSidebar *self,
   gtk_widget_set_visible (row, visible && title != NULL);
 
   if (needs_attention)
-    gtk_widget_add_style_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_add_css_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
   else
-    gtk_widget_remove_style_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_remove_css_class (row, GTK_STYLE_CLASS_NEEDS_ATTENTION);
 
   g_free (title);
 }
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 11708114ca..54e0aaef99 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -118,7 +118,7 @@ gtk_stack_switcher_init (GtkStackSwitcher *switcher)
 
   priv->buttons = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL);
 
-  gtk_widget_add_style_class (GTK_WIDGET (switcher), "linked");
+  gtk_widget_add_css_class (GTK_WIDGET (switcher), "linked");
 
   formats = gdk_content_formats_new (NULL, 0);
   dest = gtk_drop_target_new (formats, 0);
@@ -171,8 +171,8 @@ rebuild_child (GtkWidget   *self,
       if (title != NULL)
         gtk_widget_set_tooltip_text (GTK_WIDGET (self), title);
 
-      gtk_widget_remove_style_class (self, "text-button");
-      gtk_widget_add_style_class (self, "image-button");
+      gtk_widget_remove_css_class (self, "text-button");
+      gtk_widget_add_css_class (self, "image-button");
     }
   else if (title != NULL)
     {
@@ -180,8 +180,8 @@ rebuild_child (GtkWidget   *self,
 
       gtk_widget_set_tooltip_text (GTK_WIDGET (self), NULL);
 
-      gtk_widget_remove_style_class (self, "image-button");
-      gtk_widget_add_style_class (self, "text-button");
+      gtk_widget_remove_css_class (self, "image-button");
+      gtk_widget_add_css_class (self, "text-button");
     }
 
   if (button_child)
@@ -213,9 +213,9 @@ update_button (GtkStackSwitcher *self,
   gtk_widget_set_visible (button, visible && (title != NULL || icon_name != NULL));
 
   if (needs_attention)
-    gtk_widget_add_style_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_add_css_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
   else
-    gtk_widget_remove_style_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
+    gtk_widget_remove_css_class (button, GTK_STYLE_CLASS_NEEDS_ATTENTION);
 
   g_free (title);
   g_free (icon_name);
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 752d2de1a0..02000b9660 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1899,7 +1899,7 @@ gtk_text_ensure_magnifier (GtkText *self)
   gtk_widget_set_size_request (priv->magnifier, 100, 60);
   _gtk_magnifier_set_magnification (GTK_MAGNIFIER (priv->magnifier), 2.0);
   priv->magnifier_popover = gtk_popover_new (GTK_WIDGET (self));
-  gtk_widget_add_style_class (priv->magnifier_popover, "magnifier");
+  gtk_widget_add_css_class (priv->magnifier_popover, "magnifier");
   gtk_popover_set_autohide (GTK_POPOVER (priv->magnifier_popover), FALSE);
   gtk_container_add (GTK_CONTAINER (priv->magnifier_popover),
                      priv->magnifier);
@@ -5337,11 +5337,11 @@ gtk_text_set_editable (GtkText  *self,
           priv->preedit_length = 0;
           priv->preedit_cursor = 0;
 
-          gtk_widget_remove_style_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
+          gtk_widget_remove_css_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
         }
       else
         {
-          gtk_widget_add_style_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
+          gtk_widget_add_css_class (GTK_WIDGET (self), GTK_STYLE_CLASS_READ_ONLY);
         }
 
       priv->editable = is_editable;
@@ -6004,7 +6004,7 @@ append_bubble_item (GtkText    *self,
   image = gtk_image_new_from_icon_name (icon_name);
   gtk_widget_show (image);
   gtk_container_add (GTK_CONTAINER (item), image);
-  gtk_widget_add_style_class (item, "image-button");
+  gtk_widget_add_css_class (item, "image-button");
   gtk_actionable_set_action_name (GTK_ACTIONABLE (item), action_name);
   gtk_widget_show (GTK_WIDGET (item));
   gtk_container_add (GTK_CONTAINER (toolbar), item);
@@ -6039,7 +6039,7 @@ gtk_text_selection_bubble_popup_show (gpointer user_data)
   g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
 
   priv->selection_bubble = gtk_popover_new (GTK_WIDGET (self));
-  gtk_widget_add_style_class (priv->selection_bubble, GTK_STYLE_CLASS_TOUCH_SELECTION);
+  gtk_widget_add_css_class (priv->selection_bubble, GTK_STYLE_CLASS_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",
@@ -6049,7 +6049,7 @@ gtk_text_selection_bubble_popup_show (gpointer user_data)
   g_object_set (box, "margin", 10, NULL);
   gtk_widget_show (box);
   toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_add_style_class (toolbar, "linked");
+  gtk_widget_add_css_class (toolbar, "linked");
   gtk_container_add (GTK_CONTAINER (priv->selection_bubble), box);
   gtk_container_add (GTK_CONTAINER (box), toolbar);
 
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index a4d86bbe24..c22a928731 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -221,12 +221,12 @@ _gtk_text_handle_ensure_widget (GtkTextHandle         *handle,
 
       if (pos == GTK_TEXT_HANDLE_POSITION_SELECTION_END)
         {
-          gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_BOTTOM);
+          gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_BOTTOM);
           if (priv->mode == GTK_TEXT_HANDLE_MODE_CURSOR)
-            gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_INSERTION_CURSOR);
+            gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_INSERTION_CURSOR);
         }
       else
-        gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_TOP);
+        gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_TOP);
     }
 
   return priv->windows[pos].widget;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 39249a9d18..ac190dc8b9 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -1623,7 +1623,7 @@ gtk_text_view_init (GtkTextView *text_view)
   gtk_widget_set_can_focus (widget, TRUE);
   gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
 
-  gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_VIEW);
 
   gtk_widget_set_cursor_from_name (widget, "text");
 
@@ -1760,7 +1760,7 @@ _gtk_text_view_ensure_magnifier (GtkTextView *text_view)
   priv->magnifier = _gtk_magnifier_new (GTK_WIDGET (text_view));
   _gtk_magnifier_set_magnification (GTK_MAGNIFIER (priv->magnifier), 2.0);
   priv->magnifier_popover = gtk_popover_new (GTK_WIDGET (text_view));
-  gtk_widget_add_style_class (priv->magnifier_popover, "magnifier");
+  gtk_widget_add_css_class (priv->magnifier_popover, "magnifier");
   gtk_popover_set_autohide (GTK_POPOVER (priv->magnifier_popover), FALSE);
   gtk_container_add (GTK_CONTAINER (priv->magnifier_popover),
                      priv->magnifier);
@@ -8847,7 +8847,7 @@ append_bubble_item (GtkTextView *text_view,
   gtk_widget_set_focus_on_click (item, FALSE);
   image = gtk_image_new_from_icon_name (icon_name);
   gtk_container_add (GTK_CONTAINER (item), image);
-  gtk_widget_add_style_class (item, "image-button");
+  gtk_widget_add_css_class (item, "image-button");
   gtk_actionable_set_action_name (GTK_ACTIONABLE (item), action_name);
 
   gtk_container_add (GTK_CONTAINER (toolbar), item);
@@ -8871,7 +8871,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
   g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
 
   priv->selection_bubble = gtk_popover_new (GTK_WIDGET (text_view));
-  gtk_widget_add_style_class (priv->selection_bubble, GTK_STYLE_CLASS_TOUCH_SELECTION);
+  gtk_widget_add_css_class (priv->selection_bubble, GTK_STYLE_CLASS_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",
@@ -8880,7 +8880,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
   g_object_set (box, "margin", 10, NULL);
   toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_widget_add_style_class (toolbar, "linked");
+  gtk_widget_add_css_class (toolbar, "linked");
   gtk_container_add (GTK_CONTAINER (priv->selection_bubble), box);
   gtk_container_add (GTK_CONTAINER (box), toolbar);
 
@@ -9628,9 +9628,9 @@ gtk_text_view_set_monospace (GtkTextView *text_view,
   if (has_monospace != monospace)
     {
       if (monospace)
-        gtk_widget_add_style_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+        gtk_widget_add_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+        gtk_widget_remove_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
 
       g_object_notify (G_OBJECT (text_view), "monospace");
     }
@@ -9649,7 +9649,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_style_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
+  return gtk_widget_has_css_class (GTK_WIDGET (text_view), GTK_STYLE_CLASS_MONOSPACE);
 }
 
 static void
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 1f2f6cc09a..78c416bf3a 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -192,7 +192,7 @@ gtk_toggle_button_init (GtkToggleButton *toggle_button)
 
   priv->active = FALSE;
 
-  gtk_widget_add_style_class (GTK_WIDGET (toggle_button), "toggle");
+  gtk_widget_add_css_class (GTK_WIDGET (toggle_button), "toggle");
 }
 
 
diff --git a/gtk/gtktreepopover.c b/gtk/gtktreepopover.c
index 1948afa9b9..ee98a9d763 100644
--- a/gtk/gtktreepopover.c
+++ b/gtk/gtktreepopover.c
@@ -263,7 +263,7 @@ gtk_tree_popover_init (GtkTreePopover *popover)
   gtk_stack_set_interpolate_size (GTK_STACK (stack), TRUE);
   gtk_container_add (GTK_CONTAINER (popover), stack);
 
-  gtk_widget_add_style_class (GTK_WIDGET (popover), GTK_STYLE_CLASS_MENU);
+  gtk_widget_add_css_class (GTK_WIDGET (popover), GTK_STYLE_CLASS_MENU);
 }
 
 static GtkCellArea *
@@ -680,19 +680,19 @@ gtk_tree_popover_create_item (GtkTreePopover *popover,
 
       item = gtk_gizmo_new ("modelbutton", NULL, NULL, NULL, NULL);
       gtk_widget_set_layout_manager (item, gtk_box_layout_new (GTK_ORIENTATION_HORIZONTAL));
-      gtk_widget_add_style_class (item, "flat");
+      gtk_widget_add_css_class (item, "flat");
 
       if (header_item)
         {
           indicator = gtk_builtin_icon_new ("arrow");
-          gtk_widget_add_style_class (indicator, "left");
+          gtk_widget_add_css_class (indicator, "left");
           gtk_widget_set_parent (indicator, item);
         }
 
       gtk_widget_set_parent (view, item);
 
       indicator = gtk_builtin_icon_new (has_submenu ? "arrow" : "none");
-      gtk_widget_add_style_class (indicator, "right");
+      gtk_widget_add_css_class (indicator, "right");
       gtk_widget_set_parent (indicator, item);
 
       controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 5d5eee721e..011a97c99c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -1781,7 +1781,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_style_class (GTK_WIDGET (tree_view), GTK_STYLE_CLASS_VIEW);
+  gtk_widget_add_css_class (GTK_WIDGET (tree_view), GTK_STYLE_CLASS_VIEW);
 
   widget_node = gtk_widget_get_css_node (GTK_WIDGET (tree_view));
   tree_view->header_node = gtk_css_node_new ();
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 337e33aed2..fafdfb7eb4 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -354,7 +354,7 @@ gtk_viewport_init (GtkViewport *viewport)
   priv->hadjustment = NULL;
   priv->vadjustment = NULL;
 
-  gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_FRAME);
+  gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_FRAME);
   viewport_set_adjustment (viewport, GTK_ORIENTATION_HORIZONTAL, NULL);
   viewport_set_adjustment (viewport, GTK_ORIENTATION_VERTICAL, NULL);
 }
@@ -461,9 +461,9 @@ gtk_viewport_set_shadow_type (GtkViewport   *viewport,
       priv->shadow_type = type;
 
       if (type != GTK_SHADOW_NONE)
-        gtk_widget_add_style_class (GTK_WIDGET (viewport), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_add_css_class (GTK_WIDGET (viewport), GTK_STYLE_CLASS_FRAME);
       else
-        gtk_widget_remove_style_class (GTK_WIDGET (viewport), GTK_STYLE_CLASS_FRAME);
+        gtk_widget_remove_css_class (GTK_WIDGET (viewport), GTK_STYLE_CLASS_FRAME);
 
       g_object_notify (G_OBJECT (viewport), "shadow-type");
     }
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8175497d54..447d39a16f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5458,9 +5458,9 @@ _gtk_widget_set_has_default (GtkWidget *widget,
   priv->has_default = has_default;
 
   if (has_default)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_DEFAULT);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_DEFAULT);
   else
-    gtk_widget_remove_style_class (widget, GTK_STYLE_CLASS_DEFAULT);
+    gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_DEFAULT);
 }
 
 /**
@@ -9728,7 +9728,7 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable,
       GSList *l;
 
       for (l = style_data->classes; l; l = l->next)
-        gtk_widget_add_style_class (GTK_WIDGET (buildable), (const char *)l->data);
+        gtk_widget_add_css_class (GTK_WIDGET (buildable), (const char *)l->data);
 
       gtk_widget_reset_style (GTK_WIDGET (buildable));
 
@@ -13128,50 +13128,50 @@ gtk_widget_class_query_action (GtkWidgetClass      *widget_class,
 }
 
 /**
- * gtk_widget_add_style_class:
+ * gtk_widget_add_css_class:
  * @widget: a #GtkWidget
- * @style_class: The style class to add to @widget, without
+ * @css_class: The style class to add to @widget, without
  *   the leading '.' used for notation of style classes
  *
- * Adds @style_class to @widget. After calling this function, @widget's
- * style will match for @style_class, after the CSS matching rules.
+ * Adds @css_class to @widget. After calling this function, @widget's
+ * style will match for @css_class, after the CSS matching rules.
  */
 void
-gtk_widget_add_style_class (GtkWidget  *widget,
-                            const char *style_class)
+gtk_widget_add_css_class (GtkWidget  *widget,
+                          const char *css_class)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (style_class != NULL);
-  g_return_if_fail (style_class[0] != '\0');
-  g_return_if_fail (style_class[0] != '.');
+  g_return_if_fail (css_class != NULL);
+  g_return_if_fail (css_class[0] != '\0');
+  g_return_if_fail (css_class[0] != '.');
 
-  gtk_css_node_add_class (priv->cssnode, g_quark_from_string (style_class));
+  gtk_css_node_add_class (priv->cssnode, g_quark_from_string (css_class));
 }
 
 /**
- * gtk_widget_remove_style_class:
+ * gtk_widget_remove_css_class:
  * @widget: a #GtkWidget
- * @style_class: The style class to remove from @widget, without
+ * @css_class: The style class to remove from @widget, without
  *   the leading '.' used for notation of style classes
  *
- * Removes @style_class from @widget. After this, the style of @widget
- * will stop matching for @style_class.
+ * Removes @css_class from @widget. After this, the style of @widget
+ * will stop matching for @css_class.
  */
 void
-gtk_widget_remove_style_class (GtkWidget  *widget,
-                               const char *style_class)
+gtk_widget_remove_css_class (GtkWidget  *widget,
+                             const char *css_class)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
   GQuark class_quark;
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (style_class != NULL);
-  g_return_if_fail (style_class[0] != '\0');
-  g_return_if_fail (style_class[0] != '.');
+  g_return_if_fail (css_class != NULL);
+  g_return_if_fail (css_class[0] != '\0');
+  g_return_if_fail (css_class[0] != '.');
 
-  class_quark = g_quark_try_string (style_class);
+  class_quark = g_quark_try_string (css_class);
   if (!class_quark)
     return;
 
@@ -13179,29 +13179,29 @@ gtk_widget_remove_style_class (GtkWidget  *widget,
 }
 
 /**
- * gtk_widget_has_style_class:
+ * gtk_widget_has_css_class:
  * @widget: a #GtkWidget
- * @style_class: A CSS style class, without the leading '.'
+ * @css_class: A CSS style class, without the leading '.'
  *   used for notation of style classes
  *
- * Returns whether @style_class is currently applied to @widget.
+ * Returns whether @css_class is currently applied to @widget.
  *
- * Returns: %TRUE if @style_class is currently applied to @widget,
+ * Returns: %TRUE if @css_class is currently applied to @widget,
  *   %FALSE otherwise.
  */
 gboolean
-gtk_widget_has_style_class (GtkWidget  *widget,
-                            const char *style_class)
+gtk_widget_has_css_class (GtkWidget  *widget,
+                          const char *css_class)
 {
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
   GQuark class_quark;
 
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-  g_return_val_if_fail (style_class != NULL, FALSE);
-  g_return_val_if_fail (style_class[0] != '\0', FALSE);
-  g_return_val_if_fail (style_class[0] != '.', FALSE);
+  g_return_val_if_fail (css_class != NULL, FALSE);
+  g_return_val_if_fail (css_class[0] != '\0', FALSE);
+  g_return_val_if_fail (css_class[0] != '.', FALSE);
 
-  class_quark = g_quark_try_string (style_class);
+  class_quark = g_quark_try_string (css_class);
   if (!class_quark)
     return FALSE;
 
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 957fb58853..5cbea4b35f 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -971,14 +971,14 @@ void                    gtk_widget_snapshot_child       (GtkWidget   *widget,
 GDK_AVAILABLE_IN_ALL
 gboolean                gtk_widget_should_layout        (GtkWidget   *widget);
 GDK_AVAILABLE_IN_ALL
-void                    gtk_widget_add_style_class      (GtkWidget   *widget,
-                                                         const char  *style_class);
+void                    gtk_widget_add_css_class        (GtkWidget   *widget,
+                                                         const char  *css_class);
 GDK_AVAILABLE_IN_ALL
-void                    gtk_widget_remove_style_class   (GtkWidget   *widget,
-                                                         const char  *style_class);
+void                    gtk_widget_remove_css_class     (GtkWidget   *widget,
+                                                         const char  *css_class);
 GDK_AVAILABLE_IN_ALL
-gboolean                gtk_widget_has_style_class      (GtkWidget   *widget,
-                                                         const char  *style_class);
+gboolean                gtk_widget_has_css_class        (GtkWidget   *widget,
+                                                         const char  *css_class);
 
 
 
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c558b3c2f9..dc45543e8b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -3690,9 +3690,9 @@ gtk_window_enable_csd (GtkWindow *window)
 
   /* We need a visual with alpha for client shadows */
   if (priv->use_client_shadow)
-    gtk_widget_add_style_class (widget, GTK_STYLE_CLASS_CSD);
+    gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_CSD);
   else
-    gtk_widget_add_style_class (widget, "solid-csd");
+    gtk_widget_add_css_class (widget, "solid-csd");
 
   priv->client_decorated = TRUE;
 }
@@ -3751,7 +3751,7 @@ gtk_window_set_titlebar (GtkWindow *window,
   if (titlebar == NULL)
     {
       priv->client_decorated = FALSE;
-      gtk_widget_remove_style_class (widget, GTK_STYLE_CLASS_CSD);
+      gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_CSD);
 
       goto out;
     }
@@ -3773,7 +3773,7 @@ gtk_window_set_titlebar (GtkWindow *window,
       on_titlebar_title_notify (GTK_HEADER_BAR (titlebar), NULL, window);
     }
 
-  gtk_widget_add_style_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
+  gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
 
 out:
   if (was_mapped)
@@ -4789,8 +4789,8 @@ create_titlebar (GtkWindow *window)
                 "has-subtitle", FALSE,
                 "show-title-buttons", TRUE,
                 NULL);
-  gtk_widget_add_style_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
-  gtk_widget_add_style_class (titlebar, "default-decoration");
+  gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
+  gtk_widget_add_css_class (titlebar, "default-decoration");
 
   return titlebar;
 }
@@ -5693,42 +5693,42 @@ update_window_style_classes (GtkWindow *window)
   if (!priv->edge_constraints)
     {
       if (priv->tiled)
-        gtk_widget_add_style_class (widget, "titled");
+        gtk_widget_add_css_class (widget, "titled");
       else
-        gtk_widget_remove_style_class (widget, "tiled");
+        gtk_widget_remove_css_class (widget, "tiled");
     }
   else
     {
       if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED)
-        gtk_widget_add_style_class (widget, "titled-top");
+        gtk_widget_add_css_class (widget, "titled-top");
       else
-        gtk_widget_remove_style_class (widget, "tiled-top");
+        gtk_widget_remove_css_class (widget, "tiled-top");
 
       if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED)
-        gtk_widget_add_style_class (widget, "titled-right");
+        gtk_widget_add_css_class (widget, "titled-right");
       else
-        gtk_widget_remove_style_class (widget, "tiled-right");
+        gtk_widget_remove_css_class (widget, "tiled-right");
 
       if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED)
-        gtk_widget_add_style_class (widget, "titled-bottom");
+        gtk_widget_add_css_class (widget, "titled-bottom");
       else
-        gtk_widget_remove_style_class (widget, "tiled-bottom");
+        gtk_widget_remove_css_class (widget, "tiled-bottom");
 
       if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED)
-        gtk_widget_add_style_class (widget, "titled-left");
+        gtk_widget_add_css_class (widget, "titled-left");
       else
-        gtk_widget_remove_style_class (widget, "tiled-left");
+        gtk_widget_remove_css_class (widget, "tiled-left");
     }
 
   if (priv->maximized)
-    gtk_widget_add_style_class (widget, "maximized");
+    gtk_widget_add_css_class (widget, "maximized");
   else
-    gtk_widget_remove_style_class (widget, "maximized");
+    gtk_widget_remove_css_class (widget, "maximized");
 
   if (priv->fullscreen)
-    gtk_widget_add_style_class (widget, "fullscreen");
+    gtk_widget_add_css_class (widget, "fullscreen");
   else
-    gtk_widget_remove_style_class (widget, "fullscreen");
+    gtk_widget_remove_css_class (widget, "fullscreen");
 }
 
 static void


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