我是Ionic的新手,我使用了角度为2的离子2 beta。现在这适用于Sass。而离子在您的应用app/theme/app.variables.css
中生成默认样式,其中定义了primary
和secondary
等颜色。他们给你的默认scss文件如下所示:
// http://ionicframework.com/docs/v2/theming/
// Ionic Shared Functions
// --------------------------------------------------
// Makes Ionic Sass functions available to your App
@import "globals.core";
// App Shared Variables
// --------------------------------------------------
// To customize the look and feel of this app, you can override
// the Sass variables found in Ionic's source scss files. Setting
// variables before Ionic's Sass will use these variables rather than
// Ionic's default Sass variable values. App Shared Sass imports belong
// in the app.core.scss file and not this file. Sass variables specific
// to the mode belong in either the app.ios.scss or app.md.scss files.
// App Shared Color Variables
// --------------------------------------------------
// It's highly recommended to change the default colors
// to match your app's branding. Ionic uses a Sass map of
// colors so you can add, rename and remove colors as needed.
// The "primary" color is the only required color in the map.
// Both iOS and MD colors can be further customized if colors
// are different per mode.
$colors: (
primary: #387ef5,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
favorite: #69BB7B
);
而且,正如他们的文档中所提供的,这是正确的代码。 (虽然他们不包括favorite
)。
btw黑暗结束时额外的逗号不会改变任何内容
现在的问题是我遇到了2个错误。结肠primary: #387ef5,
上的1。说[scss] ) expected.
答案 0 :(得分:0)
只需这样做:
$colors: (
'primary': #387ef5,
'secondary': #32db64,
'danger': #f53d3d,
'light': #f4f4f4,
'dark': #222,
'favorite': #69BB7B
);