Css 以一个周期开始较少的变量值
我对CSS名称空间使用了较少的变量:Css 以一个周期开始较少的变量值,css,less,Css,Less,我对CSS名称空间使用了较少的变量: @search-row-height: 57px; @namespace: rp-users-; .@{namespace}search-row { height: @search-row-height; } 是否仍需要将句点放在@namespace的值内?将其从CSS选择器的开头移动到@namespace的值(@namespace:.rp users-)的开头会导致编译错误。您可以进行转义: @search-row-height: 57px;
@search-row-height: 57px;
@namespace: rp-users-;
.@{namespace}search-row {
height: @search-row-height;
}
是否仍需要将句点放在@namespace的值内?将其从CSS选择器的开头移动到@namespace的值(@namespace:.rp users-)的开头会导致编译错误。您可以进行转义:
@search-row-height: 57px;
@namespace: ".rp-users-";
@namespaceselector: ~"@{namespace}search-row";
@{namespaceselector} {
height: @search-row-height;
}