将媒体查询添加到Grails资源插件 [英] Adding media queries to grails resources plugin
本文介绍了将媒体查询添加到Grails资源插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为我的CSS使用grails资源插件,并且想知道是否可以将媒体查询添加到资源中.
I'm using the grails resources plugin for my CSS and would like to know if there is a way to add media queries to the resource.
所以我想从以下来源获取媒体查询:
So I'd like to take the media query from the below source:
<link rel="stylesheet" media="screen and (max-width:500px)" href="/css/stylesheet.css" type="text/css">
并将其添加到资源格式中:资源网址:"/css/stylesheet.css"
And add it into the resource format: resource url: '/css/stylesheet.css'
推荐答案
You can define it in the resource DSL with attrs
property, like:
modules = {
core {
dependsOn 'jquery, utils'
defaultBundle 'ui'
resource url:'/css/print.css', attrs:[media:'print']
.....
}
}
这篇关于将媒体查询添加到Grails资源插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文