-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconsider making <style> in body valid #5019
Comments
Three reasons for CMS not to do it:
I don’t mean to say that it is bad when CMSes do 5 though. I am concerned about the practical situation when they don’t. |
Since this is a rehash, we'll close it; all the relevant discussions have been had in #1605, and the conclusion remains. It is true that CMS code will need to get more complex, possible at the cost of simplicity, in order to attain the good performance that the HTML spec works to encourage via its conformance requirements. That is our current recommendation. I.e., CMSs which do not do 5, are not able to produce compliant HTML, and the best way to fix that is to file bugs on CMSs, not on the HTML Standard. |
Okay, thank you for the feed back. |
Authors of content management systems of various kinds, e.g. Wordpress, often do not have access to the head of HTML. Plugins/widgets do not have access to the
<head>
in some software either. If they want to apply styles anyway, authors and plugins have the following options:<style>
in the body, whichstyle
attributes on the elements, which<style>
in the body<link rel=stylesheet>
The best option for me as a plugin author, who wants theme authors to be able to make my plugin fit nicely into their design, – and the best option for users – is the first option, which is the only one that is invalid.
The best currently valid option for me would be 4., although it actually makes initial rendering ugly. I don’t know why it is valid and 1. is not.
A 5th option would be to ask CMS to always give authors and plugins access to the HTML head. Realistically, not every CMS will do it, especially since it would complicate the CMSes for spec conformity and not for apparent practical benefits.
Are there other options?
Note:
<style>
has been valid in the body in W3C HTML 5.2 (https://www.w3.org/TR/html52/document-metadata.html#the-style-element). Is this relevant here now that WHATWG and W3C have decided to work together on a single spec again?The text was updated successfully, but these errors were encountered: