# Use css with Gtk.jl

**URL:** https://discourse.julialang.org/t/use-css-with-gtk-jl/72786
**Category:** Tooling
**Tags:** question, package, gtk
**Created:** [December 8, 2021, 7:46pm UTC](https://discourse.julialang.org/t/use-css-with-gtk-jl/72786 "2021-12-08T19:46:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MeteorBizone](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MeteorBizone](https://discourse.julialang.org/u/MeteorBizone)
#### Post date: [December 8, 2021, 7:46pm UTC](https://discourse.julialang.org/t/use-css-with-gtk-jl/72786/1 "2021-12-08T19:46:25Z")

</div>

How I can usw css in Gtk.jl?

---

<div class="post-metadata">

### Author: ![MeteorBizone](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MeteorBizone](https://discourse.julialang.org/u/MeteorBizone)
#### Post date: [December 29, 2021, 8:39pm UTC](https://discourse.julialang.org/t/use-css-with-gtk-jl/72786/2 "2021-12-29T20:39:32Z")

</div>

I have now solved it with this function.

```julia
#using Pkg
#Pkg.add("Gtk")

using Gtk

function set_gtk_style!(widget::Gtk.GtkWidget, style::String, value::Int)
    sc = Gtk.GAccessor.style_context(widget)
    pr = Gtk.CssProviderLeaf(data="* {$style}")
    push!(sc, Gtk.StyleProvider(pr), value)
end

```
