我最近使用SASS创建了一个WordPress主题。我使用了这样的技术(http://css-tricks.com/compass-compiling-and-wordpress-themes/)让SASS编译所需的CSS文档块,没有任何问题。
现在我正在尝试使用SASS为子主题制作样式表-这需要父主题的style.css的CSS @import。这很好用,但它是在编译CSS文档块之前编译@import!有没有办法按照预定的顺序来呈现它们?我尝试将CSS @import放入分部的SASS @import中,但它仍然发生!
例如,如果这是我的SASS:
/*!
Theme Name: Themey Name
Description: Theme Description
Version: 1.0
Template: parent-theme
*/
@import url(../parent-theme/style.css);它的渲染方式如下:
@import url(../parent-theme/style.css);
/*
Theme Name: Themey Name
Description: Theme Description.
Version: 1.0
Template: parent-theme
*/我真的很想先得到那块文件!
发布于 2013-06-23 18:57:20
文件顶部@-import的问题应该根据下面的评论来解决:
Jonathan Warren Permalink to comment# 2012年10月10日在最新的WordPress (3.4.2)中你不需要style.css开头的注释块就能识别它,只需在你的主题目录中有一个空的index.php和style.css文件夹就可以了。
可在http://css-tricks.com/compass-compiling-and-wordpress-themes/上的帖子中找到
在wp 3.5.x上测试过了--在那里工作得很好。
发布于 2013-09-10 01:18:03
这是我的“变通办法”:
/*!
Theme Name: Themey Name
Description: Theme Description
Version: 1.0
Template: parent-theme
*/
@media any {
@import url(../parent-theme/style.css);
}https://stackoverflow.com/questions/15977890
复制相似问题