CSS-Guidelines icon indicating copy to clipboard operation
CSS-Guidelines copied to clipboard

Fix minor inconsistency

Open samumbach opened this issue 12 years ago • 3 comments

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 :open_mouth:

samumbach avatar Sep 27 '13 19:09 samumbach

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.

inlikealion avatar Jan 24 '14 15:01 inlikealion

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{}

samumbach avatar Jan 24 '14 17:01 samumbach

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.

inlikealion avatar Jan 24 '14 18:01 inlikealion