λ€μ μ½λλ₯Ό μ¬μ©νκ³ μμ΅λλ€.
header {
&:extend(.menu all);
}
less νμΌμλ λ€μκ³Ό κ°μ κ΅¬μ‘°κ° μμ΅λλ€.
.menu {// CODE}
.menu:after {// CODE}
.menu:first-child {// CODE}
.menu:last-child {// CODE}
μΆλ ₯ νμΌμμ .menu λ° . λ©λ΄: νμ λ©λ΄:첫 λ²μ§Έ μμ λλ . λ©λ΄:λ§μ§λ§ μμ.
κ·Έλ¬λ λ΄κ° λ³κ²½νλ©΄ . λ©λ΄:첫 λ²μ§Έ μμ λλ . λ©λ΄:λ§μ§λ§ μμ μ . λ©λ΄:첫 λ²μ§Έ λ° . menu:last κ·Έλ¬λ©΄ CSS μ½λκ° νμλ©λλ€.
νμ΄νμ΄ λ¬Έμ μΈ κ² κ°μ΅λλ€.
μ΄ λ¬Έμ λ₯Ό ν΄κ²°νλ λ°©λ²μ λν μμ΄λμ΄κ° μμ΅λκΉ?
κ°μ¬ ν΄μ.
κ²°κ³Όλ₯Ό νμΈν μ μμ΅λλ€: λ°λͺ¨ .
SOμ λν κ·νμ μ§λ¬Έμμ κ·νκ° gulp-less
νκ³ μμμ μ μ μμ§λ§ μ΄μ κ°μ λ²κ·Έκ° μλ Less λ²μ (1.4.xλΆν° μμ)μ μ€μ λ‘ κΈ°μ΅ν μ μκΈ° λλ¬Έμ μλ§λ μΌμ’
μ "μ΅κ·Όμ λνκ±°λ κΏκΊ½κΏκΊ½ λ§μμ§ μλ λ²μ " λ¬Έμ μ
λλ€. λ°λΌμ μ§λ¬Έμ λ€μκ³Ό κ°μ΅λλ€. μ΄ μ€λν«μ΄ λ¬Έμ λ₯Ό κ²ͺκ³ μλ _is_μΈμ§(λ 볡μ‘ν λ¬Έμ μΌ μ μμ΅λκΉ?) κ·Έλ¦¬κ³ /λλ λ°©ν΄ν μ μλ λ€λ₯Έ gulp
μμ
μ΄ λ μ μμ΅λκΉ?
μλ§λ κΏκΊ½κΏκΊ½ νλ μμ μΌ κ²μ λλ€. λ΄μΌμ΄λ λ€μμ£Ό μ΄μ μ΄ν΄λ³΄λλ‘ νκ² μ΅λλ€. κ°μ¬ ν΄μ.
μ΄μ©λ©΄ μ΄κ²μ΄ λμ
λΉνμ±μΌλ‘ μΈν νμ (μ΄μ¨λ λ λ¬Έμ κ° μλ κ² κ°μ΅λλ€).
@seven-phases-max μμ μ 곡λ μ½λκ° μ΄ λ¬Έμ λ₯Ό μ ννκ² μ¬ννλ€κ³ μκ°
λ μ μ
.col {
float: left;
&:last-child {
margin-right: 0;
}
&:first-child {
margin-left: 0;
}
}
.generate-columns(<strong i="9">@n</strong>, <strong i="10">@i</strong>: 1) when (<strong i="11">@i</strong> =< @n) {
.col-@{i}:extend(.col) {
margin-left: (@i)px;
}
.generate-columns(<strong i="12">@n</strong>, (<strong i="13">@i</strong> + 1));
}
.generate-columns(2);
μμ±λ CSS
.col,
.col-1,
.col-2 {
float: left;
}
.col:last-child {
margin-right: 0;
}
.col:first-child {
margin-left: 0;
}
.col-1 {
margin-left: 1 px;
}
.col-2 {
margin-left: 2 px;
}
μμ CSS:
.col,
.col-1,
.col-2 {
float: left;
}
.col:last-child {
margin-right: 0;
}
.col:first-child {
margin-left: 0;
}
.col-1 {
margin-left: 1 px;
}
.col-1:last-child {
margin-right: 0;
}
.col-1:first-child {
margin-left: 0;
}
.col-2 {
margin-left: 2 px;
}
.col-2:last-child {
margin-right: 0;
}
.col-2:first-child {
margin-left: 0;
}
λλ½λ λΆλΆ
.col-1:last-child {
margin-right: 0;
}
.col-1:first-child {
margin-left: 0;
}
.col-2:last-child {
margin-right: 0;
}
.col-2:first-child {
margin-left: 0;
}
@ivan-nikitovic μλμ, extend
μ extend all
μ μ°¨μ΄μ μ 보μμμ€.
@seven-phases-max μ΄κ²μ μλ―Έκ° μμ΅λλ€. :-) μ°Έκ³ ν΄μ£Όμ μ κ°μ¬ν©λλ€.