Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

martinszeltins's avatar

What case should I use for my html, css, sass files?

What is the best practice / style guide for naming my .html and .css and .sass files?

Should I use snake_case.html or kebab-case.sass or camelCase.css? What does the community use? Is there a generally accepted style guide for naming these types of files in a project?

EDIT: I'm talking about how file names on the file system are named (not how they appear in web urls)

P.S. I noticed that Bootstrap names their files with kebab-case.sass but is that a generally accepted style guide? What about html and css files?

0 likes
6 replies
bugsysha's avatar

For URL I would suggest kebab-case. I remember there was a study that concluded that kebab-case and snake_case are 20% easier to read than camelCase. And in the URL - is more visible compared to _. So for that reason naming convention is to use kebab-case.

bugsysha's avatar

Will those files be visible through URL when they are requested?

bugsysha's avatar

The only reason not to use PascalCase is that it is easier to type in terminal lower case for the first letter compared to uppercase.

Please or to participate in this conversation.