diff --git a/doc/reference/pidgin/pidgin-docs.xml b/doc/reference/pidgin/pidgin-docs.xml
--- a/doc/reference/pidgin/pidgin-docs.xml
+++ b/doc/reference/pidgin/pidgin-docs.xml
@@ -79,7 +79,7 @@
       <xi:include href="xml/pidginpresence.xml" />
       <xi:include href="xml/pidginpresenceicon.xml" />
       <xi:include href="xml/pidginstock.xml" />
-      <xi:include href="xml/pidginstyle.xml" />
+      <xi:include href="xml/pidginstylecontext.xml" />
       <xi:include href="xml/pidgintalkatu.xml" />
       <xi:include href="xml/pidgintooltip.xml" />
       <xi:include href="xml/pidginwindow.xml" />
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -54,7 +54,7 @@
 #include "pidgin/pidginlog.h"
 #include "pidgin/pidginmooddialog.h"
 #include "pidgin/pidginplugininfo.h"
-#include "pidgin/pidginstyle.h"
+#include "pidgin/pidginstylecontext.h"
 #include "pidgin/pidgintooltip.h"
 #include "pidgin/pidginwindow.h"
 #include "pidginmenutray.h"
@@ -3913,7 +3913,7 @@
 	theme = pidgin_blist_get_theme();
 	name_color = NULL;
 
-	dim_grey = pidgin_style_is_dark(NULL) ? "light slate grey" : "dim grey";
+	dim_grey = pidgin_style_context_is_dark(NULL) ? "light slate grey" : "dim grey";
 
 	if (theme) {
 		if (purple_presence_is_idle(presence)) {
@@ -5918,7 +5918,7 @@
 				textcolor = pidgin_theme_font_get_color_describe(pair);
 			else
 				/* If no theme them default to making idle buddy names grey */
-				textcolor = pidgin_style_is_dark(NULL) ? "light slate grey" : "dim grey";
+				textcolor = pidgin_style_context_is_dark(NULL) ? "light slate grey" : "dim grey";
 
 			if (textcolor) {
 				idle = g_strdup_printf("<span color='%s' font_desc='%s'>%d:%02d</span>",
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -59,7 +59,7 @@
 #include "pidginmessage.h"
 #include "pidginpresenceicon.h"
 #include "pidginstock.h"
-#include "pidginstyle.h"
+#include "pidginstylecontext.h"
 #include "pidgintooltip.h"
 #include "pidginwindow.h"
 
@@ -6330,7 +6330,7 @@
 			gchar *color_str;
 
 			gdk_rgba_parse(&color, styles[iter].color);
-			pidgin_style_adjust_contrast(gtk_widget_get_default_style(), &color);
+			pidgin_style_context_adjust_contrast(NULL, &color);
 
 			color_str = gdk_rgba_to_string(&color);
 			g_string_append_printf(str, "style \"%s\" {\n"
@@ -8003,8 +8003,8 @@
 	gdk_rgba_parse(&nick_highlight, DEFAULT_HIGHLIGHT_COLOR);
 	gdk_rgba_parse(&send_color, DEFAULT_SEND_COLOR);
 
-	pidgin_style_adjust_contrast(NULL, &nick_highlight);
-	pidgin_style_adjust_contrast(NULL, &send_color);
+	pidgin_style_context_adjust_contrast(NULL, &nick_highlight);
+	pidgin_style_context_adjust_contrast(NULL, &send_color);
 
 	srand(background.red * 65535 + background.green * 65535 + background.blue * 65535 + 1);
 
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -60,7 +60,7 @@
 	'pidginpresenceicon.c',
 	'pidginprotocolchooser.c',
 	'pidginprotocolstore.c',
-	'pidginstyle.c',
+	'pidginstylecontext.c',
 	'pidgintalkatu.c',
 	'pidgintooltip.c',
 	'pidginwindow.c',
@@ -131,7 +131,7 @@
 	'pidginpresenceicon.h',
 	'pidginprotocolchooser.h',
 	'pidginprotocolstore.h',
-	'pidginstyle.h',
+	'pidginstylecontext.h',
 	'pidgintalkatu.h',
 	'pidgintooltip.h',
 	'pidginwindow.h',
diff --git a/pidgin/pidginstyle.h b/pidgin/pidginstylecontext.h
rename from pidgin/pidginstyle.h
rename to pidgin/pidginstylecontext.h
--- a/pidgin/pidginstyle.h
+++ b/pidgin/pidginstylecontext.h
@@ -25,24 +25,24 @@
 #endif
 
 /**
- * SECTION:pidginstyle
- * @section_id: pidgin-pidginstyle
- * @short_description: <filename>gtkstyle.h</filename>
- * @title: Style API
+ * SECTION:pidginstylecontext
+ * @section_id: pidgin-pidginstylecontext
+ * @short_description: Dark theme herlpers.
+ * @title: GtkStyleContext Helpers
  *
- * The style API contains some helpers regarding #GtkStyle.
+ * A collection of API to help with handling dark themes.
  */
 
-#ifndef PIDGIN_STYLE_H
-#define PIDGIN_STYLE_H
+#ifndef PIDGIN_STYLE_CONTEXT_H
+#define PIDGIN_STYLE_CONTEXT_H
 
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
 /**
- * pidgin_style_is_dark:
- * @style: The #GtkStyle in use, or %NULL to use a cached version.
+ * pidgin_style_context_is_dark:
+ * @context: The #GtkStyleContext to use, or %NULL to use a cached version.
  *
  * Gets whether or not dark mode is enabled.
  *
@@ -50,20 +50,20 @@
  *          inverted.
  */
 
-gboolean pidgin_style_is_dark(GtkStyle *style);
+gboolean pidgin_style_context_is_dark(GtkStyleContext *context);
 
 /**
- * pidgin_style_adjust_contrast:
- * @style: The #GtkStyle in use.
- * @color: (inout): Color to be lightened.  Transformed color will be written
+ * pidgin_style_context_adjust_contrast:
+ * @context: The #GtkStyleContext in use.
+ * @color: (inout): Color to be lightened. Transformed color will be written
  *         here.
  *
  * Lighten a color if dark mode is enabled.
  */
 
-void pidgin_style_adjust_contrast(GtkStyle *style, GdkRGBA *color);
+void pidgin_style_context_adjust_contrast(GtkStyleContext *context, GdkRGBA *color);
 
 G_END_DECLS
 
-#endif /* PIDGIN_STYLE_H */
+#endif /* PIDGIN_STYLE_CONTEXT_H */
 
diff --git a/pidgin/pidginstyle.c b/pidgin/pidginstylecontext.c
rename from pidgin/pidginstyle.c
rename to pidgin/pidginstylecontext.c
--- a/pidgin/pidginstyle.c
+++ b/pidgin/pidginstylecontext.c
@@ -20,36 +20,40 @@
  * along with this library; if not, see <https://www.gnu.org/licenses/>.
  */
 
-#include "pidgin/pidginstyle.h"
+#include "pidgin/pidginstylecontext.h"
 
 /* Assume light mode */
 static gboolean dark_mode_have_cache = FALSE;
 static gboolean dark_mode_cached_value = FALSE;
 
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
 gboolean
-pidgin_style_is_dark(GtkStyle *style) {
-	G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-
-	GdkColor bg;
+pidgin_style_context_is_dark(GtkStyleContext *context) {
+	GdkRGBA bg;
 	gdouble luminance = 0.0;
 
-	if(style == NULL) {
+	if(context == NULL) {
 		if(dark_mode_have_cache) {
 			return dark_mode_cached_value;
 		}
 
-		style = gtk_widget_get_default_style();
+		context = gtk_style_context_new();
+	} else {
+		g_object_ref(G_OBJECT(context));
 	}
 
-	bg = style->base[GTK_STATE_NORMAL];
+	gtk_style_context_get(context, GTK_STATE_FLAG_NORMAL,
+	                      GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &bg,
+	                      NULL);
+	g_object_unref(G_OBJECT(context));
 
 	/* magic values are taken from https://en.wikipedia.org/wiki/Luma_(video)
 	 * Rec._601_luma_versus_Rec._709_luma_coefficients.
 	 */
 	luminance = (0.299 * bg.red) + (0.587 * bg.green) + (0.114 * bg.blue);
 
-	G_GNUC_END_IGNORE_DEPRECATIONS
-
 	dark_mode_cached_value = (luminance < 0x7FFF);
 	dark_mode_have_cache = TRUE;
 
@@ -57,8 +61,8 @@
 }
 
 void
-pidgin_style_adjust_contrast(GtkStyle *style, GdkRGBA *rgba) {
-	if (pidgin_style_is_dark(style)) {
+pidgin_style_context_adjust_contrast(GtkStyleContext *context, GdkRGBA *rgba) {
+	if(pidgin_style_context_is_dark(context)) {
 		gdouble h, s, v;
 
 		gtk_rgb_to_hsv(rgba->red, rgba->green, rgba->blue, &h, &s, &v);
diff --git a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -350,7 +350,7 @@
 pidgin/pidginpresence.c
 pidgin/pidginpresenceicon.c
 pidgin/pidginstock.c
-pidgin/pidginstyle.c
+pidgin/pidginstylecontext.c
 pidgin/pidgintalkatu.c
 pidgin/pidgintooltip.c
 pidgin/pidginwindow.c
