less

Converting “Long Shadow” SASS mixin to Less

一个人想着一个人 提交于 2019-11-28 00:26:15
I try to rewrite sass mixin for generation long text-shadow http://codepen.io/awesomephant/pen/mAxHz to less mixin .long-shadow(@type, @color, @length, @fadeout: true, @skew: false, @direction: right){ @shadow : ''; .if @skew == false or @type == text{ .if @direction == right {@ @for @i from 0 to @length - 1 { @shadow: @shadow + @i + 'px ' + @i + 'px 0 ' + @color + ','; } } .if @direction == left {@ @for @i from 0 to @length - 1 { @shadow: @shadow + @i * -1 + 'px ' + @i + 'px 0 ' + @color + ','; } } } .if @fadeout == true{ @for @i from 1 to @length - 1 { .if @type == text or @skew == false{

less 预处理器

和自甴很熟 提交于 2019-11-28 00:21:30
规范 1、定义变量时冒号(:)与变量值之间必须(MUST)保留一个空格,冒号前不得(MUST NOT)保留空格。如:错误color:@box_width; 正确color: @box_width; 2、变量命名必须采用 @foo-bar 形式,不得使用 @fooBar 形式。 定义变量 @box_width:100px; 注:100px不用双引号括起来 .box{ color: @box_width; } 变量的运算 在运算中只要变量写了单位,参与运算的值可以不写单位,如果写了其他单位,也会按变量定义的单位编译。 @test_width:200px; @test_height:200px; div{ width: @test_width+200; height: @test_height+200em; } 选择器的嵌套 1、嵌套写法 ul { width: 200px; } ul li{ width: 100px; } 写成: ul { width: 200px; li { widht:100px; } } 2、使用&来将伪类嵌套在对应选择器内 ul li:hover { color: red; } 写成: ul { &:hover{ color: red; } }    来源: https://www.cnblogs.com/web-zqk/p/11382347.html

Creating a transparent arrow above image in CSS3

断了今生、忘了曾经 提交于 2019-11-27 23:57:28
I'm trying to create an effect where I have a transparent arrow above any image in CSS3. See the following image. Any ideas how to do this effect? Using LESS if that comes to any help. To draw a transparent / inverted triangle in CSS3 you could use the CSS3 triangle technic , and make the inverted shape by combining the :before and :after pseudo objects, each to draw one part of the triangle. You could do something like this: .image { position:relative; height:200px; width:340px; background:orange; } .image:before, .image:after { content:''; position:absolute; width:0; border-left:20px solid

Twitter bootstrap, buttons hover style?

。_饼干妹妹 提交于 2019-11-27 23:20:00
问题 I am trying to use gradient style for my buttons, but, I have a problem with hover style, Here is the button before hover: And here is after hover: Here is haml of button: = link_to '#', {:class=>'tour_btn btn btn-large btn-primary', :style=>'margin-left: 10px; width: 105px;'} do %h3 Take a Tour LESS: .tour_btn { #gradient > .vertical(#F98C51, #a35b35); } Any idea please ? is it possible to specify another gradient style for hover state ? Or at least, not to change button when hover ? 回答1:

@ sign and variables in CSS keyframes using LESS CSS

本小妞迷上赌 提交于 2019-11-27 23:02:59
I'm in need of 8 different CSS3 animations which are way too similar, so I used LESS for it. Below is the code, that works perfectly, with one little glitch - the @name variable. .animation_top (@name, @pxFrom, @pxTo) { @-moz-keyframes @name { 0% { top: @pxFrom; opacity: 0; } 100% { top: @pxTo; opacity: 1; } } @-webkit-keyframes @name { 0% { top: @pxFrom; opacity: 0; } 100% { top: @pxTo; opacity: 1; } } @-ms-keyframes @name { 0% { top: @pxFrom; opacity: 0; } 100% { top: @pxTo; opacity: 1; } } } Because css keyframes are started by @ sign, LESS simply ignores the variable of @name. Is there any

Changing variable dynamically (at runtime) via LESS and CSS?

亡梦爱人 提交于 2019-11-27 22:39:20
问题 @myThemeBackground = #ddd; div#box1 { background: @myThemeBackground; } I'm using LESS in order to use variables for my css. It works fine, but I'm wondering if there's a way for me to change the "myThemeBackground" dynamically at runtime via javascript or something. So say if the user chooses a custom color for the background I'd like the entire skin to change. Note: this is for dynamically theming/skinning an application where the user chooses the color for the background for example and

How to convert a numeric value into a percentage (or) append percentage symbol to a number?

こ雲淡風輕ζ 提交于 2019-11-27 22:22:43
问题 I'm trying to use LESS css to do the following: width: ((480/1366)*100)+'%'; The problem though is that the output becomes: width: 35.13909224011713 '%'; How do I make it workable? ie.: width: 35.13909224011713%; 回答1: It is possible to use string interpolation: @myvar: ((480/1366)*100); width: ~"@{myvar}%"; That will output width: 35.13909224011713%; Additionally, if you want it to be rounded, you can use round() . 回答2: Even though this question is quite old, I want to add a few more examples

Can you do a javascript for loop inside of LESS css?

半世苍凉 提交于 2019-11-27 21:43:53
问题 I am looking to do a for loop inside of Less. Is it possible to do this inside of Less? I know it has the capability to evaluate js but to this degree? 回答1: I will recommend to checkout Twitter Bootsrap. They are building their grid system that way. They loop, with recursion, in a less mixin, instead of typing every class they need. The interesting part is in mixins.less file, in the less directory, below "// The Grid" comment (line 516). The interesting portion is: #grid { .core (

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

╄→尐↘猪︶ㄣ 提交于 2019-11-27 21:03: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? 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 * @gridColumns) + (@gridGutterWidth * (@gridColumns - 1)); } } }; This was better for us as we avoid patching

SQLi_Labs通关文档

六眼飞鱼酱① 提交于 2019-11-27 21:02:31
SQLi_Labs通关文档 先列举一下sql基础语句 show databases; //查看数据库use xxx; //使用某个数据库show tables; //查看该数据库的数据表desc xxx; //查看该数据表的结构select * from xxx; //查找某个数据表的所有内容select schema_name from information_schema.schemata; //猜数据库select table_name from information_schema.tables where table_schema='xxxxx'; //猜某数据库的数据表Select column_name from information_schema.columns where table_name='xxxxx'; //猜某表的所有列left(a,b) //从左侧截取 a 的前 b 位mid(column_name,start[,length]) //从位置start开始,截取column_name字符串的length位,与substr作用相同substr(string, start, length) //从位置start开始,截取字符串string的length长度,与mid作用相同ascii() //将某个字符转换成ascii码ord() /