Forums

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

Home Forums Design Can you do this is sass?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #265442
    John
    Participant

    Just wondering if you could this is possible?
    Probably not the best example.

    .site {
        color: white;
        h1 {
              color: green;
        }
    }
    

    So it would output:

    site {
      color: white;
    }
    
    h1.site {
      color: green;
    }
    
    #265449
    Paulie_D
    Member

    No…no like that

    but you can do

    h1 {
        color: green;
         &.site{
              color: white;
        }
    }
    

    which outputs as

    h1 {
      color: green;
    }
    h1.site {
      color: white;
    }
    

    http://thesassway.com/intermediate/referencing-parent-selectors-using-ampersand

    #265455
    John
    Participant

    I didn’t this so, but just thought I would double check. I even tried googling it, but didn’t find an answer.
    Thanks for the link. I like in his example how you can put & after a css and have it append to like an h3. This might come in handy.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design’ is closed to new topics and replies.