D
D
Dmitry Prikhodchenko2014-03-24 12:11:10
css
Dmitry Prikhodchenko, 2014-03-24 12:11:10

Less how to get one parent property?

Less has an import of all class properties in another class

.A{
  background: red;
  padding: 10px;
}

.B{
 .A;
}

// in the end, B 100% copies A The
question is, how can you get only the background of class A?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AndeyValerevich, 2014-03-24
@AndeyValerevich

Why not make the background property separate and add it to A and B ?

A
AndeyValerevich, 2014-03-24
@AndeyValerevich

You can also use "Nested Rules" (from the documentation).

.B {
  background: red;
  .A  {
    padding: 10px;
  }
}

Does what you need specifically in your example))

I
Ilya Shabanov, 2014-03-24
@ishaba

Esil it somehow helps in stylus is what you want, Property Lookup learnboost.github.io/stylus/docs/variables.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question