O
O
Olga2020-07-26 08:17:09
HTML
Olga, 2020-07-26 08:17:09

How to disable auto-style in webstorm?

Good afternoon!

I downloaded a trial version of Webstorm. I like everything, but I can’t turn off the automatic linking to scss in it.
I created a simple project: index.html, style.css, main.scss The main.scss
file is not processed by anything (then it will be processed by webpack)

Here is the simple HTML that I created

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <link rel="stylesheet" href="style.css"/>
</head>
<body>
<h1 class="one">Test 1</h1>
<p class="two">test P</p>
<p id="three">test P2</p>
</body>
</html>


Now, if I put the cursor on any class and in Webstorm I press "Alt + Enter" -> Create Selector and then I select the _main.scss file,
then webstorm, as it should be, creates a class for me in the _main.scss file, but additionally writes it to me in HTML here This
<link rel="stylesheet" type="text/css" href="_main.scss"/>


in the end, my file becomes like this:
<head>
<link rel="stylesheet" type="text/css" href="_main.scss"/>
  <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <link rel="stylesheet" href="style.css"/>
</head>
<body>
<h1 class="one">Test 1</h1>
<p class="two">test P</p>
<p id="three">test P2</p>
</body>


question: how to disable this addition?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-07-28
@olga0lechk4

Olga, at one time I was also puzzled by this issue and solved the matter by assembling, which itself removes what needs to be done.
Yes, of course, this is not quite what you need, but it saves your nerves.
https://github.com/abyss-soft/webpack-template-base

O
Olga, 2020-07-28
@olga0lechk4

Here is the response received from jetbrains tech support

Good afternoon!
The link is added by the same instance as the selector is created, there is no way to turn off this addition.
You can create a request to add such a setting at https://youtrack.jetbrains.com/issues/WEB .
Have a nice day!
Team WebStorm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question