Whitelist Option for element-permitted-content
Adding a whitelist
option for the element-permitted-content
rule would be really helpful.
Use cases
My specific use-case is when CSS values are dynamic and need to be added directly to the HTML.
For example, when background images are able to be selected in a CMS, adding the required CSS to a .css
file on the fly is rarely an option. In these cases, there are 2 options:
- Use an inline
style
attribute. - Add the css in a
<style>
tag.
The first option is not available when @media
is required to support multiple variations based on the breakpoints.
That leaves the second option. But the issue of only allowing <style>
tags in the <head>
makes this option difficult. Most CMS solutions do not enable propagating a <style>
tag to the <head>
without a lot of custom code.
These means the developer is forced to set the severity to warn
or off
for the element-permitted-content
rule, which really limits the usefulness of html-validate
.