Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Mixin の場合 */
- @mixin test($color) {
- margin-bottom:10px;
- width:100px;
- color:$color;
- }
- .test1 {
- @include test(#f99);
- }
- .test2 {
- @include test(#f9f);
- }
- /* Extend の場合 */
- .test {
- margin-bottom:10px;
- width:100px;
- }
- .test1 {
- @extend test;
- color:#f99;
- }
- .test2 {
- @extend test;
- color:#f9f;
- }
- // ----------------------------
- // コンパイル後
- // ----------------------------
- /* Mixin の場合 */
- .test1 {
- margin-bottom:10px;
- width:100px;
- color:#f99;
- }
- .test2 {
- margin-bottom:10px;
- width:100px;
- color:#f9f;
- }
- /* Extend の場合 */
- .test, .test1, .test2 {
- margin-bottom:10px;
- width:100px;
- }
- .test1 {
- color:#f99;
- }
- .test2 {
- color:#f9f;
- }
Add Comment
Please, Sign In to add comment