Naming convention for assets (images, css, js)?

前端 未结 9 599
孤城傲影
孤城傲影 2021-01-29 20:33

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:

9条回答
  •  一向
    一向 (楼主)
    2021-01-29 21:02

    You can name it like this:

    /assets/css/ - For CSS files

    /assets/font/ - For Font files. (Mostly you can just go to google fonts to search for usable fonts.)

    /assets/images/ - For Images files.

    /assets/scripts/ or /assets/js/ - For JavaScript files.

    /assets/media/ - For video and misc. files.

    You can also replace "assets" with "resource" or "files" folder name and keep the name of it's subfolders. Well having an order folder structure like this isn't very important the only important is you just have to arrange your files by it's format. like creating a folder "/css/" for CSS files or "/images/" for Image files.

提交回复
热议问题