less

CSS-Less class extend class with pseudo class

六眼飞鱼酱① 提交于 2019-12-29 05:13:06
问题 I was wondering how I could do something like the following with less css: .btn { color : black; } .btn:hover { color : white; } .btn-foo { .btn; &:hover { .btn:hover; } } Of-course this is just an example, what need to point is if there is any way to extend the pseudo-class in order to avoid re-type the properties of :hover pseudo class everywhere I need them. I know I could create a mixin for that but I'm wondering if I could avoid it. Thanks 回答1: UPDATE: If you can't modify external files

MySQL应用优化

落花浮王杯 提交于 2019-12-28 10:15:59
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、基本语句优化原则 (1).尽量避免在索引列上进行运算或函数操作,这样会导致索引失效 如: select * from t where Year(d)>=2016; 可以优化为: select * from t where d>='2016-01-01'; (2).使用join语句时,应用小结果集驱动大结果集。因为在join多表时,可能会导致更多的锁定和拥塞 (3).注意模糊查询时避免%%,%开头的查询条件会使索引失效 (4).仅列出需要查询的字段,这对效率没有影响,但会影响内存 如: select * from t; 可以优化为: select name from t; (5).使用批量交互插入语句以节省交互 如: insert into t(id,name) values(1,"a"); insert into t(id,name) values(2,"b"); 可以优化为: insert into t(id,name) values(1,"a"),(2,"b"); 这里也有博友质疑,贴结果: (6).limit的基数比较大时使用between 如: select * from article order by id limit 100000,10; 可以优化为: select * from

how to setup less using only js

别说谁变了你拦得住时间么 提交于 2019-12-28 04:35:05
问题 I have an html like this all I have included all the files in to my folder. I tried to add some 'less' css attributes in to my main.css file but it is not reflecting in my browser I have added like this. p{color:red;} Any help will be really appreciated. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

How can I customize Twitter Bootstrap's CSS using LESSCSS variables?

余生颓废 提交于 2019-12-28 04:04:20
问题 I am trying to customize Twitter Bootstrap's CSS without altering local copies of the bootstrap code.* So I have cloned the Twitter Bootstrap project into one folder and have my application code within its own folder: /html /bootstrap ...etc... /js /less /MyApp ...etc... /common_files /less style.less Within my "style.less" file, I define a few LESS variables, then include the bootstrap files: /* custom settings that deviate from Bootstrap's default values */ @sansFontFamily: Trebuchet MS,

linux中cat、more、less、tail、head命令的区别

你说的曾经没有我的故事 提交于 2019-12-27 17:35:39
一、cat 显示文件连接文件内容的工具 cat 是一个文本文件(查看)和(连接)工具,通常与more搭配使用,与more不同的是cat可以合并文件。查看一个文件的内容,用cat比较简单,就是cat后面直接接文件名。 如:root @ubuntu :/# cat /etc/passwd 1、cat 语法结构: cat [选项] [文件]... 选项 -A, --show-all 等价于 -vET -b, --number-nonblank 对非空输出行编号 -e 等价于 -vE -E, --show-ends 在每行结束处显示 $ -n, --number 对输出的所有行编号 -s, --squeeze-blank 不输出多行空行 -t 与 -vT 等价 -T, --show-tabs 将跳格字符显示为 ^I -u (被忽略) -v, --show-nonprinting 使用 ^ 和 M- 引用,除了 LFD 和 TAB 之外 --help 显示此帮助信息并离开 2、cat 查看文件内容实例: [root @localhost ~]# cat /etc/profile 注:查看/etc/目录下的profile文件内容; [root @localhost ~]# cat -b /etc/fstab 注:查看/etc/目录下的profile内容,并且对非空白行进行编号,行号从1开始;

LessCss dynamic variables based on ancestor class

拥有回忆 提交于 2019-12-27 16:10:55
问题 I have a page template which has a branding class on the body element: <body class="brand-africa"> <h1>Africa</h1> </body> Using the following Less, I can use a variable for the brand colour and apply it to the color of a CSS selector: @brand-default: #649d84; @brand-africa: #df6f20; @brand-nz: #444; .brand-color { .brand-default & { color: @brand-default; } .brand-africa & { color: @brand-africa; } .brand-nz & { color: @brand-nz; } } h1 { .brand-color; } This works well, but sometimes I want

LessCss dynamic variables based on ancestor class

我只是一个虾纸丫 提交于 2019-12-27 16:09:01
问题 I have a page template which has a branding class on the body element: <body class="brand-africa"> <h1>Africa</h1> </body> Using the following Less, I can use a variable for the brand colour and apply it to the color of a CSS selector: @brand-default: #649d84; @brand-africa: #df6f20; @brand-nz: #444; .brand-color { .brand-default & { color: @brand-default; } .brand-africa & { color: @brand-africa; } .brand-nz & { color: @brand-nz; } } h1 { .brand-color; } This works well, but sometimes I want

ASP.NET 5系列教程 (五):在Visual Studio 2015中使用Grunt、Bower开发Web程序

我的未来我决定 提交于 2019-12-27 04:15:14
基于Visual Studio 2015,你可以: 方便的管理前端包,如jQuery, Bootstrap, 或Angular。 自动运行任务,如LESS、JavaScript压缩、JSLint、JavaScript单元测试等。 方便的获得Web开发者生态圈的工具包。 为了实现这些场景,Visual Studio 2015已经内置了一些流行的第三方工具包: Bower :Web包管理器,Bower可以帮你安装前端包,包括JavaScript、CSS类库。对于服务器端包,请通过NuGet包管理。 Grunt and Gulp :Grunt和Gulp是基于JavaScript的运行任务。如你未用过类似功能,可以认为这是一个自动调度运行的app,ASP.NET 5工程模板使用的是Grunt运行任务。 npm (Node Package Manager). npm是一个node包管理器,最初被用于Node.js包管理。上面说的Bower、Grunt、Gulp用到了npm。 启动Visual Studio 2015,新建一个ASP.NET 5.0的工程,选择文件-> 新建工程->Visual C#->Web->ASP.NET Web应用程序: 在新建工程对话框,选择ASP.NET 5.0 Starter Web 创建一个ASP.NET MVC 6 app,工程文件结构如下: 该工程下

Less函数

旧城冷巷雨未停 提交于 2019-12-26 09:20:05
索引 escape(@string); // 通过 URL-encoding 编码字符串 e(@string); // 对字符串转义 %(@string, values...); // 格式化字符串 unit(@dimension, [@unit: ""]); // 移除或替换属性值的单位 color(@string); // 将字符串解析为颜色值 data-uri([mimetype,] url); // * 将资源内嵌到css中,可能回退到url() ceil(@number); // 向上取整 floor(@number); // 向下取整 percentage(@number); // 将数字转换为百分比,例如 0.5 -> 50% round(number, [places: 0]); // 四舍五入取整 sqrt(number); // * 计算数字的平方根 abs(number); // * 数字的绝对值 sin(number); // * sin函数 asin(number); // * arcsin函数 cos(number); // * cos函数 acos(number); // * arccos函数 tan(number); // * tan函数 atan(number); // * arctan函数 pi(); // * 返回PI pow(@base,

gulp实时编译less,压缩合并requirejs模块文件

蓝咒 提交于 2019-12-25 20:06:34
gulp的使用命令简单,就几个,gulp的简单使用教材可以参考一点的gulp使用教材(http://www.ydcss.com/archives/18)。 下面就简单的介绍这些命令如何互相配合的完成前端的构建工作。 项目结构: 首先全局安装gulp,使用命令:npm install -g gulp 一:gulp实时编译less var gulp = require('gulp'); var gulpLess = require('gulp-less'); var gulpMinifyCss = require('gulp-minify-css'); var gulpSourcemaps = require('gulp-sourcemaps');   这4个插件就是目前用到的,需要其他功能可以自己添加。gulp-less是编译less用的插件,gulp-minify-css是压缩css的插件,gulp-sourcemaps是便于压缩后代码调试的。 gulp.task('allLess', function(){ gulp.src('src/less/**/*.less') .pipe(gulpSourcemaps.init())//sourcemaps .pipe(gulpLess())//编译less .pipe(gulpSourcemaps.write()) .pipe(gulp