Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的左边距混合:
.mL (@pixels) { margin-left: @{pixels}px; }
这就是我所说的:
#menu { .mL(124); }
这会输出语法错误。这甚至可能吗?
它适用于转义字符串插值:
.mL (@pixels) { margin-left: ~"@{pixels}px"; }
一种更简洁的方法可能是添加0px到您的变量中:
0px
.mL (@pixels) { margin-left: @pixels + 0px; }