New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "Component Structure" section to guidelines #146
Comments
Very interesting idea David. I think this deserve a whole section, hence will be added in 1.1, probably in a while from now (with Sass 3.5 or something). This gives us time to write something nice and everything. :) |
Sounds good! |
Maybe 1.3.0. :) |
Would you be interested in tackling this David? |
@hugogiraudel Sure! |
For the record, #292 has been started. :) |
Okay. I'll have a first draft to you this weekend. |
Will be released in 1.3.0. |
One thing that would be tremendously useful in the guidelines is how to actually organize the content of a component file, e.g.
components/_buttons.scss
. I've tended towards this (opinionated) structure:Here is how a component-specific file would look with this structure, with a
button
component as an example:If you don't want to use placeholders in the guidelines, these can easily be subbed out for classes. I use placeholders above for a couple reasons:
%foo
component extends%bar
component, but I decide to remove the.bar
class, neither%foo
nor.foo
will be affected.Other considerations:
%button-disabled
,%button-focus
, etc.Let me know what you think! In the past, I've had each of these sections in different files, but I'm moving towards having them in a single file, with an enforced order and organization.
The text was updated successfully, but these errors were encountered: