this post was submitted on 31 Oct 2024
16 points (94.4% liked)
Rust
5938 readers
1 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is embarrassing, but when was it not?
I have to add a "." before the name of a
css
class, I must learn my tools.I mean, it is not embarrassing for you. In the browser, the CSS's "native platform", you add classes, via the JavaScript API, without the dot. It's not a stupid assumption.
To have to add the dot in the CSS class name seems a bit of an oversight in the gtkrs API.
I think you understood their comment wrong. In your code (e.g.
label.add_css_class("green");
) you don't use a dot, but in the CSS stylesheet. It works the same as with HTML/JS/CSS.Well, that's CSS :D
Note that if you create a custom Widget class, you can set a CSS name, wich isn't a CSS class and doesn't use a leading dot.
Yeah that's what I've been using all along.