Sass

Trying to use sass modules in create-react-app with the new @use syntax but receiving an error

吃可爱长大的小学妹 提交于 2020-04-03 10:47:40
问题 I've npm installed the latest node-sass, and scss files work fine until I use @use. I have a _tokens.scss file in /shared/tokens/ folder. Within _tokens.scss I have: $colorwhite: #ffffff; In my root folder, my App.scss looks like this: @use "shared/tokens/tokens"; .App-header { color: tokens.$colorwhite; } But I am getting this error: ./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6

node-sass 安装失败的报错

蹲街弑〆低调 提交于 2020-04-01 06:07:33
转自: https://www.jianshu.com/p/92afe92db99f 报错: E:\kibana>npm install node-sass > node-sass@3.8.0 install E:\kibana\node_modules\node-sass > node scripts/install.js Cannot download "https://github.com/sass/node-sass/releases/download/v3.8.0/win3 2-x64-48_binding.node": tunneling socket could not be established, cause=socket hang up Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g. export HTTP_PROXY=http://example.com:1234 or configure npm proxy via npm config set proxy http://example.com:8080 > node-sass@3.8.0 postinstall E:\kibana\node_modules\node

sass内置函数

醉酒当歌 提交于 2020-03-29 17:36:07
number类型函数 random() 0-1 random(10) 0-10之间的整数 random(100) 0-100之间的整数 编译后 list数组相关函数 编译后 @debug 实时返回打印结果,并在控制台输出 如现在演示的函数操作,没有实际的css意义,可以直接在控制台输出 输出结果 字符串函数 输出结果 map类型常见函数 编译结果 自定义函数 @function 编译结果 来源: https://www.cnblogs.com/chenyingying0/p/12593276.html

sass继承+嵌套+条件控制

懵懂的女人 提交于 2020-03-29 15:42:13
简单继承: @extend 继承 编译后 关联属性继承: 编译后 链式继承: 编译后 伪类继承: 编译后 sass嵌套 编译后 相同的属性值前缀,也可以用嵌套 编译后 sass条件控制 @if @else if @else 编译后 条件判断语句也可以写在外面 编译后 循环 @for $i from n1 through n2 (包括n2) @for $i from n1 to n2(不包括n2) 编译后 编译后 使用for循环遍历数组list length(list) 获取数组长度 编译后 while循环 用的官方demo,编译居然报错了 使用each遍历map 编译后 来源: https://www.cnblogs.com/chenyingying0/p/12592279.html

SCSS - Get container width as height

冷暖自知 提交于 2020-03-23 12:08:20
问题 Is there a way to get the container width of a child element in calculation of the child element height without using JavaScript. Say, rendering an image in an 16:9px aspect ratio which is 1.778 : 1px. If i set the image width to 100% of the container. How do i set the height to PSEUDO: $width: 100%; height: (100% * 0.5625)px; I'm trying to get the value of 100% using calc() , but doesn't work. calc(100% + 1)px; 回答1: I found it. Sass interpolation does the work. Its possible to use sass

Angular 6: How to hide radio circle using Angular Material and use NgStyle for checked answer?

末鹿安然 提交于 2020-03-22 03:41:07
问题 I'm having trouble with two things: Hide circles of mat-radio-group Change p tag background to blue if checked I've tried using ::ng-deep to override css properties and change colors to white, tried to configure invisibility:hidden but none worked. Also, I tried to use ngStyle to configure that the background color of p tag will be blue if checked but it didn't work. This is the HTML: <div class="container-fluid"> <header class="lesson-heading" *ngIf="currentQuestion"> <span class="title"><

第一篇 CSS预处理器Sass和Less

Deadly 提交于 2020-03-18 22:40:35
3 月,跳不动了?>>> Sass和Less Sass和Less都属于CSS预处理器,CSS预处理器定义了一种新的语言,其基本思想是用一种专门的编程语言,为CSS增加了一些编程的特性,如:变量、语句、继承等概念。将CSS作为目标生成文件,然后开发者就只要使用这种语言进行CSS的编码工作。 官网地址 Less官网地址: http://lesscss.org/ Less VSCode插件:Easy LESS Sass官网地址: https://sass-lang.com/ Sass VSCode插件:Easy Sass 编写Less文件 (后缀名.less) 备注:新建hello.less文件,然后写入代码,然后保存后会自动编译生成一个同名的css文件。 编写Sass文件 (后缀名.scss,老版本的后缀名为.sass) 备注:新建hello.scss文件,然后写入代码,然后保存后会自动编译生成一个同名的css文件和一个压缩后的css文件。 常用语法大纲 1. 注释 Sass Less 2. 变量 Sass ($符号) Less(@符号) 来源: oschina 链接: https://my.oschina.net/mj20200214/blog/3197704

第四篇 CSS架构与文件组织

自闭症网瘾萝莉.ら 提交于 2020-03-17 22:57:09
某厂面试归来,发现自己落伍了!>>> CSS架构 在一个大型项目中,由于页面过多,导致CSS代码难以维护和开发。所以CSS架构可以帮助我们解决文件管理与文件划分问题。 首先要对CSS进行模块化处理,一个模块负责一类操作行为。可以利用Sass或Less来实现。 文件夹 含义 base 一些初始的通用CSS,如重置默认样式,动画,工具,打印等 components 用于构建页面的所有组件,如按钮,表单,表格,弹窗等 layout 用于布局页面的不同部分,如页眉,页脚,弹性布局,网格布局等 pages 放置页面之间不同的样式,如首页特殊样式,列表页特殊样式等 themes 应用不同的主题样式时,如管理员,买家,卖家等 abstracts 放置一些如:变量,函数,响应式等辅助开发的部分 vendors 放置一些第三方独立的CSS文件,如bootstrap,iconfront等 文件结构思维导图 main.scss 作为总的入口文件,引用所有的模块文件 @import "abstracts/variables"; @import "abstracts/function"; @import "abstracts/media"; @import "base/reset"; @import "base/typography"; @import "base/animate"; @import