Replies: 1 comment 6 replies
-
Hi @deitrix. Thank you for wanting to improve the library! 😊 This reminds me of a discussion we had of defining all HTML attribute values as constants. (I can't remember where it was, somewhere here on Github.) Ultimately, I decided it wasn't really worth the effort required, and would clutter the API surface. In this case, you would basically be "porting" CSS to Go, and my gut feeling tells me that's a lot more work than "porting" HTML. What would be the main advantage of this, you think, apart from preventing typos in strings? I have a hard time wrapping my head around what the advantages would be. I guess it's because I don't really have experience building components this way, I use TailwindCSS for everything. |
Beta Was this translation helpful? Give feedback.
-
Hey,
I just came across this library and whilst I was having a play around with it, I couldn't help but think the styling API felt a bit... lacking. Having only
Style
which accepts astring
means that style building is entirely up to the user of the library.I propose a more declarative API, introducing a new
style
package within the repo. Usage would look a little like:My only concern is that it's a lot of nodes to define (there are a lot of different styles!). But, a lot of helper/utility functions could be introduced to make the style definition process more straightforward, and less error-prone for the user.
Let me know your thoughts! 😃
Beta Was this translation helpful? Give feedback.
All reactions