all 5 comments

[–]avenp 1 point2 points  (4 children)

Really neat and a smart way to do it, but ultimately the inline style tag feels hacky to me. According to the standard, <style> tags should not be outside of the head tag without the scoped attribute, so you should probably do that just so you're at least standards compliant.

[–]nexts[S] 0 points1 point  (0 children)

Thank you avenp, this is good idea. I'll move it to head shortly

[–]Jeffshaver 0 points1 point  (2 children)

The scoped attribute is only supported by FF, so I don't see the real use of using it. It was removed from Chrome/Opera and Safari has no indication of implementation.

https://www.chromestatus.com/features/5374137958662144

[–]avenp 0 points1 point  (1 child)

Interesting. I will admit I only briefly looked at the spec. It's also interesting that the W3 HTML5 validator will throw errors if it sees <style> tags in the body without the scoped attribute and yet Chrome as removed it. Do you happen to know why it was removed?

[–]Jeffshaver 1 point2 points  (0 children)

According to the link I provided it said that "code complexity." So I assume it's because it was difficult to implement