Skip to content

Linter Rule: Permit style tags in inline SVG #912

@sethherr

Description

@sethherr

Rule: html-head-only-elements

Description

Update the html-head-only-elements to permit style tags in inline SVGs

Rationale

I believe this is valid HTML - the w3 validator thinks it is.

Examples

✅ Good

<!DOCTYPE html>
<html lang="en">
  <head>
  <title>Hi</title>
  </head>
  <body>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29">
      <defs>
        <style>
          .cls-1 {fill:none;stroke:#fff}
        </style>
      </defs>
    </svg>
  </body>
</html>

🚫 Bad

<!DOCTYPE html>
<html lang="en">
  <head>
  <title>Hi</title>
  </head>
  <body>
    <style>
      .cls-1 {fill:none;stroke:#fff}
    </style>
  </body>
</html>

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions