PyCharm project not detecting external CSS library

I want to use the auto-completion feature of CSS files, so I followed that tutorial, but I still cannot see the classes being suggested. Only my own CSS selectors are being detected.

Here's what I did: 1) Downloaded the library

2) Tried to write a Metro container.

So it didn't take notice of the external css file, which contains container selector.

How to enable this code-completion?

1
4 comments

Works fine for me (PyCharm 2019.3.1, Django app):

 

Is your CSS library enabled in Settings | Languages & Frameworks | JavaScript | Libraries? What scope is it set for? Can you reproduce the issue in a new project?

1

Thanks Elena! Got it working by going to Settings | Languages & Frameworks | JavaScript | Libraries and enabling metro-all.

1

On my side the problem was, that PyCharm downloaded the CSS file and put it into the external libraries, but for some reason (I guess a bug), renamed the file to bootstrap.css.js - and from there on, it didn't work, obviously.

After renaming the file to just bootstrap.css, it worked fine.

0

this bug is tracked at https://youtrack.jetbrains.com/issue/WEB-60873/External-CSS-stylesheet-for-Bootstrap-is-downloaded-as-a-javascipt-file., please vote for it to get notified when it's fixed
As a workaround, you can download file manually in browser and either place it in your project folder and save it elsewhere and then add it to the project as a new JavaScript library in Settings | Languages & Frameworks | JavaScript | Libraries
Renaming the downloaded file is another possible workaround

1

Please sign in to leave a comment.