How to use CSS for styling your GTK3 & 4 applications

I have made some demo code to show how to use CSS for styling your GTK application.

Read more about it in my blog post.

5 Likes

That’s useful, thanks for contributing

1 Like

I know the basics (sort of) but I think it would be great if people could
give some more advanced examples of CSS use therein. I found some
examples on the www; and the simple things are easy to try out on
their own, but things such as gradients and so forth I’d be most curious
in.

I use https://cssgradient.io for making gradients

Ex. an Gtk3 Radio button uses (adwaita dark)

radio {
background-image: linear-gradient( rgb(66,66,66) 20%, rgb(53,53,53) 90%);
}

radio:checked {
background-image: linear-gradient( rgba(31,118,225,1) 20%, rgba(27,106,203,1) 90%);
}