Open steebchen opened 8 years ago
Thanks for the kind words! I haven't really considered any sort of donations, perhaps I'll look into something.
I think this idea is pretty interesting! I have an idea of how to implement it, and I don't think it would be too difficult. But I am concerned that this sort of nicety might be confusing if someone weren't expecting it. Also of course the maintenance cost of something like this... are @keyframes
and @media
the only exceptions? I suppose they're only really valid within a style tag, so maybe that's the key difference here.
I'll have to think about this for a while, but if you have other input please share it. I wonder how razor itself handles this... it's been so long since I used it.
You can simply give me your PayPal email or a Bitcoin wallet address ;)
Yes, they are only used in the style tag. Here is an article where you can find all css @-rules. I don't think there will be released dozens of brand new @-rules.
As far as I know, razor doesn't handle it either, you have to use @@ too.
I think a good solution would be to ignore these specific @-rules in style tags. To prevent that people use these variable names for non-@-rules, you maybe could throw an error that this name is a reserved rule. Another possible solution: like as I said, but when a user defines e.g. { var media = 'foo'; }
, @media
would just return foo
instead of @media
.
Another (but rather crazy) idea would be to simply ignore uninitialized variables and print an at sign and their name instead, but that would probably be bad when users do typos and they don't see any error.
But yeah, think of it. Not the most urgent issue. Razor had no solution either for this..
When I use inline media queries like this:
it shows this error:
It would be great if
@keyframes
and@media
could be simply ignored. I obviously could just use @@ instead but this breaks my syntax highlighting in IntelliJ Idea:Meanwhile, I'll add this to prevent this temporarily:
@{ var keyframes = '@keyframes'; }
Thanks again for vash and maintaining it - it's so freakin' awesome! Can I anyhow donate you a coffee?
node -v: v5.5.0 npm list vash: vash@0.11.2