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

Theme scss file paths in styles.scss are missing parent folder #91

Closed
JanOschii opened this issue Mar 19, 2018 · 3 comments
Closed

Theme scss file paths in styles.scss are missing parent folder #91

JanOschii opened this issue Mar 19, 2018 · 3 comments

Comments

@JanOschii
Copy link

Hi Tomas,

take a look on the import statements for your themes in styles.scss.
They are missing the parent folder "themes".
It should look like this:

@import 'themes/default-theme.scss';
@import 'themes/light-theme.scss';
@import 'themes/black-theme.scss';
@import 'themes/nature-theme.scss';

Although it worked before, my IDE PhpStorm stopped complaining about these lines after the change.

Jan

PS: Nice project.

@JanOschii JanOschii changed the title theme scss file paths in styles.scss are missing parent folder Theme scss file paths in styles.scss are missing parent folder Mar 19, 2018
@tomastrajan
Copy link
Owner

Hey Jan!

Happy to hear that you like the project! The deal with the themes folder is that it is defined in angular-cli.json file in stylesPreprocessorOptions and includePaths.

To make it work in WebStorm set themes folder as resource root.

ps: I use Intellij IDEA so had to deal with it too 😉

@JanOschii
Copy link
Author

JanOschii commented Mar 20, 2018

Hey Tomas,

i see. But its still defined in .angular-cli.json

      "stylePreprocessorOptions": {
        "includePaths": ["./", "./themes"]
      },

Maybe it works with WebStorm but fails with PhpStorm?
Do you see any problem, if I keep the import statements with the subfolder?

Jan

@tomastrajan
Copy link
Owner

Hey @JanOschii !

I gave it a bit more thought and realized you're right. Original solution is not obvious (more like magic) plus it doesn't work in some IDEs by default.

So I removed "./themes" from includePathsand used full theme imports instyles.scss` instead.

As for "./", the story is bit more complicated because it is used for imports of styles-variables.scss which is used by many components and the relative imports would get pretty messy very fast (eg: ../../../../styles-variables.scss) so I would still be in favour of using include paths for that even though IDE would complain without setting it up properly...

Anyway thank you for your contribution.

Cheers!

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

No branches or pull requests

2 participants