dfischer / betterfrontend

A community recommendation on how to make front-end development better. How-to, best-practices, and more.
http://www.betterfrontend.com
77 stars 10 forks source link

What's ideal directory structure? #4

Closed dfischer closed 12 years ago

dfischer commented 12 years ago

@kuroir among others have strong opinions on directory structure.

What's the ultimate directory structure?

Notes between @kuroir and I

https://gist.github.com/3014753

Location in project: https://github.com/hybridgroup/betterfrontend/blob/master/stylesheets.md#directory-structure

dfischer commented 12 years ago

Possibly this is a good basis:

app/
  assets/
     stylesheets/
       ui/ 
       sections/ 
       skins/
       layout/
       settings/
       mixins/

Ui

Ui-driven elements, like search-box, carousels, pagination

Sections

sections of the site, e.g, forums, products, cart, profile

Skins

Different styles for the site using same dom structure.

Layout

Styles that relate to main structure. E.g, main, blog post, no-sidebar

Settings

Any settings defined here. Variables, etc.

Mixins

Self explanatory.

MarioRicalde commented 12 years ago

I'm wondering if we need to have skins as a directory in there.

sections somehow sounds confusing to me, maybe we should name them pages, just wondering. Guess I'm thinking section the html element rather than site-wise.

settings can probably be config, though to be honest I'm wondering if projects will usually have more than one file for configuration files.

dfischer commented 12 years ago

Well, even if it's empty, doesn't it make sense to have it to set a best-practices of expected directory structure for all projects we come across? Same point for settings/config. We can use config to keep best-practices with Rails/config mentality.

sections <> pages. I'm happy going with pages. In my head I was thinking "pages, modules, sections."

Thoughts on keeping structure to maintain best-practices?

MarioRicalde commented 12 years ago

Probably it's worth to keep some kind of base structure for stuff that all projects need. Config makes sense, I reckon one would add _colors.scss, _fonts.scss or stuff like that on that file, rather than having one configuration file full of rules.

MarioRicalde commented 12 years ago

On the other hand, I'm not sure that we should include skins as a default, though.

dfischer commented 12 years ago

Ok, good compromise. Let's go with that.

dfischer commented 12 years ago

Pushed.