为什么添加自定义SASS变量在Ionic中不起作用? [英] Why adding custom SASS variables does not work in Ionic?

查看:560
本文介绍了为什么添加自定义SASS变量在Ionic中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用-s选项设置了一个新的离子项目来启用SASS。

I setup a new ionic project using the -s option to enable SASS.

这是我的/myproject/scss.ionic.app.scss的一部分:

Here is a part of my /myproject/scss.ionic.app.scss:

...
$positive:                        #2a8000 !default;
$button-font-size:                30px !default;

// Include all of Ionic
@import "www/lib/ionic/scss/ionic";

保存这个scss文件时,我可以在shell中看到sass已启动且css已重新启动内置:

When saving this scss file, I can see in the shell that sass is launched and css is re-built:

[00:18:18] Starting 'sass'...
CSS changed:  www/css/ionic.app.css
[00:18:18] Finished 'sass' after 330 ms
CSS changed:  www/css/ionic.app.min.css

然而,新的css文件似乎完全相同,无论我放入scss文件。

However, the new css file seems to be exactly the same, whatever I put into the scss file.

你能解释一下原因吗?
非常感谢。

Can you explain why? Thanks a lot.

推荐答案

非常愚蠢......

It was pretty stupid...

我没注意SASS在 www / css / ionic.app.css
中生成新的css但是,该文件包含在默认的离子index.html是 lib / ionic / css / ionic.css

I didn't pay attention that SASS generates the new css in www/css/ionic.app.css However, the file included in the default ionic index.html is lib/ionic/css/ionic.css

唯一要做的就是在index.html

The only thing to do is to write <link href="css/ionic.app.css" rel="stylesheet"> in index.html

并删除
< link href =lib / ionic / css / ionic.css =stylesheet>

这篇关于为什么添加自定义SASS变量在Ionic中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆