2017-03-05 9 views
0

Stylus是否可以定義要使用的關鍵字/變量而不是長@media行規則?觸筆用關鍵字替換long @media行

例如:

IE = @media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) 

,然後用它作爲

.div1 
    IE 
     color red 
+0

注:這裏的媒體是Chrome瀏覽器,而不是IE瀏覽器。 – CodeGust

回答

1

沒錯,是這樣的:

IE = 'all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm)' 

.div1 
    @media IE 
    color red 
+0

謝謝!這樣可行! – CodeGust