Pauan / rust-dominator

Zero-cost ultra-high-performance declarative DOM library using FRP signals for Rust!
MIT License
998 stars 63 forks source link

Allow custom name for style #72

Closed martin-kolarik closed 2 years ago

martin-kolarik commented 2 years ago

Simple change adding variant into class! macro. The purpose is to ease development/debugging in browsers' devtools, where customized style names are far more descriptive.

Pauan commented 2 years ago

I like the idea, but I don't like the syntax:

class! { "foo"
    .style("background-color", "green")
}

Maybe it could use this syntax instead?

class! {
    #![prefix = "foo"]
    .style("background-color", "green")
}

Or possibly this syntax:

class!("foo", {
    .style("background-color", "green")
})
martin-kolarik commented 2 years ago

Definitely, the syntax is up to you, thanks. So, should I modify my PR?

Pauan commented 2 years ago

Yes, please. Since it's for debugging, I think the #![prefix] syntax is probably the best.

Pauan commented 2 years ago

Thanks!

martin-kolarik commented 2 years ago

That was fast! I haven't managed to comment anything :-).