Sass

How to calculate with SCSS variables from function

北城余情 提交于 2021-01-26 03:33:48
问题 I have a function which converts px to rem. For example: height: rem-calc(14px); // makes height: 1rem; Now I would like to calculate with it from variables. For example: $switch-track-width: rem-calc(50px); $switch-thumb-size: $switch-track-width / 2; // making it 25px or 1.7857rem in this case That doesn't work so I tried something else: $switch-thumb-size: ($switch-track-width / 2) + 0rem; $switch-thumb-size: (#{$switch-track-width} / 2) + 0rem; Both $switch-thumb-size examples aren't

Angular6 学习笔记——组件详解之组件通讯

元气小坏坏 提交于 2021-01-24 00:16:47
angular6.x系列的学习笔记记录,仍在不断完善中,学习地址: https://www.angular.cn/guide/template-syntax http://www.ngfans.net/topic/12/post/2 系列目录 (1) 组件详解之模板语法 (2) 组件详解之组件通讯 (3) 内容投影, ViewChild和ContentChild (4) 指令 (5) 路由 目录章节 1 前言 2 Angular组件间的通讯 2.1 父子组件间的通讯 2.1.1 父组件设置子组件属性 2.1.2 父组件调用子组件事件 2.1.3 子组件向父组件发射事件 2.2 非父子组件通讯 2.2.1 Service 2.2.2 路由传值 2.2.2.1 传递一个值 2.2.2.2 传递一个对象 3 通用方式实现通讯 3.1 localStorage 3.2 服务端 1前言 前端框架,例如extjs,vue,angular等,都是或趋于组件化,所以组件间的通讯,是一个亟需解决的问题 一般而且言,这些组件之间都会形成这种树形结构 图片来源:大漠穷秋 组件之间会有下列3种关系: 1父子关系 2兄弟关系 3没有直接关系 通常采用下列方式处理(某些方式是框架特有)组件间的通讯,如下: 1父子组件之间的交互(@Input/@Output/模板变量/@ViewChild) 2非父子组件

How to select parent pseudo-class from within child using scss

╄→гoц情女王★ 提交于 2021-01-21 09:16:30
问题 I'd like to select the parent using the following pattern. I understand I could write this within the parent selector, but I'd like to know if it's possible to prefix the parent's pseudo class to the child from within the child selector. JSX: <div class="parent"> <div class="child" /> </div> <div class="parent"> <div class="child" /> </div> SCSS: .parent { height: 100px; .child { // the goal is to write this so it produces the CSS output below, from // within .child &:first-child & { height:

gulp concat after sass

女生的网名这么多〃 提交于 2021-01-21 06:34:49
问题 I would like to take the sass output and concat it to another css regular file. example: animate.css app.scss return gulp.src('app.scss') .pipe(sass({ errLogToConsole: true })) .pipe(concat(['animate.css', OUTPUT_OF_THE_SASS_ABOVE])) .pipe(gulp.dest(paths.public+'css/')) .pipe(rename({ extname: '.min.css' })) .pipe(gulp.dest('css/')) .on('end', done); any ideas how to do it? ******* IDEA maybe is it possible to generate the css file from sass in to a temp location, then concat it with css

Angular2 module level stylesheets

时光怂恿深爱的人放手 提交于 2021-01-20 23:40:09
问题 I am designing my website in a modular structure using sass and I am willing to organise the stylesheets in such a way that I define a stylesheet at each module level(instead of component level) and then import it in all the components to keep a standard layout for the entire module. So is this a good approach? If yes, is there a method to export the CSS from the module.ts file to all the components. In a very similar way, the services are made available using the providers . This will save

Angular2 module level stylesheets

大城市里の小女人 提交于 2021-01-20 23:39:44
问题 I am designing my website in a modular structure using sass and I am willing to organise the stylesheets in such a way that I define a stylesheet at each module level(instead of component level) and then import it in all the components to keep a standard layout for the entire module. So is this a good approach? If yes, is there a method to export the CSS from the module.ts file to all the components. In a very similar way, the services are made available using the providers . This will save

Switching from node-sass to dart sass in my angular-cli project

我怕爱的太早我们不能终老 提交于 2021-01-20 19:10:10
问题 I've been having issues with node-sass doing all manner of silliness during "npm install" including but not limited to : GNU c++ compiling something (likely itself) trying to run python2.7 trying to run any other version of python trying to connect to github and this was posing problems in a corporate context where I have to compile my project on Jenkins where NPM libraries must be pulled from a clone of npm registry on corporate servers and only the strict necessities of that specific

Switching from node-sass to dart sass in my angular-cli project

╄→гoц情女王★ 提交于 2021-01-20 19:08:58
问题 I've been having issues with node-sass doing all manner of silliness during "npm install" including but not limited to : GNU c++ compiling something (likely itself) trying to run python2.7 trying to run any other version of python trying to connect to github and this was posing problems in a corporate context where I have to compile my project on Jenkins where NPM libraries must be pulled from a clone of npm registry on corporate servers and only the strict necessities of that specific

Switching from node-sass to dart sass in my angular-cli project

谁都会走 提交于 2021-01-20 19:08:33
问题 I've been having issues with node-sass doing all manner of silliness during "npm install" including but not limited to : GNU c++ compiling something (likely itself) trying to run python2.7 trying to run any other version of python trying to connect to github and this was posing problems in a corporate context where I have to compile my project on Jenkins where NPM libraries must be pulled from a clone of npm registry on corporate servers and only the strict necessities of that specific

node-sass 以及 node 的版本升级

牧云@^-^@ 提交于 2021-01-14 02:52:23
因为看到一些项目是用sass的。要编译sass,一个是ruby来编译,一种是用node来编译。我选择用node来编写。 node升级 node升级的正确方法 nodejs升级的两种方法 Node.js v10.12.0 文档 node-sass node-sass Sass的四种编译方式 node-sass 的安装和使用 SASS学习系列之三--------- node-sass 自动编译scss 文件 Re:从零开始的实习生活01----webstorm和intellij idea下如何自动编译sass和scss文件 npm install node-sass -g node-sass -v 以往的版本 来源: oschina 链接: https://my.oschina.net/u/1585200/blog/2254390