import 匯入
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| @import 'reset'; @import 'common';
@import 'variable'; @import 'mixin'; @import 'grid'; @import 'reset'; @import 'common'; @import "module/button"; @import "page/index"; or @import "page/member";
|
variable 變數
1 2 3 4 5 6
| $highline-color: #fff;
$font-m: 120px; $font-l: $font-m * 1.2; $font-s: $font-m * 0.8;
|
@mixin 語法知識庫
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| @mixin font-hex { font-family:微軟正黑體; font-size: 16px; line-height: 1.2; }
@mixin horizontal-line($long, $weight, $color ) { width: $long; height: $weight; border-bottom: 1px solid $color; }
body { @include font-hex; color: #3D1101; }
.good-chef .line1{ position: absolute; top: -60px; left: -140px ; @include horizontal-line(120px, 1px, #989898 ); }
|
@mixin+@content for 響應式設計
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| @mixin desktop{ @media (max-width: 1024px) { @content } }
@mixin pad{ @media (max-width: 768px) { @content } }
@mixin pad-below{ @media (max-width: 767px) { @content } }
@mixin iphone480{ @media (max-width: 480px) { @content } }
@mixin iphone5{ @media (max-width: 320px) { @content } }
.our-special { background: #EFE9E7; padding: 50px 2.5%; @include pad-below() { padding-right: 0px; padding-left: 0px; } }
|
& 符號參照巢狀結構的父選取器
1 2 3 4 5 6 7 8 9 10 11 12
| .menu{ display: flex; a { padding: 14px 15px; font-size: $font-m; color: $highline-color; text-decoration: none; &:hover, &.active { background: $activemenu-color; } } }
|