less

Twitter Bootstrap LESS with Node.js & Express

你说的曾经没有我的故事 提交于 2019-11-28 19:58:47
问题 Since Twitter Bootstrap 2 is out, I wanted to integrate that into my Node.js project. Unfortunately, there's something wrong with the less compiler and I can't get it to work. I put all files into the public folder and set up a new project with express -c less newproj . and added the lines for less less = require('less'); app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] })); All Node tells me is: Express server listening on port 3000 in development mode undefined On the

grunt学习实战(1)

北城以北 提交于 2019-11-28 19:50:43
grunt基础知识我就不再写了,直接看 官网 就可以了.官网的教程还是挺清楚的. 大概看了一点以后,打算自己试试看,就按照现在公司的项目需求,拿来练练手.需求如下: gruntProject 根目录下,有html页面,less文档夹,jssrc文档夹. less文档夹下,有一些公共的less文档,像 global.less , mixins.less , variables.less . 像index,buy,这些比较大的页面,会有一个文档夹,把它里面的每个版块分别写入一个less文档,而根目录下的index.less,则引入了index文档夹下的less文档. jssrc 文档夹下则是每个页面引入的js,至于jq等框架,则不在这个根目录下,在更外层,这里暂时不需要考虑. 我们的需求就是, 404.less , buy.less , index.less ,这些页面需要直接引用的less,是需要被编译成css,并且压缩的,压缩后输出在根目录的 css 文档夹下.而公共的less,则不需要编译,另外,less文档夹下的文档夹里的less文档,也是不需要编译并输出的.说白了就是,一个页面引入一个css,其它作为依赖被引入的less文档,都不需要编译.而js文档,每个都需要压缩,压缩后输出到js文档夹下. 这样,一共需要用到四个插件: 编译less的插件: grunt-contrib

How to generate CSS with loop in less

对着背影说爱祢 提交于 2019-11-28 19:11:36
I am not familiar with Less . In my understanding, I think Less can transform the less format file to standard css file(if I am wrong, please correct me). Now I have a question below. Say you would generate 100 CSS classes like below(from .span1 to .span100 ) in a single CSS file. I want to know whether less can generate a CSS file like it? ... .span5 { width: 5%; } .span4 { width: 4%; } .span3 { width: 3%; } .span2 { width: 2%; } .span1 { width: 1%; } Try this if you are using the latest version of LESS: @iterations: 5; .span-loop (@i) when (@i > 0) { .span-@{i} { width: ~"@{i}%"; } .span

How to compile Twitter Bootstrap 3.0 LESS using Asp.net MVC 5 and Web Essentials 2013

孤者浪人 提交于 2019-11-28 18:49:48
I've set up Visual Studio 2013 RC and Web Essentials 2013 . I'm trying to create an Azure Cloud Service and a Web Role using ASP.Net MVC 5 . Installed Twitter Bootstrap Less Source 3.0 and wanted to bundle all less files using Web Essentials 2013. I did not get any help or documentation on how to go about bundling bootstrap.less at run time or compile it into a bootstrap.css at design time. Any idea how it can be done? Is there any simpler way than BundleTransformer.Less . UPDATE (29-SEP-2015): Leave Web Essentials and use LESS Compiler along with its Clean CSS Plugin. Download and install

Height not 100% on Container Fluid even though html and body are

旧城冷巷雨未停 提交于 2019-11-28 18:44:01
I have the following layout (I'm using Meteor): <template name="headerFooter"> <div class="container-fluid fill-height"> {{> header}} {{> UI.contentBlock}} {{> footer}} </div> </template> <template name="home"> {{#headerFooter}} <div class="row body-film"> <div id="newsfeed" class="col-sm-offset-7 col-sm-5 block-film"> {{#each stories}} <div class="story">...</div> {{/each}} </div> </div> {{/headerFooter}} </template> and this (relevant) css backing it up: html { height: 100%; } body { min-height: 100% } .fill-height { height: 100%; } The html and body elements are both behaving as expected.

lessc binary not available after installing less via NPM

末鹿安然 提交于 2019-11-28 18:36:31
I went ahead and installed and tested node.js and then I installed LESS CSS via NPM but when I type in the command lessc styles.less or lessc styles.less > styles.css It tells me -bash: lessc: command not found I'm in MAC Lion Terminal program EDIT : After installing Node you need to run this command ln -s ~/.npm/less/1.2.1/package/bin/lessc (path to directory you want) Then you will be able to run less on any of the less files in that directory. It works but it's not compiling the imports into one CSS file. It just leaves the imports in the file as is. I was hoping I could combine all of the

Structuring CSS (SASS, LESS) files by elements, by function and by media queries: 3D code structure? [closed]

和自甴很熟 提交于 2019-11-28 18:24:16
Zero-D Everybody starts using CSS with a single file that contains all the styles. style.css 1D Soon it becomes bulky and one decides to group CSS in a number of files by page elements: html_elements.css header.css main-area.css footer.css Some may find this not convenient enough and group styles by function: typography.css layout.css sticky-footer.css (contains declarations for many elements, not footer only) 2D When a project has a lot of CSS, it might require using both groupings simultaneously. CSS files structure becomes two-dimensional: layout/ grid-system.css header.css sidebars.css

more命令、less命令、head命令、tail命令、tailf命令、cut命令

邮差的信 提交于 2019-11-28 18:15:31
more 显示长文件,可按回车(翻行)、空格(向下翻页)、b(向上翻页),q快速推出,v进入vi编辑模式,/查找指定文本 more -10 /etc/services定义每次按空格多显示10行 ls显示太多时,后面可接more less 命令 比more更强大 除包含more功能外,支持方向键上下, 显示行号:less -N /etc/services head命令 默认显示文件前10行 显示文件前5行head -5 /etc/services 或者 head -n 5 /etc/services 显示文件的前5个字节head -c 5 不显示最后10行 head -n -10 /etc/services head可接多个文件 tail命令 和head命令相反 tail -n 10 /etc/services显示文件最后十行 tail -f 文件 动态显示文件内容 tail -F 文件 如果文件不存在,可以继续等着文件生成 tailf命令类似tail -f -n 10 cut命令 切割文件和字符 字节输出 cut -b,切割中文可能会出现乱码,一个中文字符等同两个字节(ASCII编码)或者三个字节(UTF8编码) 字符切割 cut -c 指定分隔符 cut -d 默认tab作为分隔符需要和-f一起使用,-f用来指定区域,仅仅支持单个分隔符 cut -d : -f4-5 来源:

Reference a class/mixin without completely importing the LESS file

随声附和 提交于 2019-11-28 18:08:47
I'm using the roots theme for wordpress: https://github.com/retlehs/roots/ It already comes with a precompiled bootstrap.css and recommends to use app.css for any customizations. As I don't have the options to add the classes to the buttons via html or javascript, I'd like to use the LESS sources to reference a css class, for example, I want to give a submit button the bootstrap button style: input#submit{ .btn; .btn-primary; } If I use @import 'bootstrap.less'; it adds the entire bootstrap css into app.css. How can I just use the bootstrap.less as reference for compiling? The core question

项目主页工程搭建

浪尽此生 提交于 2019-11-28 18:08:16
---恢复内容开始--- 1.基础插件安装,less文件加载配置 安装基础插件 安装React-Router 、Axios yarn add react-router-dom axios less-loader(router是4.0版本) 安装antd yarn add antd 暴露webpack配置文件 yarn eject 安装less-loader 修改less-loader 2.x 中将webpack.config.dev.js 与 webpack.config.prod.js进行了合并,只有一个webpack.config.js yarn eject 只能用一次,用完即止,多出一些文件在目录里,我们要在config文件夹下的 webapck.config.js 里配置 新加less匹配项 copy 一份跟 sassRegex , sassModuleRegex 一样的声明即可: const lessRegex = /.less/ const lessModuleRegex = /.module.less$/ 在sass的配置下新增less配置 { test: lessRegex, exclude: lessModuleRegex, use: getStyleLoaders({ importLoaders: 2 }, 'less-loader'), }, { test: