- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
错误、功能请求或提议:
我为 Material 设计创建了一个主题,但是当我构建时出现错误。我的代码是这样的:main.scss
@import "~@angular/material/theming";
// Theme variables, must be included before the libraries to allow overriding defaults
@import "theme/theme-variables";
// Theme customization
// -------------------
@import "theme/theme";
theme-variables.scss
// Theme contrast color
$dark: $black-87-opacity;
$light: $white-87-opacity;
$strong-light: rgb(255, 255, 255);
// Theme color map
$theme-blue: (
50: #ebf1fa,
100: #c2d4ef,
200: #9ab8e5,
300: #78a0dc,
400: #5688d3,
500: #3470ca,
600: #2e62b1,
700: #275498,
800: #21467e,
900: #1a3865,
A100: #c2d4ef,
A200: #9ab8e5,
A400: #5688d3,
A700: #275498,
contrast: (
50: $dark,
100: $dark,
200: $dark,
300: $strong-light,
400: $strong-light,
500: $light, // default
600: $light, // default
700: $light, // default
800: $light, // default
900: $light, // default
A100: $dark,
A200: $light, // default
A400: $light, // default
A700: $light // default
));
$theme-paleblue: (
50: #ececee,
100: #c5c6cb,
200: #9ea1a9,
300: #7d818c,
400: #5c616f,
500: #3c4252,
600: #353a48,
700: #2d323e,
800: #262933,
900: #1e2129,
A100: #c5c6cb,
A200: #9ea1a9,
A400: #5c616f,
A700: #2d323e,
contrast: (
50: $dark,
100: $dark,
200: $dark,
300: $strong-light,
400: $strong-light,
500: $light, // default
600: $light, // default
700: $light, // default
800: $light, // default
900: $light, // default
A100: $dark,
A200: $light, // default
A400: $light, // default
A700: $light // default
));
// ------------------------------------------------------------------------------------------------
// Custom Material theme variables
// ------------------------------------------------------------------------------------------------
@include mat-core();
// ------------------------------------------------------------------------------------------------
// Default Theme
// ------------------------------------------------------------------------------------------------
// Background palettes
$mat-light-theme-background: (
status-bar: map_get($mat-grey, A100),
app-bar: map_get($mat-grey, A100),
background: map_get($mat-grey, 100),
hover: rgba(black, 0.04), // TODO(kara): check style with Material Design UX
card: white,
dialog: white,
disabled-button: $black-12-opacity,
raised-button: white,
focused-button: $black-6-opacity,
selected-button: map_get($mat-grey, A100),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
);
// Define default color palettes
$default-primary: mat-palette($theme-paleblue, 700, 500, 600);
$default-accent: mat-palette($mat-light-blue, 600, 400, 700);
$default-warn: mat-palette($mat-red);
// Create default theme object
$default-theme: mat-light-theme($default-primary, $default-accent, $default-warn);
theme.scss
@include angular-material-theme($default-theme);
@include splash-theme($default-theme);
ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/main.scss
Module build failed:
undefined
^
(50: #ececee, 100: #c5c6cb, 200: #9ea1a9, 300: #7d818c, 400: #5c616f, 500: #3c4252, 600: #353a48, 700: #2d323e, 800: #262933, 900: #1e2129, A100: #c5c6cb, A200: #9ea1a9, A400: #5c616f, A700: #2d323e, contrast: (50: rgba(0, 0, 0, 0.87), 100: rgba(0, 0, 0, 0.87), 200: rgba(0, 0, 0, 0.87), 300: white, 400: white, 500: rgba(255, 255, 255, 0.87), 600: rgba(255, 255, 255, 0.87), 700: rgba(255, 255, 255, 0.87), 800: rgba(255, 255, 255, 0.87), 900: rgba(255, 255, 255, 0.87), A100: rgba(0, 0, 0, 0.87), A200: rgba(255, 255, 255, 0.87), A400: rgba(255, 255, 255, 0.87), A700: rgba(255, 255, 255, 0.87)), default: #2d323e, lighter: #3c4252, darker: #353a48, default-contrast: rgba(255, 255, 255, 0.87), lighter-contrast: rgba(255, 255, 255, 0.87), darker-contrast: rgba(255, 255, 255, 0.87), "50-contrast": rgba(0, 0, 0, 0.87), "100-contrast": rgba(0, 0, 0, 0.87), "200-contrast": rgba(0, 0, 0, 0.87), "300-contrast": white, "400-contrast": white, "500-contrast": rgba(255, 255, 255, 0.87), "600-contrast": rgba(255, 255, 255, 0.87), "700-contrast": rgba(255, 255, 255, 0.87), "800-contrast": rgba(255, 255, 255, 0.87), "900-contrast": rgba(255, 255, 255, 0.87), "A100-contrast": rgba(0, 0, 0, 0.87), "A200-contrast": rgba(255, 255, 255, 0.87), "A400-contrast": rgba(255, 255, 255, 0.87), "A700-contrast": rgba(255, 255, 255, 0.87), "contrast-contrast": null) isn't a valid CSS value.
in C:\Devlab\node-apps\angular-x-express-starter-kit\node_modules\@angular\material\_theming.scss (line 1072, column 14)
@ ./src/main.scss 4:14-187
@ multi ./src/main.scss
node-sass -v
结果是
4.5.2
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.0.3
node: 6.10.3
os: win32 x64
@angular/animations: 4.1.2
@angular/common: 4.1.2
@angular/compiler: 4.1.2
@angular/core: 4.1.2
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.1.2
@angular/http: 4.1.2
@angular/material: 2.0.0-beta.5
@angular/platform-browser: 4.1.2
@angular/platform-browser-dynamic: 4.1.2
@angular/router: 4.1.2
@angular/cli: 1.0.3
@angular/compiler-cli: 4.1.2
最佳答案
theme-variables.scss 使用了 Angular Material:mat-palette、mat-light-theme 等。
为了使这些可用,您需要将此导入添加到 theme-variables.scss 的顶部:
@import "~@angular/material/theming";
关于angular - undefined ... 不是有效的 CSS 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43983136/
我只是有一个更琐碎的问题。 为什么undefined == undefined 返回true,而undefined >= undefined 为false? undefined 等于 undefine
用PHP 7.2编写套接字服务器。根据Firefox 60中的“网络”选项卡,服务器的一些HTTP响应的第一行随机变为undefined undefined undefined。因此,我尝试记录套接字
在 JavaScript 中这是真的: undefined == undefined 但这是错误的: undefined <= undefined 起初我以为<=运算符包含第一个,但我猜它试图将其转换
在回答这个问题 (Difference between [Object, Object] and Array(2)) 时,我在 JavaScript 数组中遇到了一些我以前不知道的东西(具有讽刺意味的
来自https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/of , Note: thi
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
当我添加 到我的 PrimeFaces Mobile 页面,然后我在服务器日志中收到以下警告 WARNING: JSF1064: Unable to find or serve resource, u
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我正在运行 PHP 脚本并继续收到如下错误: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php
我是一名优秀的程序员,十分优秀!