20 ms·
The OP gives a good example: https://seek-oss.github.io/braid-design-system/components/Stack/ https://seek-oss.github.io/braid-design-system/components/St... T
by henriquez 7y ago
The OP gives a good example: https://seek-oss.github.io/braid-design-system/components/Stack/ https://seek-oss.github.io/braid-design-system/components/St...
This is overengineering, something that should be handled in a view with a CSS class, instead of an abstraction that ends up translating back into a CSS class after the overhead of parsing the abstraction.
I think in the case of your original comment to me, you're arguing something different. You want to bold the first word of an article or apply a line break after the first two words. For a use like that, there's nothing you can do other than to put some kind of view-related functionality in your code, and I agree. But handling that in code isn't fixing something for the sake of fixing it, because there's no way that it could be handled natively by the view in the context of whatever data you pipe into it dynamically.
A CSS class that provides margins to items in a div can be handled natively by the view and should.
- cercatrova 7y agoI get type safety with that example, I don't with CSS.
- henriquez 7y agoType safety for a CSS class? What?
- cercatrova 7y agoType safety for CSS properties. See TypeStyle for instance: https://github.com/typestyle/typestyle https://github.com/typestyle/typestyle
- henriquez 7y agoNow I've seen everything. Clearly I'm past my prime. I'm going to give up web development and go live in a cave or something.
- cercatrova 7y agoI'm curious, what don't you like about CSS type safety?