离子 - SCSS - '[scss])期待'&& '[scss] {预期'错误消息 [英] Ionic - SCSS - '[scss] ) expected' && '[scss] { expected' error messages

查看:110
本文介绍了离子 - SCSS - '[scss])期待'&& '[scss] {预期'错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ionic的新手,我使用的是离角2 beta,使用角度为2.现在这适用于Sass。 and ionic在您的应用程序中生成其默认样式 app / theme / app.variables.css 其中主要 secondary 等颜色已定义。他们给你的默认scss文件如下所示:

I am fairly new to Ionic and I'm using the ionic 2 beta using angular 2. Now this works with Sass. And ionic generates their default styling in your application app/theme/app.variables.css where the primaryand secondary etc. colors are defined. The default scss file they give you looks like this:

// 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
);

而且,正如他们的文档中所提供的,这是正确的代码。 (虽然它们不包括收藏夹)。

And, as provided in their docs, this is the correct code. (although they don't include favorite).

btw黑暗结束时额外的逗号不会改变任何内容

现在的问题是我遇到了2个错误。 1上主要:#387ef5,在冒号处。说 [scss])预期。

Now the problem is that I get 2 errors. 1 on the primary: #387ef5, at the colon. Saying [scss] ) expected.

辅助字段上输入1:#32db64,在冒号上说 [scss] {expected。

And 1 on the secondary: #32db64, on the colon saying [scss] { expected.

推荐答案

只需这样做:

$colors: (
  'primary':    #387ef5,
  'secondary':  #32db64,
  'danger':     #f53d3d,
  'light':      #f4f4f4,
  'dark':       #222,
  'favorite':   #69BB7B
);

这篇关于离子 - SCSS - '[scss])期待'&& '[scss] {预期'错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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