Closed MichaelArestad closed 9 years ago
Looks interesting. Best I can figure the difference between molecule and organism is an organism might have molecules in it? Or is it more than that?
I definitely could get behind a file organization system like this.
Best I can figure the difference between molecule and organism is an organism might have molecules in it? Or is it more than that?
That's generally the case.
I do like this type of organization as well. The next version of Cardinal will have LESS files organized in a similar manner, like so:
|____areas
| |____boxes.less
| |____grids.less
| |____strips.less
| |____wrappers.less
|____base
| |____anchors.less
| |____base.less
| |____blockquotes.less
| |____fonts.less
| |____forms.less
| |____headings.less
| |____horizontal-rules.less
| |____reset.less
| |____selections.less
| |____shared.less
| |____syntax.less
| |____tables.less
|____cardinal.less
|____components
| |____buttons.less
| |____icons.less
| |____lists.less
|____objects
| |____media.less
|____print
| |____print.less
|____settings
| |____mixins.less
| |____variables.less
|____utilities
| |____alignment.less
| |____display.less
| |____layout.less
| |____position.less
| |____spacing.less
| |____text.less
| |____widths.less
| |____z-index.less
Base = normalize, reset, and styling for common elements (aka atoms) Areas = spaces where common elements, components, and objects can live Components = a collection of one or more common elements Objects = a collection of one or more common elements and/or components. Print = print styles Settings = variables and mixins Utilities = helper classes
Not saying we should do it exactly like this, simply sharing some additional thoughts around the subject. I like the suggestions of @MichaelArestad!
Also brought up in the January 6, 2015 meeting: Possibility of bundling component styles with components rather than in the sass folder. Example: https://github.com/topcoat/button-bar-template/tree/master/example
After much thought, I really like the structure proposed by @MichaelArestad . I do think the documentation would have to make it clear the difference between atoms, molecules and organisms. I feel like some people might be confused otherwise. I do like how in the example that @cbracco had contributed is very obvious where everything goes. I think the best way would be to make sure that everything is as modular as possible and easily readable. I'm going to do some more looking around at other file structures.
I've explored a lot of other file structures today and I think the atomic structure is the best option. Some file structures have upwards of 10 folders in the root. I don't know about anyone else but I like to keep my files super tidy. It would be best to have the framework be minimally abrasive and complicated to the user.
@sfrisk does it make since to keep this open? We already landed most of whats being covered here. The only thing not already landed is where the html files will go ( I think only because there is nothing in it yet and git wont maintain an empty folder ), but if i'm not mistaken we decided we wanted to keep those in a separate folder ( hence the scss folder name we already landed ). So it seems like this could be closed.
I think we're good to close this.
@arschmitz One can just create the folder with a .gitignore file in it to at least maintain structure while in this early phase
@maikuru true just not sure there is a point until we do have something to put it in.
@arschmitz to stop people from wondering where it's going to go someday ;)
I suggest an atomic structure with small self-contained modules. I prefer a version inspired by a Dale Sande article (or video).
Here's how I propose each module is structured:
And how the overall file structure might look:
Pros
.base
name of the module's rules and components. If the module wascalendar
, it's rules might becalendar_day.is-today
(I'm referencing the BEM naming convention I referenced here. This makes it easy to avoid naming conflicts as it's easy to spot the base elements in use. There is an added benefit of knowing where to find which file a class was declared in by just knowing the class name.Cons