Sass

npm 杂七杂八

╄→гoц情女王★ 提交于 2020-03-08 18:35:17
npm config set registry https://registry.npm.taobao.org npm install --registry=https://registry.npm.taobao.org npm install phantomjs-prebuilt@2.1.16 --ignore-scripts npm uninstall --save node-sass npm install --save node-sass cnpm uninstall --save node-sass cnpm install --save node-sass node-sass -v npm install node-sass -g cnpm install --save-dev node-sass 下载地址:http://npm.taobao.org/dist/phantomjs/ 来源: https://www.cnblogs.com/sharonzhang/p/12444030.html

npm run dev运行Vue项目报错:Node Sass does not yet support your current environment

喜你入骨 提交于 2020-03-07 07:49:07
导入Vue项目后,#npm run dev 报错: error in ./src/pages/hello.vue Module build failed: Error: Node Sass does not yet support your current environment....... 大致就是编译某个vue文件失败,因为构造Module失败,node sass 不支持当前环境【主要是 node 】。 先看一下node版本: #node --version 升级了node版本/ node版本太高会造成node-sass不兼容的问题,那么就再install node-sass一下就行了。   #npm i node-sass -D  【<==>#npm install node-sass -save-dev】 资料: 1、 nodejs 升级后, vue+webpack 项目 node-sass 报错的解决方法 来源: https://www.cnblogs.com/vae860514/p/8296512.html

[Sass]Sass基础知识面试题

∥☆過路亽.° 提交于 2020-03-05 23:58:03
1、有多少种方法可以使用SASS? 您可以使用三种不同的方式使用SASS: 作为命令行工具 作为一个Ruby模块 作为Rack启用框架的插件 2、SASS中的嵌套规则是什么? 嵌套是不同逻辑结构的组合。 使用SASS,我们可以将多个CSS规则相互组合。 如果使用多个选择器,则可以在另一个选择器中使用一个选择器来创建复合选择器。 3、如何在SASS中引用父选择器? 使用&字符选择父级选择器。 它告诉父选择器应该插入的位置。 4、如何在SASS中写入占位符选择器? SASS使用 class 或 id 选择器支持占位符选择器。 在正常CSS中,这些用“#"或“。“指定,但在SASS中,它们替换为“%”。 5、列出SASS上的不同类型的运算符? 有5种类型的运算符: 数字运算符 颜色运算符 字符串运算符 布尔运算符 列表运算符 6、什么是数字运算? 它允许诸如加法,减法,乘法和除法的数学运算。 7、什么是彩色运算? 它允许使用颜色分量和算术运算。 8、什么是列表运算? 列表表示使用逗号或空格分隔的一系列值。 9、什么是布尔运算? 您可以使用and、or和not(与或非)对Sass脚本执行布尔运算。 10、SASS中的括号是什么? 括号是一对标记,通常用圆括号()或方括号[]来标记,这提供了影响操作顺序的符号逻辑。 11、什么是SASS中的插值? 它使用#{}

使用 VSCode 编辑器来编译 Sass

帅比萌擦擦* 提交于 2020-03-05 20:02:41
VSCode 是继 Sublime Text3、Atom 后另一个让我爱不释手的编辑器,其颜值和插件生态圈与 Atom 不相上下,但比后者用起来更加丝滑流畅(Atom 需要4G+内存和SSD 才能逆天),所以自然成了我目前首选的编辑器。 前端项目自然少不了和 Sass 打交道,VSCode 提供了丰富的相关插件来帮助我们处理 Sass 相关任务。我用的是 Easy Sass 这款插件,目前最新版本是 0.0.6。 由于 Sass 的编译依赖 Ruby 环境,因此我们在开始之前首先得安装 Ruby,别担心,装 Ruby 只是为了提供运行环境,不懂 Ruby 没任何关系。 官网下载传送门 安装 Ruby 时一定要勾选 Add Ruby executables to your PATH,用来将 Ruby 添加到系统变量,这样后续可以省却很多不必要的麻烦。装好后在命令行输入 gem sass 来安装 Sass,安装完成后启动 VSCode,在拓展商店里搜索“easy sass”,并安装,安装成功后重启 VSCode。 接下来进行配置。在 VSCode 菜单栏依次点击“文件 首选项 设置”,打开 settings.json 全局配置文件。搜索“easysass”,然后把 easysass 相关的设置项复制到右侧的用户设置编辑窗口中,再根据实际情况修改配置项。 一般生产环境中用到其中两个设置项

SASS Language Processor in PhpStorm on Windows 8

不羁的心 提交于 2020-03-04 11:07:30
问题 I've installed Ruby and SASS on my Windows 8 computer. I'm using PhpStorm's Language Processor with the sass.bat file. Everything is setup correctly, but I get this error in PhpStorm: '"ruby.exe"' is not recognized as an internal or external command, operable program or batch file. It could be that when sass.bat is executed, my system isn't allowing ruby.exe to be run, because it needs administrator privileges. Does anyone know how to fix this problem? 来源: https://stackoverflow.com/questions

Toggle a class by a button from header component that affect main app component by Angular 6+

爷,独闯天下 提交于 2020-03-03 17:17:17
问题 My app by Angular simply starts with index.html : <body> <app-root></app-root> </body> I would like it to be switched between Dark/Light by toggling between <body> and <body class="dark-mode"> with below styles: body abcxyz { color: #fff } body.dark-mode abcxyz { color: #a2b3c4 } Next is app.component.html with Header - Main - Footer as usual: <app-header></app-header> <router-outlet></router-outlet> <app-footer></app-footer> The header.component.html has a toggle button: <button (click)=

Toggle a class by a button from header component that affect main app component by Angular 6+

倖福魔咒の 提交于 2020-03-03 17:17:03
问题 My app by Angular simply starts with index.html : <body> <app-root></app-root> </body> I would like it to be switched between Dark/Light by toggling between <body> and <body class="dark-mode"> with below styles: body abcxyz { color: #fff } body.dark-mode abcxyz { color: #a2b3c4 } Next is app.component.html with Header - Main - Footer as usual: <app-header></app-header> <router-outlet></router-outlet> <app-footer></app-footer> The header.component.html has a toggle button: <button (click)=

Sass/CSS color wheel

孤街醉人 提交于 2020-03-03 07:46:08
问题 I have made a color wheel, and it is looking good except for the last element which is occupying more space and it has a larger width . How can I make it so all my span's share an equal width demo @for $i from 1 through 25 { span:nth-child(#{$i}) { border-top-color: hsl($i * 15, 50%, 50%); border-left-color: transparent; border-right-color: transparent; border-bottom-color: transparent; } } @for $i from 1 through 25 { span:nth-child(#{$i}) { transform: rotate($i * 14.4deg); } } #colorWheel {

Sass/CSS color wheel

筅森魡賤 提交于 2020-03-03 07:46:07
问题 I have made a color wheel, and it is looking good except for the last element which is occupying more space and it has a larger width . How can I make it so all my span's share an equal width demo @for $i from 1 through 25 { span:nth-child(#{$i}) { border-top-color: hsl($i * 15, 50%, 50%); border-left-color: transparent; border-right-color: transparent; border-bottom-color: transparent; } } @for $i from 1 through 25 { span:nth-child(#{$i}) { transform: rotate($i * 14.4deg); } } #colorWheel {

Sass/Scss 安装与使用

泄露秘密 提交于 2020-03-02 19:59:35
Sass/Scss 安装与使用 官方网址: https://sass-lang.com/ 中文说明(非官方版): https://www.sasscss.com/getting-started/ 本文使用 node 平台,其他平台环境请阅读官方文档。 node 下载安装 node 版本: 12.5 好工具就全局安装! npm i -g sass phpstorm 配置 phpstorm 版本: 2019.2 设置配置地址: Preferences -> Tools -> File Watchers 检查设置脚本对象: Program = sass 添加模版,选择 scss 创建即可。 注意不是 Compass Sass ! 完成后,新建编辑 .scss 文件自动编辑创建 .css 文件。 来源: oschina 链接: https://my.oschina.net/u/3756690/blog/3126059