Less / CSS:获取此属性的值

时间:2012-10-17 12:03:55

标签: css this less addition

我想在更少的时间内实现以下目标:

.bar {
    width: 100px;
}

.foo .bar {
    width: this + 20px // 120px
}

是否可以使用Less,如果是,如何?

由于

1 个答案:

答案 0 :(得分:3)

这不起作用吗?

@width: 100px;

.bar {
    width: @width
}

.foo .bar {
    width: @width + 20px
}