Angular-CLI 全局 scss 变量 [英] Angular-CLI global scss vairables

查看:31
本文介绍了Angular-CLI 全局 scss 变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在最新的 Angular-CLI(使用 webpack)中添加全局 scss 变量?

How to add global scss variables in latest Angular-CLI (with webpack)?

看起来styles.scss中定义的全局变量在组件样式中不可用.

Looks like global variables defined in styles.scss are not available in the component styles.

推荐答案

它们需要通过相对路径导入到组件的 SCSS 文件中.这将允许编译器找到处理所需的父文件.

They will need to be imported into the component's SCSS file via a relative path. This will allow the compiler to find the necessary parent file(s) for processing.

这篇关于Angular-CLI 全局 scss 变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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