less

LESS differences between mixin and extend [closed]

淺唱寂寞╮ 提交于 2019-12-06 05:58:48
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 4 years ago . As stated in the title, I'm looking for a clear explanation regarding the differences between mixin and extend in LESS . Code examples & live demo (i.e. on codepen.io ) are more than welcome. Before the differences, it is important to delve into what mixins and extend are Mixins Mixins are common rule-sets you define and can use them in any other rule-sets, eg. .highlighted-text

Extract item from css LESS list by name

社会主义新天地 提交于 2019-12-06 04:57:18
If I have a list in less like: @colors: 'red' #f00, 'green' #0f0, 'blue' #00f; I know that I can loop over the list and get the colors, but what if I want to get a specific one? Say I want to do extract(@colors, 'green') to get #0f0 out of the list. Is there a way to do this? If it takes a few steps instead of 1 that is fine, I am just curious if it is possible. The documentation only mentions getting an item from a list by index. http://lesscss.org/functions/#list-functions-extract The Lists Less plugin has at function, so your code may be as simple as: @colors: red #f00, green #0f0, blue

Compiling all less files into one stylesheet?

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:55:50
问题 I am using simpless, I drag the project into it and target all the less files to styles.css The issue is when compiling the less stylesheets are just over writing each other rather than being merged together. Is there a way when compiling to merge them all into styles.css ? 回答1: You have to create a master less file that imports the subfiles. The master file would import the subfiles with: @import "myfile1.less"; @import "myfile2.less"; Into the compiler, you just pass the master less file.

less用法

余生颓废 提交于 2019-12-06 04:48:35
LESS的基本用法 什么是LESS: LESS是一个动态样式语言,属于CSS预处理语言的一种,为CSS的赋予了动态语言的特性,如变量、继承、运算、函数等,更方便CSS的编写和维护,让CSS更具有维护性,主题性,扩展性。 LESS可以在多种语言、环境中使用,包括浏览器端、桌面客户端、服务端。 LESS的官方网站: www.lesscss.org 如何使用LESS: 在使用时,应当用编译工具进行编译后使用! 使用的编译工具: Koala 官网下载: koala-app.com LESS文件中的注释: 1、//注释的内容 只会在less文件中显示,不会编译到css文件中去; 2、/ *注释的内容 */ 会被编译到css文件中去; LESS中的变量 普通变量 定义方式:@变量名:变量值 @green: #801f77; @baise:white; 作为选择器和属性名 定义方式:@{ 变量名 } @kuandu:width; .@{kuandu}{ @{kuandu}:150px } 作为URL 使用方式:用" "将变量的值扩起来,同样将变量以 @{ 变量名 } 的方式使用 @imgurl:"https://www.baidu.com/img/"; header{ background: @green url("@{imgurl}bdlogo.png"); height: 500px; }

Webpack 2 issues with Semantic UI

孤街浪徒 提交于 2019-12-06 04:36:45
Been struggling to get semantic-ui setup using Webpack 2. I a few errors relating to the fonts in the default semantic-ui theme and another error regarding image-webpack-loader : ERROR in ./~/css-loader?{"lessPlugins":[{"options":{"paths":{"../../theme.config":"/Users/djthomps/Desktop/demo/theme.config"}}}]}!./~/less-loader!./semantic/src/semantic.less Module not found: Error: Can't resolve './themes/themes/default/assets/fonts/icons.eot' in '/Users/djthomps/Desktop/demo/semantic/src' @ ./~/css-loader?{"lessPlugins":[{"options":{"paths":{"../../theme.config":"/Users/djthomps/Desktop/demo/theme

ORA-01555 When Max Query Length Is Less Than Undo Retention, small or 0 Seconds (Doc ID 1131474.1)

社会主义新天地 提交于 2019-12-06 04:20:35
ORA-01555 When Max Query Length Is Less Than Undo Retention, small or 0 Seconds (Doc ID 1131474.1) APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.2 [Release 10.2 to 11.2] Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.4 [Release 11.2] Oracle Database - Enterprise Edition - Version 12.1.0.2 to 12.1.0.2 [Release 12.1] Oracle Database Cloud Schema Service - Version N/A and later Oracle Database Exadata Express Cloud Service - Version N/A and later Information in this document applies to any platform. SYMPTOMS Symptoms: - A job or process is

Pass a string of less to less.js and receive css?

隐身守侯 提交于 2019-12-06 04:16:04
问题 Is there a function in less.js to pass a string of less code and return css code? I'm hoping to make a live less editing environment, so the user could edit the less string and I can recompile it and display the css. I see there is a php solution: http://leafo.net/lessphp/ but would like to stay in js if it's a possibility. Thanks! 回答1: You can instantiate the less.Parser. Looking at the browser.js source it actually turned out to be quite easy: var cssString = '@color: #FFFF00; body { color:

How to use variables in different less files?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 04:01:14
问题 Let's say I separate a less files into many less files to be easy to organize. Here is my repository: /reset.less /variables.less /mixins.less /main.less /styles.less The styles.less is just importing the other files: @import "reset.less"; @import "mixins.less"; @import "variables.less"; @import "main.less"; However, when I add some codes into main.less and use the @line-color which is defined in the variables.less. It shows Name Error: variable @line-color is undefined and I cannot compile

Image urls for Rails 4 + Less not including the hash

可紊 提交于 2019-12-06 03:37:44
I have a Rails 4 application and am using the less-rails gem. In main.css.less , I add a background image to the site using: body { background-image: image-url("background.jpg"); } Everything works fine locally, but when I push up to my server with precompiled assets, the image url is not updating to include the hash. That is, the image now lives at public/assets/background-074c0b767cd8cfb2da93b37ea3596326.jpg but my css file still says url(/assets/background.jpg) . The link below seemed very promising, but none of the recommended solutions have worked (most of them are specific to sass ,

SQL注入系列:SQLi Labs

≯℡__Kan透↙ 提交于 2019-12-06 02:49:27
前言 关于注释 说明:在SQL中 --[空格] 表示注释,但是在URL中 --空格 在发送请求的时候会把最后的空格去掉,所以用 --+ 代替,因为 + 在被URL编码后会变成空格 MYSQL有三种常用注释: --[空格]注释内容 #注释内容(url中使用23%) /*注释内容*/ 第一关 测试注入类型: http://192.168.142.136/sqli/Less-1/?id=1' 报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' LIMIT 0,1' at line 1 http://192.168.142.136/sqli/Less-1/?id=1 and 1=1 返回正常 http://192.168.142.136/sqli/Less-1/?id=1' and 1=1--+ 返回正常 http://192.168.142.136/sqli/Less-1/?id=1' and 1=2--+ 返回异常,综上,字符型注入 http://192.168.142.136/sqli/Less-1/?id=1' order by 3--+