less

LESS: Unrecognized input error when using Bootstrap

不打扰是莪最后的温柔 提交于 2019-11-26 21:01:36
After upgrading Harp, I started getting an Unrecognized Input error in an irrelevant line of CSS. Less -> CSS (Unrecognised input) /Users/jorge/Dropbox/harp.io/apps/mysite.com/public/css/main.less Using Bootstrap v2.2.2 and Harp v0.9.4. After digging for a while, I found that the error was coming from the mixin.less file where the #grid stuff was getting defined. This is what the file had originally: (~".span@{index}") { .span(@index); } After reading the LESS change log , I found that they changed the syntax so you can now use variables directly without needing the ~ hack. So I changed my

Full width Bootstrap dropdown nav

依然范特西╮ 提交于 2019-11-26 20:59:10
问题 I'm trying to create full width dropdown using bootstrap as you can see on this picture. Now I have something like this (I have removed unnecessary items from the nav list): <ul class="nav navbar-nav navbar-right"> <li> <a href="/_work/cz.krupovi/www/o-nas">O nás</a> </li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Kalkulačky <span class="caret"></span></a> <ul class="dropdown-menu list-inline" role="menu"> <li><a href="#">RPSN Kalkulačka</a> </li> <li><a

Dynamically define a variable in LESS CSS

旧巷老猫 提交于 2019-11-26 20:57:25
问题 I am trying to create a mixin that dynamically defines variables in LESS CSS, by actually assigning them a composite name. The simplified use-case (not the real one): .define(@var){ @foo{var}: 0; } Then one would call the mixin as such: .define('Bar'){ @fooBar: 0; } Since this kind of string interpolation is possible while using selectors names, I was wondering if the same would be possible for variable names; so far, I have had no luck with various syntaxes I tried (other than the above, I

Compiling issue in Bootstrap 3 with namespace

我的梦境 提交于 2019-11-26 20:29:53
问题 Any idea why there are certain styles breaking when I compile Bootstrap 3 using Crunch / WinLESS. I'm using this code to namespace bootstrap. .namespace-bs { @import "less/bootstrap.less"; } For most styles it works great but there are a few that turn out like this: .btn-primary .namespace-bs .caret,.btn-success .namespace-bs .caret,.btn-warning .namespace-bs .caret,.btn-danger .namespace-bs .caret,.btn-info .namespace-bs .caret{border-top-color:#fff;} When I would expect them to be like this

【LESS系列】基本语法

霸气de小男生 提交于 2019-11-26 20:29:23
这里将直接以实例的方式展示 LESS 的基本语法。 less code 是编译前的代码,css code 是编译后的代码。 本文的内容,同样是引自【 http://www.ibm.com/developerworks/cn/web/1207_zhaoch_lesscss/ 】 1.变量 //less code //定义一个变量 @border-color : #b5bcc7; .mythemes tableBorder{ border : 1px solid @border-color; } //css code .mythemes tableBorder { border: 1px solid #b5bcc7; } 变量最常用的情境是定义主题,像字体颜色,背景颜色,边框样式等进行统一定义,统一定义图片资源路径也是一个不错的做法。 LESS 中的变量和其他编程语言一样,可以实现值的复用,同样它也有生命周期,也就是 Scope(变量范围,开发人员惯称之为作用域),简单的讲就是局部变量还是全局变量的概念。 查找变量的顺序是先在局部定义中找,如果找不到,则查找上级定义,直至全局。下面我们通过一个简单的例子来解释 Scope。 //less code @width : 20px; #homeDiv { @width : 30px; #centerDiv{ width : @width; /

Programmatically editing Less (css) code with JQuery-like selector syntax?

↘锁芯ラ 提交于 2019-11-26 20:28:30
问题 It's possible to use libraries in less.js to dynamically regenerate css from less files within the browser. If there was an easy way to modify less code, this would be an extremely powerful method of dynamically updating a site's css. Imagine you had a colour that was used 100 times throughout a large site. If you wanted to change that color dynamically just using javascript, you would need to update every bit of css that had that colour (perhaps 50 lines of code). With what I'm imagining all

tr cat more less head tail 等常用命令

大憨熊 提交于 2019-11-26 20:16:56
# cat 命令: 创建文件 , 显示内容 , 一个不存在的文件或者字符不能输入使用<的输出重定向 。 cat filename 一次显示整个文件 cat > filename 从键盘创建一个文件 cat file1 file2 > file 将几个文件合并为一个文件 cat -n linuxfile1 > linuxfile2 把 linuxfile1 的档案内容 加上行号 后输入 linuxfile2 这个档案里 cat -b linuxfile1 linuxfile2 >> linuxfile3 把 linuxfile1 和 linuxfile2 的档案内容加上行号 ( 空白行不加 ) 之后将内容附加到 linuxfile3 里。 把 linuxfile1 的档案内容加上行号后输入 linuxfile2 这个档案里 cat -n linuxfile1 > linuxfile2 把 linuxfile1 和 linuxfile2 的档案内容加上行号 ( 空白行不加 ) 之后将内容附加到 linuxfile3 里。 cat -b linuxfile1 linuxfile2 >> linuxfile3 cat /dev/null > /etc/test.txt 此为清空 /etc/test.txt 档案内容 cat <<boy >test.sh 内容 boy (直到输入到 boy

Load less.js rules dynamically

喜欢而已 提交于 2019-11-26 19:56:50
I'm looking at using less . js (looks great), but our site requires that some styles be loaded dynamically after initial page load. It seems, however, that all LESS stylesheets must be loaded prior to the less.js script load. i.e. this works <link rel="stylesheet/less" href="/static/less/style.less"/> <script src="http://lesscss.googlecode.com/files/less-1.0.30.min.js"></script> but it fails if the lines are swapped around, neither firefox nor chrome appear to attempt loading 'style.less' unless they are ordered correctly. The ordering requirement is noted explicitly in this tutorial . Is

Less定义变量

别说谁变了你拦得住时间么 提交于 2019-11-26 19:33:29
1. 定义: 使用 @ 符号来定义变量 ,在Less中开头是 @ 则是变量,关于变量的命名方法,大家可以参考js中命名的规则,毕竟是做前端的,有着统一的习惯有助于我们统一风格。个人推荐变量名的命名规则使用驼峰命名法。第一个单词首写字母小写,从第二个开始,单词首写字母大写。如boxAaa,boxBbbb,boxContainer,……,当然也是可是使用香肠命名法用下划线“_”来命名。如,box_main,border_bottom,…… 2. 使用: 在样式属性值中使用时,直接用 @variable 即可调用变量; 在其他地方,包括选择器名称、属性名称、URL和@import语句使用时,变量必须以插值的形式使用,例如: @variable: 200px; //定义变量作为样式属性值使用 @classname: .nav_a; //变量值不可用中划线,此变量作为插值用于选择器名称 @{classname}{ //作为插值 必须加 {} width: @variable; //作为属性值直接调用 } 输出: .nav_a { width: 200px; } 来源: https://www.cnblogs.com/xiaozhang666/p/11331115.html

LESS CSS nesting classes

杀马特。学长 韩版系。学妹 提交于 2019-11-26 19:06:54
问题 I'm using LESS to improve my CSS and am trying to nest a class within a class. There's a fairly complicated hierarchy but for some reason my nesting doesn't work. I have this: .g { float: left; color: #323a13; .border(1px,#afc945); .gradient(#afc945, #c8da64); .common; span { .my-span; .border-dashed(1px,rgba(255,255,255,0.3)); } .posted { .my-posted; span { border: none; } } } I can't get the .g.posted to work. it just shows the .g bit. If i do this it's fine: .g { float: left; color: