less

webpack笔记

帅比萌擦擦* 提交于 2019-12-04 02:17:27
webpack的卸载 webpack4.x开始官方文档是说要单独安装webpack-cli所以如果是用4.+就需要卸载cli //删除全局webpack-cli 卸载uninstall可以简写成un,全局-g的完整写法是--global npm uninstall -g webpack-cli //删除本地(局部)webpack-cli npm uninstall webpack-cli //删除全局webpack npm uninstall -g webpack //删除本地webpack npm un webpack webpack的安装与使用 在空文件夹pratice下执行: //全局安装,默认最新版本,可以使用@指定版本 npm install webpack -g //可以使用cnpm淘宝镜像,这样速度更快 npm install -g cnpm --registry=https://registry.npm.taobao.org //用cnpm来安装。速度较快 cnpm install webpack -g //在3版本及之前安装webpack的时候就一同把webpack-cli也下载了,但是webpack4开始需要手动安装webpack-cli //安装webpack-cli cnpm install webpack-cli -g //查看版本号 webpack -v

What is the most effective method to change color for multiple similar elements in LESS?

你。 提交于 2019-12-04 02:04:19
问题 I have a collection of li , each with different background colors like these: &.menu-white { background-color: @product-white; color: darken(@product-white, 20%); } &.menu-green { background-color: @product-green; color: darken(@product-green, 20%); } &.menu-yellow { background-color: @product-yellow; color: darken(@product-yellow, 20%); } &.menu-black { background-color: @product-black; color: lighten(@product-black, 20%); } &.menu-red { background-color: @product-red; color: darken(@product

less undefined method error

六月ゝ 毕业季﹏ 提交于 2019-12-04 01:56:05
问题 I have the following less compile error. My less is below not sure what is causing this. undefined_methodError: error evaluating function `darken`: Object #<Object> has no method 'toHSL' in /Users/anderskitson/Sites/mrskitson.ca/wp-content/themes/wordpress-bootstrap/library/less/variables.less:164:34 163 @navbarBackground: "../images/nav.png"; 164 @navbarBorder: darken(@navbarBackground, 12%); 165 (This action was triggered by a change to navbar.less) Less File @navbarBackground: "../images

Sprites LESS CSS Variable increment issue

白昼怎懂夜的黑 提交于 2019-12-04 01:49:07
问题 I have a problem with sprites background position calculation using a variable: My code looks something like this: @counter: 1; #my-icon-bundle { .my-icons () { #my-icon-bundle .myIconX("classX1", @counter); #my-icon-bundle .myIconX("classYY1", @counter); ... } .myIconX(@name, @index) { @nameText: ~".my-icon-@{name}"; @{nameText} { #my-icon-bundle .myIcon(@index); } @counter: @index + 1; } .myIcon(@row) { @x: some calculations based on @row @y: some calculations based on @row background

Running LESS server-side vs. client-side

徘徊边缘 提交于 2019-12-04 00:33:28
What are the advantages / disadvantages to running the LESS framework client-side vs. server-side? Does page load time take a hit if you run it client-side? Quentin On the server, you have to take more care with your cache control headers and you sacrifice a bit of CPU power. On the client, it breaks if JS isn't available. (For your production systems,) do it at build time and just serve up static CSS. That's efficient and reliable. Using ASP.NET MVC 4.0 Bundling you can use: var bundle = new StyleBundle("~/Content/style").Include( "~/Content/myStyles.less"); bundle.Transforms.Add(new

Is there any way to get another element value in Less?

会有一股神秘感。 提交于 2019-12-04 00:29:55
I'm new to Less . In my script, I'd like to use the width of box1 in box2 . Please review my script. #box1 { width: 1000px; height: 500px; } #box2 { width: #box1.width - 100px; } Is it possible or not? If yes, please give me correct Less code. unfortunatly it is indeed not possible. You could work with variables and do something like this however: @box1width: 1000px; #box1 { width: @box1width; height: 500px; } #box2 { width: @box1width - 100; } No, that's not possible. LESS processes the style sheet to produce CSS, and it doesn't have any knowledge of the elements in the page. What you are

What is the best Approach for CSS framework of an Enterprise Cloud application?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 00:18:34
There are several ways to style the elements in each page, in Enterprise applications usually the CSS Framework size increased about 1 MB, and when your users are using slow internet connection, you should decrease css framework size. we can create new CSS for our element like .Blah and value it in css framework and do this for each element which cause increase size of css framework, but a cleaner page <div id="blah" class="blah"></div> we can also use our css framework utilities in each view to format each element to keep size of css framework, but a non-clean page <div id="blah" class=

Combining multiple “transform” entries in Less

旧时模样 提交于 2019-12-03 23:01:13
I have two mixins which both convert to -webkit-transform : .rotate(@deg) { -webkit-transform: rotate(@deg); } .scale(@factor) { -webkit-transform: scale(@factor); } When I use them together: div { .rotate(15deg); .scale(2); } ... they (as expected) show up as: div { -webkit-transform: rotate(15deg); -webkit-transform: scale(2); } This doesn't seem to be valid CSS as the second has precedence over the first; the first is discarded. To combine transform entries it should be: -webkit-transform: rotate(15deg) scale(2); How can I accomplish such CSS to be generated by LESS, i.e. multiple transform

LESS linear gradient mixin

倖福魔咒の 提交于 2019-12-03 21:57:41
I use a mixin for linear-gradient like this: .linear-gradient (@color1:#ccc, @color2:#fff, @stop1:0, @stop2:100%, @dir:top) { background-color: @color2; background: -webkit-linear-gradient(@dir, @color1 @stop1, @color2 @stop2); background: -moz-linear-gradient(@dir, @color1 @stop1, @color2 @stop2); background: -ms-linear-gradient(@dir, @color1 @stop1, @color2 @stop2); background: -o-linear-gradient(@dir, @color1 @stop1, @color2 @stop2); background: linear-gradient(@dir, @color1 @stop1, @color2 @stop2); filter: e(% ("progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=%d

unnoticeable lesscss compiler in eclipse pdt

こ雲淡風輕ζ 提交于 2019-12-03 21:43:37
I want to use a less compiler like dotless as eclipse builder. If I set the build option "Run the builder:" to "During auto builds", every 5-10 sec the builder is runing (thats ok) but it also ask me to save, instead of ignoring the unsaved files. As workaround I activate the workspace-option "Save automatically before build" and bind Ctrl+S to "build all" Is there a better solution? gossi To automatically transpile LESS to CSS in Eclipse, I explain two possible ways. Using a Plugin How to do it manually (I edited this post after I wrote the plugin, so the manual way is the old way, that the