這是我在使用 Less 時遇到的問題
當我要引用外部的樣式,例如 google font:
@import url('https://fonts.googleapis.com/css2?family=Fredericka+the+Great');
@default-color: #333;
body{
color: @default-color;
font-family: 'Fredericka the Great', cursive;
}
會被編譯成如下的 css:
@font-face {
font-family: 'Fredericka the Great';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/frederickathegreat/v15/9Bt33CxNwt7aOctW2xjbCstzwVKsIBVV-9Sk.ttf) format('truetype');
}
body {
color: #333;
font-family: 'Fredericka the Great', cursive;
}
可是,外部的 CSS 我並不想要直接將之轉換,我想要匯出的 CSS 依舊使用 @import