less

How can I use media queries more efficiently with LESS?

浪尽此生 提交于 2019-12-06 11:14:04
I'm working with Bootstrap and LESS on a responsive webpage design. One of the reasons I have enjoyed LESS in the past is because it can keep all attributes for HTML elements together. What I have below is some rules to define a .sponsors block, and then one rule that applies to an element inside that block when the viewport is >= 768px I don't like how that one rule requires a lot of extra code, and how that rule is apart from the rest of the rules. It also feels wrong. What is a better way to do this / organize this? Do I need to start out by breaking everything down into top level @media

How to sperates the less file in a css file with webpack 2?

喜你入骨 提交于 2019-12-06 11:06:39
I can compile the less on the page within the <style></style> by webpack2. but I can't compile the less file into a CSS file. webpack.config.js: var path = require('path'); var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var ENV = process.env.NODE_ENV; var port = '10101'; var commonAttr = ['common', 'markerFactory', 'sceneTransform', 'sparFactory', 'upload']; var vendorArr = []; for (var i = 0, l = commonAttr.length; i < l; i++) { vendorArr.push(path.resolve(__dirname + '/script/common/', commonAttr[i] + '.js')) } var config = { entry: { vendor

Restrict mixin values and throw exception when invalid value is provided

我只是一个虾纸丫 提交于 2019-12-06 08:50:24
I have the following Less mixin: .box-sizing(@value) { -webkit-box-sizing: @value; -moz-box-sizing: @value; box-sizing: @value; } and I would like to allow only the values 'border-box' and 'content-box' as parameter, otherwise the Less engine should throw an exception. How can I achieve this? Because without this validation I can write any value to the mixin and it will work, but it will also generate invalid CSS and no one will notice that there is an error. Harry As far as I know, there is no way to make the Less compiler throw an error for an invalid value like described in question.

HBuilder配置Less自动编译

社会主义新天地 提交于 2019-12-06 07:17:14
1、安装less编译 Less是基于NodeJS的, 所以安装完NodeJS后使用 npm 安装Less npm install -g less 如果上面的命令慢的话使用国内的镜像: cnpm install -g less 2. 进入 HBuilder 预编译设置 3.配置预编译项 触发命令地址为 lessc.cmd 文件, 此文件在 NodeJS 的安装目录下(安装完成LESS后才会有该文件) 4. 配置完成 配置完成后, 保存 .less 文件时. 会自动修改响应的 .css 文件. 来源: https://www.cnblogs.com/xiejn/p/11968581.html

Determine HSL variation to transform a color in another one

ⅰ亾dé卋堺 提交于 2019-12-06 07:01:50
问题 I use LESS , and I would like to take advantage by various integrated color functions that allow to set only few basic colors, and then derive others changing Hue, Saturation, Lightness, Spin, ecc. Let's imagine that we have the following 2 colors (a light-green and a dark-green in this example) in my colorizer: @primary-color: rgb(0,100,60); @secondary-color: rgb(185,215,50); I would like to explicitly set only @primary-color and then obtain @secondary-color after an appropriate HSL

How to make a Responsive (Row Fluid) Mixin for Bootstrap

两盒软妹~` 提交于 2019-12-06 07:01:29
问题 I can replace this code with <div class="row"> <div class="span10">...</div> <div class="span2">...</div> </div> With this, to make it more semantic <div class="article"> <div class="main-section">...</div> <div class="aside">...</div> </div> <!-- Less stylesheet --> .article { .makeRow(); .main-section { .makeColumn(10); } .aside { .makeColumn(2); } } How can I do this with the fluid grid though: <div class="row-fluid"> <div class="span10">...</div> <div class="span2">...</div> </div> <!--

Space in less loop

为君一笑 提交于 2019-12-06 06:27:14
I have this : .loop(@index) when(@index =< @to) { .page-@{index} { nav{ ul{ li:nth-child(@{index}){ background:#fff; } } } } .loop(@index + 1); } It seems to have a problem, because the output of my css is : ul li:nth-child( 2) { background: #fff; } ul li:nth-child( 3) { background: #fff; } it creates a space in the pseudo selector and it doesn't work. Any ideas to remove this space ? Thanks It's a bug. A workaround is to set the identifier via temporary variable, e.g.: ul { @li: ~"li:nth-child(@{index})"; @{li} { background: #fff; } } 来源: https://stackoverflow.com/questions/23064609/space-in

SQL注入之Boolean型盲注

廉价感情. 提交于 2019-12-06 06:26:17
什么是Boolean型注入 Boolean型的注入意思就是页面返回的结果是Boolean型的,通过构造SQL判断语句,查看页面的返回结果是否报错,页面返回是否正常等来判断哪些SQL判断条件时成立的,通过此来获取数据库中的数据。 Boolean型注入实战 这儿以SQLi-Labs less5来进行演示Boolean型盲注实战。 首先查看是否存在注入点 构造payload http://43.247.91.228:84/Less-5/?id=1 加个单引号 http://43.247.91.228:84/Less-5/?id=1' 数据库报错说明存在注入点 接下来来看看数据库的长度,构造payload http://43.247.91.228:84/Less-5/?id=1%27and%20length(database())=1%23 页面回显不正常,在进行尝试到8时回显正常 payload http://43.247.91.228:84/Less-5/?id=1%27and%20length(database())=8%23 回显正常说明数据库长度为8 猜测数据库的第一位 payload http://43.247.91.228:84/Less-5/?id=1%27and%20left(database(),1)%3E%27a%27--+ 回显正常,说明数据库第一个字母大于a

Zoomed-out sizing in twitter bootstrap?

纵饮孤独 提交于 2019-12-06 06:20:59
问题 I like the sizes of all items using twitter bootstrap when (in my browser) I've zoomed out twice, ctrl -, ctrl -, rather than the default, viewing with ctrl+0. Zooming affects font sizes, the responsive design, and a dozen of the other great reasons I want to use bootstrap, so I don't want to hackishly just fix a width and break all of that. Does Bootstrap have a single CSS value (or a small set of them) that I can change somewhere that produces something like this zoom and sizing? I realize

Git flag non-modified files as modified when generated by LESS or if line separator has changed

微笑、不失礼 提交于 2019-12-06 06:09:21
I have an issue using git. It basically flag files that haven't modified in two different cases: When the file has been regenerated by my LESS file watcher (for unknown reason), the content hasn't changed, it is exactly the same as before. When the lne separator has changed, because LESS use always LF for generated .css, whatever the line separator of the source file (less) is. I've added a screenshot . I don't understand why these files are flag as modified, it messes up my git because it cannot commit them. It's boring and recurrent in my projects. Here is what I get with a git status