Sass

How can I tell CSS :not() selector to affect all child nodes?

两盒软妹~` 提交于 2020-12-27 06:36:01
问题 Please see this minimum example .global :not(.guard) { color: red; } <div class="global"> <p>I'm outside guard</p> <div class="guard"> I'm inside guard. <div> <hr> <p> I'm a block inside guard. </p> <p> I want to black color too. </p> <p> How can I achieve it? </p> </div> </div> </div> I have a style(SCSS) like this .global { :not(.guard) { color: red; } } I want anything inside the node with .guard class name's color not to be affected by color: red; How can I achieve this effect? 回答1: If I

How can I tell CSS :not() selector to affect all child nodes?

て烟熏妆下的殇ゞ 提交于 2020-12-27 06:35:05
问题 Please see this minimum example .global :not(.guard) { color: red; } <div class="global"> <p>I'm outside guard</p> <div class="guard"> I'm inside guard. <div> <hr> <p> I'm a block inside guard. </p> <p> I want to black color too. </p> <p> How can I achieve it? </p> </div> </div> </div> I have a style(SCSS) like this .global { :not(.guard) { color: red; } } I want anything inside the node with .guard class name's color not to be affected by color: red; How can I achieve this effect? 回答1: If I

Add new utilities with Bootstrap 5

陌路散爱 提交于 2020-12-26 09:56:25
问题 Following the B5 new documentation, this is how you are supposed to add new utilities with the new utilities API. I have not been the get the new output though. exemple: @import "bootstrap/scss/utilities"; $utilities: map-merge( $utilities, ( "cursor": ( property: cursor, class: cursor responsive: true, values: auto pointer grab, ) ) ); my file: @import "bootstrap.scss"; @import "bootstrap/scss/utilities"; $utilities: map-merge( $utilities, ( "button-rounded": ( property: border-radius, class

Add new utilities with Bootstrap 5

荒凉一梦 提交于 2020-12-26 09:54:41
问题 Following the B5 new documentation, this is how you are supposed to add new utilities with the new utilities API. I have not been the get the new output though. exemple: @import "bootstrap/scss/utilities"; $utilities: map-merge( $utilities, ( "cursor": ( property: cursor, class: cursor responsive: true, values: auto pointer grab, ) ) ); my file: @import "bootstrap.scss"; @import "bootstrap/scss/utilities"; $utilities: map-merge( $utilities, ( "button-rounded": ( property: border-radius, class

Node Sass does not 支持的版本错误

淺唱寂寞╮ 提交于 2020-12-26 00:29:49
在进行编译的时候运行到下面的错误: Node Sass does not yet support your current environment: Windows 64 -bit with Unsupported runtime ( 88 ) 这是因为有版本问题: 如果你使用 “node-sass”: “^4.14.1” 的版本的话,那么你需要将 node 的版本调整为: 14 的版本。 然后再重新编译后就没有问题了。 https://www.ossez.com/t/node-sass-does-not/788 来源: oschina 链接: https://my.oschina.net/honeymoose/blog/4841500

给小程序再减重 30% 的秘密​(京喜小程序首页瘦身实践)

我与影子孤独终老i 提交于 2020-12-25 20:00:22
前言 — 在 web 开发场景,减少代码体积虽然是性能优化的一个方向,还没到锱铢必较的程度。但是在小程序场景,由于代码包上传阶段限制了主包 2M 和总包 16M(近期微信官方正在内测将总包上限调整至 20M )的尺寸,超过就会面临无法发版的风险,代码包体积的优化就变得特别重要了。京喜小程序首页作为微信购物的大入口,承载大量流量,功能复杂模块众多,又要与其他核心业务和公共组件共享 2M 的主包空间,因此代码包瘦身的工作在持续不断进行,否则无法满足业务的快速增长。本文将结合以往优化策略与最近一次的瘦身实践,分享小程序代码瘦身的经验与思考。 常见的瘦身方式 — 京喜首页项目是一个优化良好的项目,对于常见的优化措施,已经有过很好的实践,就让我们我们先回顾一下有哪些常见的优化策略吧: 代码分包:将相对独立的页面和组件拆分到分包,可以解决主包体积受限问题; 依赖分析:移除未引用的页面、组件和其他文件; 避免使用本地资源:除了兜底图片,其他都尽可能使用 url 的方式,由于 base64 图本质上是将信息编码成长字符串,也会占用很多空间,不建议使用; 对所有类型的文件都进行压缩并清理注释,包括了:js、wxml、wxss、json; 此外,京喜首页团队还针对 Taro 开发场景进行了如下优化: 分析出编译后每个文件的高频重复代码(如处理兼容性的 pollyfill 代码),拆分生成公共文件

stylus样式开发的使用----vue

岁酱吖の 提交于 2020-12-19 08:48:37
stylus是css开发辅助工具,类似lLess和Sass,安装成功后的使用如下图所示 使用的时候要特别注意缩进,因为缩进是页面dom的父子关系或者兄弟关系的体现,如图font-size:0.4rem可以理解为.header类下的.header-left类下的.text-align类 的font-size为0.4rem。而且较平常使用的css相比可以不写{}和属性后的;。这样代码更简洁易读,同样stylus也可以像Less、Sass一样使用变量 一、安装 通过终端打开项目所在的文件夹,使用 cnpm的前提是安装了淘宝镜像,否则使用npm , 1、安装 stylus ,输入命令: cnpm install stylus --save 2、安装stylus-loader,输入命令 : cnpm install stylus-loader --save 3、启动项目,输入命令: npm run dev 二、引入 在要使用的文件style标签下面引入stylus 输入:@ import '~styles/varibles.styl' 至此,stylus的安装和使用已经完成。 来源: oschina 链接: https://my.oschina.net/u/4264283/blog/3406920

前端最新技术学习地址总结

允我心安 提交于 2020-12-19 01:59:18
1. 主流技术官网总结 1.1. 工具类 Glup 官网: http://www.gulpjs.com.cn/ http://i5ting.github.io/stuq-gulp/#10202 Webpack 官网: http://webpack.js.org GitBook: http://fakefish.github.io/react-webpack-cookbook/index.html webpack-handbook: http://zhaoda.net/webpack-handbook/ SASS 官网: http://www.sass.hk http://sass.bootcss.com/ NPM 官网: https://docs.npmjs.com/ Markdown 官网: http://www.markdown.cn/ Git http://git-scm.com/book/zh/v1/ http://gitbook.liuhui998.com/ 1.2. 流行技术类 Vue2.0 2.0官网: http://vuejs.org/guide/ 2.0中网网: http://vuefe.cn/ 微信开发者文档 官方文档 http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html ES5

工作命令

落爺英雄遲暮 提交于 2020-12-18 09:40:59
安装saas cnpm install node-sass @latest 前端打包:npm run build:prod 来源: oschina 链接: https://my.oschina.net/u/3631797/blog/4259672

less、sass、stylus

家住魔仙堡 提交于 2020-12-18 07:55:23
less、sass、stylus 它们是三种类似的样式动态语言,属于css预处理语言,它们有类似css的语法,为css赋予了动态语言的特性、如变量、继承、运算、函数等。这么做是为了css的编写和维护。 它们使用的文件分别是: .less、 .scss、*.styl,这些文件是不能再网页上直接使用的,最终要编译成css文件来使用,编译的方法有软件编译,或者用nodejs程序。 less、sass编译软件: http://koala-app.com/index-zh.html less中文网址: http://lesscss.cn/ less语法: 1、注释 // 不会被编译的注释 /* 会被编译的注释 */ 2、变量 @w:200px; .box{ width:@w; height:@w; background - color:red; } 3、混合 .border{ border:1px solid #ddd; } .box(@w:100px,@h:50px,@bw:1px){ width:@w; height:@h; border:@bw solid #ddd; } .box{ .border; background - color:red; } 4、匹配模式 .p(r){ postion:relative; } .p(a){ postion:absolute; } .p(f){