T
T
TANK_IST2014-10-06 00:13:14
css
TANK_IST, 2014-10-06 00:13:14

How to get parent property?

There is a code for example.

@mixin button {
height: 20px;
border: solid 1px #000;
padding: 10px;
color: white;
}

.wf {
height: 40px;
 button{
  @include button;
 }
}

.hd {
height: 35px;
 button{
  @include button;
 }
}

Is there any way to find out the height of the button's parent directly in the mixin?
For example:
@mixin button {
height:  get_parent('height') * 2 - 4;
border: solid 1px #000;
padding: 10px;
color: white;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-10-06
@TANK_IST

no. Pass in arguments.

D
Deodatuss, 2014-10-06
@Deodatuss

height:calc((100%*2)-4px);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question