Skip to content

CSS 字面量

¥CSS Literal

如果由于任何原因 Stylus 无法满足特定需求,你始终可以使用 @css 来求助于字面量 CSS:

¥If for any reason Stylus cannot accommodate a specific need, you can always resort to literal CSS with @css:

@css {
    .ie-opacity {
        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=25);
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=25)";
    }
}
@css {
    .ie-opacity {
        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=25);
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=25)";
    }
}

编译为:

¥Compiling to:

.ie-opacity {        
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=25);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=25)";
}
.ie-opacity {        
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=25);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=25)";
}