I know that here on HN we're supposed to just upvote things instead of writing comments like "this is amazing" but this is so amazing it deserves more than just an upvote.
So cool - can't wait to start using this!
yodon | 2 years ago
This is very creative, I love out of the box thinking like this. Well done!
robbiejs | 2 years ago
This has me pumped up. Will be trying it immediately
replwoacause | 2 years ago
Why not just use the style attribute of elements? Polyfill support available here: http://vanilla-js.com/, but if you have a modern browser, like IE5+ you should be OK.
quickthrower2 | 2 years ago
Very creative! Would have to try this to see how much sense it makes - there must be a slight performance degradation because the content of the style tags can't be applied and parsed immediately, no?
So that's a fundamental difference, no build step, tiny JS runtime instead that hooks into the page rendering.
The concept is interesting.
Has the benefit of staying close to vanilla CSS syntax.
I'm curious why you chose 'me' or 'this' instead of '&'?
OTOH, it might be useful for the browser to consider the style tags as valid but with unknown element names (that are also forbidden for custom elements as they don't have a dash). Don't know if this would be possible using '&' and it also collides with the CSS nesting proposal.
So.. after all, nice idea!
Being a bit more cynical though, I'm not sure if the JS dependeny and performance implications would be worth it for me to use in actual projects.
Tailwind has the benefit of producing lean CSS files with 0% dead CSS.
This approach would be more prone to the usual issues with CSS I guess, but addding custom syntax anyway. I'm also sceptical of transpiling to CSS using JS on the client.