作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 grunt-contrib-compass
,在设置中,有imagesDir
之类的选项和 imagesPath
.我只是想知道这是做什么用的,我该如何使用它?
最佳答案
显然,这些选项要与 compass URL Helpers
一起使用.如果您指定了 imagesDir
在您的 Gruntfile.js
,您可以调用compass
功能 images-url()
生成图像文件夹的路径。
例如,这是您指定 Gruntfile.js
的方式。 :
compass: {
build: {
options: {
cssDir: './source/css/',
sassDir: './source/css/',
imagesDir: './source/images/',
force: true,
outputStyle: 'expanded',
}
}
}
scss
调用函数的方式。文件:
background-image: image-url( 'test.png' );
background-image: url('/./source/images/test.png');
fontsDir
,您只需要调用不同的
compass
功能
font-url()
.如果您想了解更多详情,请点击链接
http://compass-style.org/reference/compass/helpers/urls/
关于gruntjs - grunt-contrib-compass 中的 imagesDir 和 imagesPath 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18584382/
我正在使用 grunt-contrib-compass ,在设置中,有imagesDir之类的选项和 imagesPath .我只是想知道这是做什么用的,我该如何使用它? 最佳答案 显然,这些选项要与
我是一名优秀的程序员,十分优秀!