less

Less mixin with optional parameters

大憨熊 提交于 2019-11-27 03:14:29
问题 I have a Less mixin defined as: .fontStyle(@family, @size, @weight: normal, @style: normal, @color: #ffffff, @letter-spacing: normal) { font-family: @family; font-size: @size; color: @color; font-weight: @weight; font-style: @style; letter-spacing: @letter-spacing; } How can I define usage like: .fontStyle('NimbusSansNovCon-Reg', 12px, , , , 0.1em); I.E. use the defaults for @weight , @style , @color 回答1: To supply a parameter that far down the string of arguments, you have to also supply the

Can't get less.js to work

自作多情 提交于 2019-11-27 03:10:42
问题 I can't get less.js to work and I have no idea why. Heres the HTML i tried: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8" /> <!-- CSS --> <link rel="stylesheet/less" href="main.less" /> <!-- Javascript --> <!-- <script src="http://lesscss.googlecode.com/files/less-1.0.18.min.js"></script> --> <script src="less-1.0.18.min.js" type="text/javascript"></script> </head> <body> <p> Lorum ipsum </p> </body> </html> And heres main.less: p { color: blue; } The less-1.0.18.min.js file

How to set keyframes name in LESS

喜欢而已 提交于 2019-11-27 02:37:48
问题 I try to set up this LESS mixin for CSS animation keyframes: .keyframes(@name, @from, @to) {; @-webkit-keyframes "@name" { from { @from; } to { @to; } } } but there is some problem with name pharse, is there any option to do this corectly? 回答1: As of LESS >= 1.7 you can use variables for keyframe keywords (names). Some changes have been made in LESS 1.7 to how directives work, which allows to use variables for the name/keyword of @keyframes (so the example from the question should work now).

VUE—使用vue框架时怎么使用less写css样式(图文详情)

人走茶凉 提交于 2019-11-27 02:37:35
VUE—less依赖 第一步:输入指令: mac要加上sudo sudo cnpm install less less-loader --D 第二步:修改webpack.base.conf.js文件,配置loader加载依赖,让其支持外部的less 在原来的代码上添加 { test: /\.less$/, loader: "style-loader!css-loader!less-loader" } 第三步:在static新建js文件夹引入rem.js文件并在index.html里直接script引入即可 这是rem的内容,适用于移动端响应式布局 (function () { var PixelRatio = 1/window.devicePixelRatio; var oHtml = document.getElementsByTagName('html')[0]; var pageWidth = 0; document.write('<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale='+PixelRatio+',maximum-scale='+ PixelRatio +', minimum-scale='+ PixelRatio +'" />'); pageWidth

Vue报错* !!vue-style-loader!css-loader?和you can run: npm install --save !!vue-style-loader!css-loader

妖精的绣舞 提交于 2019-11-27 02:36:43
Vue报错 ERROR Failed to compile with 1 errors 11:17:27 This dependency was not found: * !!vue-style-loader!css-loader?{"sourceMap":true}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-331f341c","scoped":true,"hasInlineConfig":false}!less-loader?{"sourceMap":true}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./Index.vue in ./src/components/Index.vue To install it, you can run: npm install --save !!vue-style-loader!css-loader?{"sourceMap":true}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-331f341c","scoped":true,

PHPStorm: How do I setup LESS to output to CSS directory with file watcher?

那年仲夏 提交于 2019-11-27 02:12:25
问题 How do, using File Watchers in PHPStorm do I set up LESS file watchers output path to do this: I want: /project/path/less/dir/file.less to output to: /project/path/css/dir/file.css or /project/path/less/file2.less to output to: /project/path/css/file2.css I'm not seeing a clear way to make this happen with the Output Path macros in PHPstorm. With the FileDirRelativeToProjectRoot macro, I'm able to get the path to the current directory, but there is no clear way to replace /less with /css in

Variable Name Error “is undefined” even though “variables.less” imported

北慕城南 提交于 2019-11-27 01:27:07
问题 I started using LESS today. But it's kinda weird. This code does not work. I get an error: ! Variable Name Error: @linkColor in a is undefined. My bootstrap: @import "variables.less"; @import "normalize.less"; variables.less: @linkColor: #08c; @linkColorHover: darken(@linkColor, 15%); normalize.less: a { color: @linkColor; } a:visited { color: @linkColor; } a:hover { color: @linkColorHover; } When I make an @import "variables.less" in the normalize.less file, everything works fine. Thanks for

How do you create multiple box-shadow values in LESS CSS

狂风中的少年 提交于 2019-11-27 01:13:47
问题 Read This There are several "correct" answers . Since this question gets a lot of traffic, I figured I should keep up with what (I think) the best answer is (based on the LESS documentation) as the LESS project matures, and change my accepted answer accordingly. I'm using LESS and I haven't been able to find a fix for allowing multiple CSS3 box-shadows. I have the following mixin: .box-shadow(@arguments) { -webkit-box-shadow: @arguments; -moz-box-shadow: @arguments; box-shadow: @arguments; }

LESS CSS Pass mixin as a parameter to another mixin

风流意气都作罢 提交于 2019-11-27 01:08:46
问题 Is there any way to pass one mixin or style's declaration to another mixin as an input parameter? Let's take a look at an example with animation keyframes. Following is how we define keyframes in pure CSS: @-moz-keyframes some-name { from { color: red; } to { color: blue; } } @-webkit-keyframes some-name { from { color: red; } to { color: blue; } } @keyframes some-name { from { color: red; } to { color: blue; } } Idea is to simplify these declarations using mixins, so we can have something

How to use bootstrap with 16 or 24 columns

a 夏天 提交于 2019-11-27 01:02:54
I need some help setting bootstrap 2.0.4 to be 16 or 24 column instead of the default 12 columns i can't understand what am i doing wrong i tried the customize option on the bootstrap site and i tried changing the grid variables in the variables.less file and recompile bootstrap.less using Crunch but for both trials i still have the same result .it is still 12 columns !!! when i try to set a div to be span12 it still takes the whole screen ? Can anyone guide me to what's wrong i am doing or if someone can generate a 16 and 24 columns versions and send them to me that would be perfect Hasan