stylus

没你想象的那么难!深度剖析三款最实用的css预处理器

。_饼干妹妹 提交于 2020-02-26 01:58:13
等灯等灯~在干货系列无数次被催更之后,渡老师的前端工具小课堂又开课啦! 小渡在后台留言中发现同学们最近对前端CSS的热情很高嘛,最懂你的小渡今天就带着CSS预处理器跟大家见面啦,想学好前端?先来了解一下这些CSS预处理器叭! 了解css的大家可能都知道,我们可以用它来写网页样式,但是却不能用它来编程。在程序员眼里,css是一件很麻烦的东西。 它没有变量,也没有条件语句,只是一行行单纯的描述,写起来相当费事。所以,就有人就开始为css加入编程元素,然后就取个名字叫做"css预处理器"。 什么是css预处理器 通俗的说,css预处理器定义了一种新的语言。 基本的思想是用一种专门的编程语言,开发者只需要使用这种语言进行编码工作,减少枯燥无味的css代码的编写过程的同时,它能让你的css具备更加简洁、适应性更强、可读性更加、层级关系更加明显、更易于代码的维护等诸多好处。 css预处理器种类繁多,本次小渡就以Sass、Less、Stylus进行比较。 什么是Sass Sass是一门高于css的元语言。 它能用来清晰地、结构化地描述文件样式,有着比普通css更加强大的功能。 Sass能够提供更简洁、更优雅的语法,同时提供多种功能来创建可维护和管理的样式表。也就是我们上面说的一种预处理器语言,反正就是可以让我们风骚的定义css。 Sass优缺点 它在css的语法基础上增加了变量(variable

Stylus-import

二次信任 提交于 2020-02-12 13:22:43
Stylus Import Disclaimer: In all places the @import is used with Stylus sheets, the @require could be used When using @import without the .css extension, it’s assumed to be a Stylus sheet (e.g., @import "mixins/border-radius" ). @import works by iterating an array of directories, and checking if this file lives in any of them (similar to node’s require.paths ). This array defaults to a single path, which is derived from the filename option’s dirname . So, if your filename is /tmp/testing/stylus/main.styl , then import will look in /tmp/testing/stylus/ . @import also supports index styles. This

vue项目中使用stylus

杀马特。学长 韩版系。学妹 提交于 2020-02-12 04:39:53
首先下载stylus: npm install stylus -- save 接着我们再安装一个依赖stylus-loader: npm install stylus - loader -- save 然后我们就可以在项目中使用stylus了 来源: CSDN 作者: yanhailun 链接: https://blog.csdn.net/yanhailun/article/details/104262609

Stylus中文网&Stylus中文文档

南笙酒味 提交于 2020-02-08 12:37:27
Stylus中文文档 & Stylus中文网: https://stylus.zcopy.site Stylus 选择器(Selectors) Stylus 变量(Variables) Stylus 插值(Interpolation) Stylus 运算符(Operators) Stylus 混合(Mixins) Stylus 函数(Functions) Stylus 关键字参数(Keyword Arguments) Stylus 内建函数(Build-in Funcitons) Stylus 多余参数(Rest Params) Stylus 注释(Comments) Stylus 条件控制(Conditionals) Stylus 哈希(Hashes) Stylus 迭代控制(Iteration) Stylus 导入(@import and @require) Stylus 媒体查询(@media) Stylus 字体设置(@font-face) Stylus ‘@keyframes’ Stylus 其他 @-rules Stylus 继承(@extend) Stylus 块(@block) Stylus url() Stylus CSS字面量(CSS Literal) Stylus CSS样式(CSS Style Syntax) Stylus 字符转义(Char

Generic `vendors` mixin

拟墨画扇 提交于 2020-02-04 05:05:06
问题 Defining vendors' mixins is common task under LESS, ie: .box-shadow() { -moz-box-shadow:@arguments; -webkit-box-shadow:@arguments; -o-box-shadow:@arguments; -ms-box-shadow:@arguments; box-shadow:@arguments; } .border-radius() { -moz-border-radius:@arguments; -webkit-border-radius:@arguments; -o-border-radius:@arguments; -ms-border-radius:@arguments; border-radius:@arguments; } ... But it seems a bit repeating... What I would like is a generic vendor mixin which do this for me, ie: .vendors(

How to override Vuetify variables with custom colors?

只愿长相守 提交于 2020-02-03 04:42:07
问题 I want to override vuetify variables with custom colors by following this I've created a stylus folder which contains base folder ( _colors , _typography ) and main.styl file. The _color file is imported into main.styl file, which the latter is imported into main.js Here is my file structure: enter image description here And the imports are included in main.js : import '../node_modules/vuetify/dist/vuetify.min.css' import './assets/stylus/main.styl' Inside the _color.styl , I have this test

初识 Webpack (四) 解析stylus文件(loader和plugs配置)

ぃ、小莉子 提交于 2020-01-27 17:29:19
目录 文章 ➊ 模块安装 ➋ 添加对应处理的loader和plugin 总结 文章 vue-cli构建的vue项目中引入stylus文件(转) ➊ 模块安装 安装所需loader及依赖木块,style-loader、css-loader、stylus-loader、stylus。 安装所需插件,extract-text-webpack-plugin、html-webpack-plugin ➋ 添加对应处理的loader和plugin 0 前言 bundle.js 文件配置学习篇 1 webpack.config.js 引入相应的插件 2 解析stylus文件,在loader的配置当中,rules的test通过正则,匹配后缀名是.styl的文件,匹配成功之后使用 ExtracTextPlugin 插件 的 extract方法 进行相应的解析,解析成功之后 fallback 的 style-loader 进行样式的解析,从而使样式起作用 3 生成的样式需要添加到页面中plugins ➀ 配置: ➁ 解析前: ➂​​​​​​​ 解析后: 总结 来源: CSDN 作者: winner_corl 链接: https://blog.csdn.net/Sicily_winner/article/details/104093237

How to customize style of VueJS 2.0 using stylus?

自古美人都是妖i 提交于 2020-01-24 20:27:25
问题 I am using v-text-field without vuetify.min.css just use stylus. Here is my code. <template> <v-text-field type="text" name="password"></v-text-field> </template> <style lang="stylus" scoped="scoped"> .input-group_details { XXX } </style> I am trying to hide some divs in v-text-field. But I got nothing changed. 回答1: That is not possible using scoped styles (That's the point of scoping) What you could do is either passing down a prop which indicates that the divs are hidden or handle it

less、sass和stylus的基本总结

寵の児 提交于 2020-01-23 18:04:33
1. 基本语法区别 sass和less使用的是标准的css语法。默认的sass使用 .sass 扩展名;而less默认使用 .less 扩展名。 /* style.sass or style.less */ h1 { color : #000fff ; } /* sass也支持老的语法;就是不包含花括号和分号的写法 */ h1 color : #000fff stylus支持的语法更多样些,默认是 .styl 文件的扩展名: h1 { color : #000fff ; } h1 color : #000fff ; h1 color #000ff 2. 变量 sass: sass 最为重要的就是为css引入了变量,可以反复使用css属性值定义成变量然后通过变量来引用它们,而无需重复书写这一属性值; sass变量必须是以 $ 开头,然后变量和值之间用 ( : ) 隔开,和css属性一样。 $ maincolor : #000fff ; $ sizeWidth : 1024px ; body { color : $maincolor ; max-width : $sizeWidth ; } less css 来源: CSDN 作者: zlq_csdn 链接: https://blog.csdn.net/zlq_CSDN/article/details/103950999

Setting up auto compile for Stylus

≯℡__Kan透↙ 提交于 2020-01-20 18:30:33
问题 I have installed node.js/stylus/nib on my mac and I can manually compile .styl file to .css on the command line. I also know there is this stylus.middleware() things that keeps coming up when I search for how to setup auto-compiling when the .styl changes, however I have no idea how I am supposed to implement it (I have never used node.js before). What file do I put that code in? How do I start this code so it is always run? I think I am missing a few things on the node side to be able to set