Skip to content

style tag should be allowed in body #1605

Closed
@workguy66

Description

@workguy66

This is a follow up on the issue on style scoped

We allow <link rel=stylesheet> in the body, we should allow <style> tags as well.

It's already supported in all the browsers and will be in the future, what is the benefit in making it invalid markup if it's often the best or even only solution to a problem and is widely used on many websites and CMS's?

This would also serve as a half functioning replacement for <style scoped> where you can work around the scoping issue using custom classes.

Also, I've seen some people ask, why not use inline styles? like <span style="color:red"></span>?
Well, you can't apply inline styles for hover states or pseudo elements, it also means a lot of repeated css most of the time.

Is it good to use it in the body instead of the head? No if you can help it, yes if you can't.

Edit:
Also many people like the convenience of doing ajax requests that come with html and their own style tags.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions