a72
a72

Reputation: 49

How to quickly find a CSS class when there are multiple stylesheets

I was just given a theme for a website.

Naturally, that theme came with multiple sytlesheets.

When I'm looking in the index.html file, I can see the classes, but I don't know which stylesheet it is in.

As of right now, I open all the stylesheets and do a search for that class.

This seems very inefficient/waste of time.

I am currently using PHPstorm. Does anyone have any experience with tricks to find out which stylesheet a CSS class is in quickly?

Thanks.

Upvotes: 1

Views: 628

Answers (3)

b3tac0d3
b3tac0d3

Reputation: 908

Open Chrome, open the page, right click on the element that is in that class then click "inspect element". When you are viewing it, on the right it will show the properties of the class. If you look to the far right, above that, it shows the name of the file that class is from.

enter image description here

EDIT

Also, NotePad++ has search features that allow you to search multiple files and sub-directories. The results are clickable and open the file containing the clicked result, to the line that the result is on.

Upvotes: 1

Clément F
Clément F

Reputation: 126

you can for instance use the developer tools provided by your browser to determine where to find the stylesheet related to a class.

Upvotes: 1

user1925801
user1925801

Reputation: 154

When you are creating a style sheet, you typically do it in some sort of order either by content category, or layout so you can easily find it later. Since you are using a template, I would try looking for any type of pattern that the author might have used. If the class names are not descriptive enough, I don't think there is much you can do. I guess you can go and rename everything to be more explicit so it's easier for you to navigate down the road.

Upvotes: 1

Related Questions