Deprecation does not imply removal within the same major API; it’s mainly an hint as to what will happen with the next major API.
In this particular case, though, you never should have used gtk_style_context_add_provider()
to add custom CSS styling; the appropriate function is gtk_style_context_add_provider_for_display()
, which is not deprecated and does not use the GtkStyleContext
type.
The main difference is that, unlike gtk_style_context_add_provider_for_display()
, gtk_style_context_add_provider()
will add a style provider for the given style context only; there will be no cascading into the children of the style context. This is not really expected, as it will not allow you to use styling as you’d do it on the web. Your application should define all the style classes it uses, load them all into a single CSS style sheet, and then apply it globally.
The other thing that was deprecated was the API to query the CSS machinery; this API was incompatible with how CSS works, and was mainly meant as a way to help porting GTK2 applications poking at the style information directly to GTK3. Applications should not query the style information: you should either use GTK widgets to draw stylable UI elements, or you should draw things that should not be styled at all.