less

How to compile .less files on save in Visual Studio 2015 (preview)

心已入冬 提交于 2019-12-02 16:34:00
Ok, so I've created a new ASP.Net 5 / MVC 6 project in Visual Studio 2015 Preview. In keeping with our current method of doing things, for styling I want to use .less files. Creating the files is straightforward, but Web Essentials no longer compiles them. So my question is this: what precisely do I need to do to get my .css files generated when I save the .less files? Based on my adventures getting Typescript to work nicely, I will have to use Grunt to accomplish this task, but I am brand-new to Grunt and so I'm not sure how one would do it? Please help! With VS 2015 Web Essential is split

Less CSS归纳总结

匿名 (未验证) 提交于 2019-12-02 16:28:20
前言 最近使用angualr开发一个应用,但是因为这个应用样式风格经常性的改动,在设计之初和同事讨论采用皮肤方式进行设计,便于对应用UI管理.那么我选择了Less进行样式编写。我的同事因为是一个纯后端,所以它对Less不怎么了解,问我Less是什么?为啥要用Less?所以我今天就记录一下,让更多想了解Less同学能够通过我的表述获得一些收获。 什么是Less? LESS是一个CSS预处理器,可以为网站启用可自定义,可管理和可重用的样式表。 LESS是一种 动态样式表语言 ,扩展了CSS的功能。 LESS也是跨浏览器友好。CSS预处理器是一种脚本语言,可扩展CSS并将其编译为常规CSS语法,以便可以通过Web浏览器读取。 它提供诸如变量,函数, mixins 和操作等功能,可以构建动态CSS。 为什么用Less? Less支持创建更简洁,跨浏览器友好的CSS更快更容易。 Less是用JavaScript设计的,并且创建在 live 中使用,其编译速度比其他CSS预处理器更快。 Less保持你的代码以模块化的方式,这是非常重要的,通过使其可读性和容易改变。 可以通过使用LESS 变量来实现更快的维护。 备注:Less 2009年被设计,第一版是用Ruby编写的,后来被JavaScript代替。 Less CSS对CSS的扩展,使得其可以创建更加简洁友好、可重用性高的样式

Is there a way to use variables in Less for the ~ operator, like ~“calc(100% - @spacing)”;

别等时光非礼了梦想. 提交于 2019-12-02 16:05:26
Is there a way to use variables in less ~ operator, like ~"calc(70% - @spacing)"; When I have tried it it only works with static values like ~"calc(70% - 10px)"; Can I get the string to be evaluated prior to beeing set as a property. To disable the calculation which LESS does automatically when discovering a - between two numeric values but still being able to use variables, you can write one of the following: 1) Only escape the operator that triggers the calculation and use the variable like you normally do @padding: 20px; body { padding: calc(100% ~"-" @padding); } 2) Escape the whole

Generating vendor prefixes in LESS

拜拜、爱过 提交于 2019-12-02 16:03:00
问题 I've pieced together this approach for generating vendor-prefixed properties and animations using LESS. First some factory functions: .vendorprefix (@property, @value) { -webkit-@{property}: @value; -moz-@{property}: @value; -ms-@{property}: @value; -o-@{property}: @value; @{property}: @value; } .keyframes(@name; @animation) { @animation(); @-webkit-keyframes @name { .frames(-webkit-) } @-moz-keyframes @name { .frames(-moz-) } @-o-keyframes @name { .frames(-o-) } @keyframes @name { .frames(~'

changing css class variables

。_饼干妹妹 提交于 2019-12-02 15:50:44
问题 I am looking at less.js, mixin looks like the way touching the variable in css but i am not sure if my problem is solvable using less.js. I want to make some class with parameter, e.g. with the format marginTop-10 or marginTop(15) 10,15 are some numbers which i can change to specify the margin top pixel, basically these numbers can be any number.and i will use these class in my paragraph class such as <p class="marginTop(some number)">css help</p> How can i make this happen? 回答1: You should

LESS CSS on Windows

帅比萌擦擦* 提交于 2019-12-02 15:48:25
Trying to set up LESS for CSS on my Windows box, I've installed ruby and rubygems and followed the instructions exactly. I have put teststyle.less in C:\ . When I type lessc teststyle.less to compile it into a .css file, I get an error: The filename, directory name, or volume label syntax is incorrect. Out of those familiar with LESS, do any of you have a solution to my problem? Did I mess up the install? If you don't want to use GUI to compile LESS on Windows, there is a clean way to get lessc command on Windows command line. It only requires you to install node.js, which is required by

Less Compiler for Linux [closed]

只愿长相守 提交于 2019-12-02 15:46:58
Is there a something like less.app that can compile LESS into CSS? I don't care about a GUI and don't want to install it via NPM (node.js package manager.) Xaerxess Although using node.js version is recommended , you can install less as ruby gem: sudo apt-get install rubygems1.8 ruby1.8-dev sudo gem install rubygems-update sudo gem update rubygems sudo gem install less and than use lessc which is in /var/lib/gems/1.8/bin/lessc , so you may want to create symlink: sudo ln -s /var/lib/gems/1.8/bin/lessc /usr/bin/ or add ruby gems dir to PATH variable: export PATH=/var/lib/gems/1.8/bin:$PATH EDIT

Sublime Text wrap selection with snippet

别等时光非礼了梦想. 提交于 2019-12-02 15:29:49
I've been digging into Sublime's snippets, plugins and macros, but I can't seem to find what I'm looking for. I'm trying to turn this: .content { color: @blue; } Into this: .content { color: darken(@blue, 5%); } Ideally, I'd be able to select the @blue part, hit a command, and wrap the whole thing properly. Any ideas? Is this even possible? Sergey Telshevsky As can be seen here : Tools -> New Snippet... -> save as darken.sublime-snippet in Data\Packages\User\ <snippet> <content><![CDATA[darken($SELECTION, 5%);]]></content> <!-- Optional: Tab trigger to activate the snippet --> <tabTrigger

webpack---less 热更新 使用

时间秒杀一切 提交于 2019-12-02 15:21:45
  最近尝试用less写界面,webpack进行打包,然后发现每次修改less时都需要重新执行webpack打包一下,于是就想到了webpack热更新这个功能。 一、使用less   less是一门css预处理语言,它是拓展了css,增加了变量,Mixin等等。使用less需要安装less服务,less-loader用来打包时用,想要将less正确解析成css当然还需要style-loader和css-loader。loader是webpack重要的功能之一,通过使用不同的loader,webpack可以使用外部脚本或工具处理不同格式类型的文件,如通过less-loader处".less"文件。 首先安装: npm install less --save-dev npm install style-loader css-loader less-loader --save-dev webpack.config.js配置: module: { rules: [{ test: /\.less$/ , use: [ 'style-loader', 'css-loader', 'less-loader' ] }] } 然后将.less文件加载到入口文件里,如在入口文件里import '../less/topHead.less';这样就可以执行webpack把.less文件进行打包了。 二

小程序中实时将less编译成wxss

▼魔方 西西 提交于 2019-12-02 15:05:16
1、npm或者yarn全局安装wxss-cli npm install -g wxss-cli 2、运行wxss-cli命令( pages为小程序页面目录) wxss .\pages\ 实时监听pages目录下的.css或者.less文件,转化为.wxss文件   .css或者.less文件可使用less语法   less转wxss文件不可逆 来源: https://www.cnblogs.com/cornell/p/11751431.html