Skip to content
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

remove type="text/css" from inline css load #366

Closed
ovidijusr opened this issue Feb 4, 2019 · 2 comments
Closed

remove type="text/css" from inline css load #366

ovidijusr opened this issue Feb 4, 2019 · 2 comments

Comments

@ovidijusr
Copy link

What is the current behavior?
when i use style-loader in webpack for inline loading I get inline style which looks like this:

<style type="text/css">
.css-code{}
</style>

What is the expected behavior?
ability to remove type attribute from style tag

<style>
.css-code{}
</style>

If this is a feature request, what is motivation or use case for changing the behavior?
I'm currently getting warnings from w3c about using this optional tag:

Warning: The type attribute for the style element is not needed and should be omitted.
From line 357, column 9; to line 357, column 31
↩</style><style type="text/css">/* sty

Tried to investigate why this type exist in first place but haven't found anything even compatibility related why.

Also tried to use attrs option for loader, but it doesn't seem to remove type attribute, and even if I try to disable it by using boolen it doesn't remove the attribute but makes it empty

attrs: {
  type: false,
},

Tried to remove it by giving empty string to attrs option but then it just returns empty attribute

<style type>
.css-code{}
</style>

Maybe i'm missing something? What is the reason it is being defined? Thank you for answers :)

@alexander-akait
Copy link
Member

Feel free to send a PR

@alexander-akait
Copy link
Member

Done in #399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants