Twitter Bootstrapの2.0-wipブランチを参照すると、LESSには変数とミックスインがバンドルされていることがわかりました。以下のサンプルコードを参照してください。LESSのネームスペースのSCSSとは何か、クラスのバンドル
#font {
#family {
.serif() {
font-family: Georgia, "Times New Roman", Times, serif;
}
.sans-serif() {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.monospace() {
font-family: Menlo, Monaco, Courier New, monospace;
}
}
.shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
font-size: @size;
font-weight: @weight;
line-height: @lineHeight;
}
.serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .sans-serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .monospace;
#font > .shorthand(@size, @weight, @lineHeight);
}
}
これと同等のSCSSは何ですか? SCSSで上記をどのように書き直すのですか?
その2016 – harshitgupta
ああ!これは何年も前のスレッドです。 Btw、Sassのネームスペースの考え方 - https://changelog.com/namespace-support-is-being-added-to-sass/ – Brajeshwar