I am still struggling to find a good naming convention for assets like images, js and css files used in my web projects.
So, my current would be:
CSS: style-{name}.css
examples: style-main.css
, style-no_flash.css
, style-print.css
etc.
JS:
script-{name}.js
examples: script-main.js
, script-nav.js
etc.
Images: {imageType}-{name}.{imageExtension}
{imageType}
is any of these
- icon (e. g. question mark icon for help content)
- img (e. g. a header image inserted via
<img />
element) - button (e. g. a graphical submit button)
- bg (image is used as a background image in css)
- sprite (image is used as a background image in css and contains multiple "versions")
Example-names would be: icon-help.gif
, img-logo.gif
, sprite-main_headlines.jpg
, bg-gradient.gif
etc.
So, what do you think and what is your naming convention?