N
N
NI2017-08-28 00:02:30
Sass
NI, 2017-08-28 00:02:30

The element is resolved by name only, without the use of imports. What does it mean?

Appears when adding variables and does not compile. What does it mean? And how to use variables then? How to do it right?
7c801f04be47434a98d1b08884b69b49.png9f93a8145c6844458c95876b5ce71ac2.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2017-08-28
@NI

This means that your IDE has created an index of all the project's code. And I found the declaration of this variable in this code. That is, you declared it somewhere in another file.
But the IDE cannot guarantee that you have included this file, so it warns.
Storm is not able to fully parse all imports nested in files and looks only at what is explicitly included in the current sass file.
As a rule, I turn off this inspection so that it does not hurt my eyes.
If it doesn't compile for you, then you didn't include the required file.
For example you have

.block {
  background: $myVariable;
}

@import 'settings.scss';
@import 'block.scss';

if you open the block.scss file, storm will show this warning in it.
But since all imports are correct, styles will compile normally.
But if you forget to include settings.scss in the styles.scss file, the IDE will still show the same warning, but the styles will no longer compile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question