less

Less v2 does not compile Twitter's Bootstrap 2.x

陌路散爱 提交于 2019-11-26 23:01:05
问题 When compiling Twitter's Bootstrap 2.3.2. with Less 2 i found to following error: NameError: #grid > .core > .span is undefined in /home/bootstrap-2.3.2/less/navbar.less on line 199, column 3: 198 .navbar-fixed-bottom .container { 199 #grid > .core > .span(@gridColumns); 200 } How can i fix this? 回答1: I was able to avoid the error without modifying Bootstrap files by creating a new mixin that loaded after the Bootstrap mixins: #grid { .core { .span(@gridColumns) { width: (@gridColumnWidth *

webpack编译Less和Sass

谁说我不能喝 提交于 2019-11-26 22:54:54
文章目录 一、less 1、变量 @key: value; 2、混合 3、方法 4、方法的条件语句 5、插值语法 6、内置 二、Sass 1、变量 $key:value; 2、混合 3、方法 4、继承 @extend xxx; 5、if语句 6、for语句 7、while语句 8、each语句 9、三元运算符 10、插值 #{ } 一、less 1、变量 @key: value; 编译之后,是不会将变量保留的。 @width : 300px ; // 定义变量 // 使用变量 #box { width : @width ; height : @width ; } 2、混合 在一个选择器A的内部 书写另外一个选择器B的名称。表示,在A中复用B的所有样式 .box { width : 200px ; height : 200px ; margin : 0 auto ; background-color : red ; } .box1 { .box ; background-color : blue ; } 3、方法 其实就是定义了一个函数 // 定义方法 . drawBox ( @width , @height , @bg ) { width : @width ; height : @height ; background-color : @bg ; } // 使用变量 .box {

webpack(7)_CSS_配置Less和Sass

半腔热情 提交于 2019-11-26 22:52:42
本篇文章主要讲解webpack对Less和Sass的打包配置: 安装css-loader 安装style-loader 安装less-loader和sass-loader 实例 初始化项目,创建package.json npm init 安装style-loader npm install style-loader --save-dev 安装css-loader npm install css-loader --save-dev 安装less-loader npm install less-loader less --save-dev 安装sass-loader npm install sass-loader node-sass --save-dev 创建dist目录,用于打包输出 创建src/css/base.less文件,并添加代码 @mainColor:# 000 ; html{ background: @mainColor; } 创建src/app.js,并引入base.less import './css/base.less' ; 创建webpack.config.js并配置 // 引入node的path模块 var path = require ( 'path' ); module.exports = { entry: { app: "./src/app.js" //

webpack入门demo(三)打包sass和less

拈花ヽ惹草 提交于 2019-11-26 22:52:25
打包sass,less 和css的方法差不多,一模一样的 就是需要多安装两个包 less需要安装的: cnpm i less less-loader -D sass需要安装的: cnpm i node-sass sass-loader -D 随便写各写一个sass和less文件,index.scss 和demo.less 为了方便都写在同级好了 修改配置config文件webpack.config.js: module.exports={ entry:"./entry.js", output:{ filename:"bundle.js", path:__dirname, }, module:{ rules:[ //匹配规则 {test:/\.css$/,loader:'style-loader!css-loader'}, {test:/\.scss$/,loader:'style-loader!css-loader!sass-loader'}, {test:/\.less$/,loader:'style-loader!css-loader!less-loader'}, ] } } 上面这种module loader写法可以,也可以用另一种use的写法 注意loader后面跟字符串 use的话后面跟对象 修改entry.js入口文件: require("./style.css")

动手写webpack配置--9.关于less和sass

痞子三分冷 提交于 2019-11-26 22:49:28
基于Webpack4.x + npm6.5 + node v10.10.0 +react+ vscode环境. 项目名webpackDemo; 上一节讲到loaders: https://blog.csdn.net/fengsh998/article/details/88170903 因为现在前端开发很多时候都不只是写裸裸的css了。有一类人,觉得css的样式太个单纯,没有活力,没有气息。于是呼,程序员嘛,终归要整个成就感。这种白纸黑字的玩意,太简单不费脑。只是量的问题,不停的堆就可以了。这就是css,不考考虑重用性,继承性,冗余性。所以大神来了。硬生生的给css造了个心藏。less和sass非要把css当成了有生命的程序来写。我想也就这样吧。我吹牛的,也不知道是不是这样。不管啦。反正不进则退。不搞到别人维护不了,自己就掉饭碗。 关于less和sass的区别这时有一篇,可以了解下: https://www.cnblogs.com/hope666/p/6791790.html less的中文文档: https://less.bootcss.com sass的中文文档: https://www.sass.hk/docs/ less-loader : https://www.webpackjs.com/loaders/less-loader/ sass-loader: https:/

Immediate Child selector in LESS

北慕城南 提交于 2019-11-26 22:46:52
问题 Is there anyway to have LESS apply the immediate child selector ( > ) in its output? In my style.less, I want to write something like: .panel { ... > .control { ... } } and have LESS generate something like: .panel > .control { ... } 回答1: UPDATE Actually, the code in the original question works fine. You can just stick with the > child selector. Found the answer. .panel { ... >.control { ... } } Note the lack of space between ">" and ".", otherwise it won't work. 回答2: The official way: .panel

Is there a generic way to add vendor prefixes in LESS?

旧街凉风 提交于 2019-11-26 22:45:59
问题 I currently have a mixins.less file, where almost all mixins are basically the same: .border-radius(@radius) { -webkit-border-radius: @radius; -khtml-border-radius: @radius; -moz-border-radius: @radius; border-radius: @radius; } .box-shadow(@value) { -webkit-box-shadow: @value; -khtml-box-shadow: @value; -moz-box-shadow: @value; box-shadow: @value; } Is there a way to create some kind of generic mixin, that I could call like this: .vendor('border-radius', '3px'); .vendor('box-shadox', '10px

Is there a way to set a common image path for LESS files?

夙愿已清 提交于 2019-11-26 22:44:41
问题 I am using the LESS styling language. Consider the following CSS: .side-bg { background:url(../img/layout/side-bg.jpg) top no-repeat; } Right now all of my images are in the folder ../img/ I wanted to be able to set a variable as the image path and use it like so: @image-path: ../img; .side-bg { background:url(@image-path/layout/side-bg.jpg) top no-repeat; } This does not work however. Its not a huge deal, I could always use find and replace if the image folder ever changed. I am just

sqli-labs writeup(less1---less38)

孤人 提交于 2019-11-26 22:43:28
本文参考了一些其他文章 https://www.cnblogs.com/lcamry/category/846064.html 详解推荐 http://mp.weixin.qq.com/s?__biz=MzI5MDU1NDk2MA==&mid=2247486774&idx=1&sn=b3f24b3861f9c6e2862365bfee282965&chksm=ec1f5809db68d11fc9b45a83a178e8436a3195c9763aba4c857dda00730b8c856c9d932e6a66&mpshare=1&scene=1&srcid=#rd sqli-labs安装 sqli-labs下载地址: https://github.com/Audi-1/sqli-labs 将其解压到phpstudy中即可。可能会有一些细节问题,网上相关教程很多 另外29-31关需要用到tomcat及java环境。相关安装教程 https://jingyan.baidu.com/article/2c8c281daa77aa0008252aff.html https://www.jianshu.com/p/46cb6c354de5 less-1 手工注入 首先单引号 id=1' 发现报错'1'' limit 0,1 用--+将后面的引号以及limit语句注释 id=1'--+ 发现正常

How to use ASP.Net MVC 4 to Bundle LESS files in Release mode?

我是研究僧i 提交于 2019-11-26 22:36:25
问题 I'm trying to have LESS files in my web project, and have the MVC 4 bundling functionality call into the dotLess library to turn the LESS into CSS, then minify the result and give it to the browser. I found an example on the ASP.NET site (under the heading LESS, CoffeeScript, SCSS, Sass Bundling. ). This has given me a LessTransform class that looks like this: public class LessTransform : IBundleTransform { public void Process(BundleContext context, BundleResponse response) { response.Content