Closed gabrielwalt closed 9 years ago
Thank you for the enhancement.
I also think there's still a use case for using inline CSS in some cases. For example for setting a dynamic background-image
it could be useful. This is something you can't do with just a class name. For inline JS I would think it's not necessary, but It wouldn't hurt to show how it should be done.
I commented on the changes you did, please let me know what you think.
Yes, which is why 1.2 doesn't say "Never inline JavaScript or CSS", but "Avoid inline JavaScript or CSS". From my experience, the problem is mostly for scripts, which are inlined way too often, for styles there's less of an issue.
Exactly! PR is merged, thank you!
Added guidance to choosing the proper context for expressions.
Not sure if the example isn't too complex, but it illustrates several different cases. Some of wich, like the
onclick
and thestyle
attributes are a little bit borderline with 1.2 (Avoid inline JavaScript or CSS), but I guess that if someone really wants to do that, then it's better to still tell how to do it properly.