Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other precompilation: Straight up dropping a style in another style

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #201459
    damon
    Participant

    I am having difficulty googling this, because I don’t know the right terminology so I apologize if this feels painfully obvious.

    Er.

    So in a LESS project I worked on before I swear I could do stuff like:

    `.foo {
    color: red;
    }

    .bar {
    .foo;
    }
    `

    This is similar to mixins/extends, except it allows me to use both .foo and .bar in my markup. I’m not sure if it behaved like a mixin or an extend, but I liked the flexibility of this works on its own, but also inherits the other properties.

    And then I was wondering.. what is this called? And.. is this possible in SASS? all I’ve seen in SASS docs is talking about using mixins, extends and defining placeholders, which again, is similar.. but not quite the same thing.

    I feel like I saw some code somewhere that had this behaviour in SASS but said something about version support, but I’m not sure. And I have seen in some libraries like bootstrap things like

    @mixin foo(){
    color: red;
    }
    .foo {
    @include foo();
    }

    Which achieves what I want, but.. so long, right?

    Edited to add actual question:
    Is this possible in Sass? What is it called?

Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.