Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webstorm code completion does not show bootstrap classes

What do I have to change in my webstorm IDE that the bootstrap classes are recognized when I do:

<a class="btn btn-primary" />

At the moment I have always to re-check the class names by looking into the bootstrap css files. Thats not so nice...

like image 530
Pascal Avatar asked Jul 13 '14 19:07

Pascal


3 Answers

I had the same problem and finally fixed it!! You need to download the Bootstrap library LOCALLY.

This worked:

    <link rel="stylesheet" href="./css/css/bootstrap-theme.min.css" >

But this didn't work:

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

Cheers, JJ

like image 133
J.J. Avatar answered Sep 27 '22 19:09

J.J.


For a quick-fix, downloading the bootstrap.min.css or whichever you are using locally, and then referencing it like

<link href="stylesheets/bootstrap.min.css" rel="stylesheet">

solves the problem.

I think another way for WebStorm to be able to autocomplete without referring to it locally would be to add the file as an external library

like image 43
Pranay Shirolkar Avatar answered Sep 27 '22 19:09

Pranay Shirolkar


Finally I got the solution:

  • Right click on style folder
  • Mark directory as test sources root
like image 20
Rajesh Meena Avatar answered Sep 27 '22 20:09

Rajesh Meena