this post was submitted on 31 Oct 2024
17 points (100.0% liked)
Rust
5999 readers
17 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
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.
(sorry for the late response, I have to get in the habit of checking my Lemmy account)
No, I get that - a stylesheet denotes a class by having a dot. A JavaScript API for adding a CSS class omits this redundancy.
I was saying that the author might not be wrong to want to avoid the redundancy in rust example as well (since it explicitly mentions CSS classes).
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.