-1

In LESS you can reuse the styling of a class inside of another...i.e.

.class1{
  display: none;
}
.class2{
  .class1();
}

Which should compile into...

.class1{
  display: none;
}
.class2{
  display: none;
}

While I'm aware this is a pointless example. I'm trying to find out if SASS/SCSS has any ability to just reference an existing class and copy the styles without having to create a mixin?

There is this question. The answer here modifies the original "extended" class. I'm looking to copy the styles FROM the original class. Not add the class name of the second to the first class.

Community
  • 1
  • 1
Jared
  • 5,840
  • 5
  • 49
  • 83
  • @cimmanon, that is the same question, but it never received an answer that did what I wanted. – Jared Oct 09 '15 at 16:11
  • What sort of answer are you expecting? No one is withholding the "answer" you want. There's only one feature in Sass that does anything remotely close to what you're asking for, and it is already expressed in that question. – cimmanon Oct 09 '15 at 16:14
  • That's fine if that's the case, but I wanted to reference the functionality I was hoping to duplicate. If that's the case ...so be it. I never thought someone was "withholding" an answer so much as the OP of that question marked that question as answered. – Jared Oct 09 '15 at 16:28
  • Your edit doesn't change anything, it just makes it clear that you don't understand the feature in question and that you haven't tried it at all. – cimmanon Oct 09 '15 at 16:36
  • Thanks for the assumptions, but that doesn't change what I have or have not tried. As I mentioned it's perfectly acceptable for the answer to be that what I'm wanting isn't possible. Based on your slightly less than hostile responses I'm guessing that is the case. – Jared Oct 09 '15 at 19:26
  • If what you wanted were possible, it would already be an answer on the other question. – cimmanon Oct 09 '15 at 19:38
  • Again, thanks for the assumptions. I rarely (verging on never) spend time answering a question marked as accepted. – Jared Oct 09 '15 at 20:37

1 Answers1

-1

you can use @extend https://css-tricks.com/the-extend-concept/

which should compile to

.class1, .class2 { display: none; }

Tah
  • 1,526
  • 14
  • 22
  • I don't want to change the original class. I simply want to copy the styles like is currently possible in LESS. – Jared Oct 09 '15 at 16:10