p {
@if $font-size == small {
font-size: 12px;
} @else if $font-size == medium {
font-size: 16px;
} @else if $font-size == large {
font-size: 20px;
} @else {
font-size: 14px; // 默認大小
}
}
.container {
@if $device == desktop {
margin: 20px;
} @else if $device == tablet {
margin: 15px;
} @else {
margin: 10px; // 手機默認邊距
}
}
body {
@if $theme == light {
background-color: white;
color: black;
} @else if $theme == dark {
background-color: black;
color: white;
} @else {
background-color: gray;
color: black;
}
}
.container {
display: flex;
flex-wrap: wrap;
@if $screen-width > 1200px {
.item {
width: 25%; // 桌面顯示 4 列
}
} @else if $screen-width > 800px {
.item {
width: 50%; // 平板顯示 2 列
}
} @else {
.item {
width: 100%; // 手機顯示 1 列
}
}
}