Skip to content
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

Fix minor inconsistency #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sumbach
Copy link

@sumbach sumbach commented Sep 27, 2013

It looks like it was intended for these classes to have the same name.

If I've misinterpreted your intent, please ignore and close this pull request 😮

@inlikealion
Copy link
Contributor

I believe you misunderstood @sumbach. Here .bar is used as a second class that extends .foo, found in a different file (if using Sass or concating files). They are not the same class, as every instance of class="foo" in markup would have the properties of .foo in base.css cascaded through .foo in theme.css.

Harry’s use of extending is having the skeleton or basic part of a thing abstracted out (see .media object) and then fleshing it out with another class that does more, either in decorating the object or changing its context.

@csswizardry Correct me if I misspoke.

@sumbach
Copy link
Author

sumbach commented Jan 24, 2014

Makes sense to me @inlikealion.

If that is the case, I think this would be easier to understand with the "room" analogy:

In your base stylesheet:

    /**
     * Extend `.room` in theme.css
     */
     .room{}

In your theme stylesheet:

    /**
     * Extends `.room` in base.css
     */
    .room--kitchen{}
    .room--bedroom{}
    .room--bathroom{}

@inlikealion
Copy link
Contributor

Looks like you get it, and your example does offer more clarity, especially for those less familiar with the technique. Although, I suspect Harry doesn’t want the extend technique to appear tied to BEM syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants