2

我正在为我的 CSS 使用 grails 资源插件,并且想知道是否有办法将媒体查询添加到资源中。

所以我想从以下来源获取媒体查询:

<link rel="stylesheet" media="screen and (max-width:500px)" href="/css/stylesheet.css" type="text/css">

并将其添加到资源格式中:resource url: '/css/stylesheet.css'

4

1 回答 1

1

您可以在具有属性的资源 DSL中定义它attrs,例如:

modules = {
    core {
        dependsOn 'jquery, utils'
        defaultBundle 'ui'
        resource url:'/css/print.css', attrs:[media:'print']
        .....
    }
}
于 2013-01-22T09:47:11.327 回答