less

Bootstrap components with alternate colors

☆樱花仙子☆ 提交于 2020-01-06 15:31:42
问题 Is there a recommended way to have 2 Bootstrap components with different color sets? For example, two nav-tabs, one in a dark theme, and another in a light theme. Preferably something like: <div class="dark"><ul class="nav nav-tabs"> ... </ul></div> <header>...</header> <div class="light"><ul class="nav nav-tabs"> ... </ul></div> But something like this might be fine: <ul class="dark-nav dark-nav-tabs"> ... </ul> <header>...</header> <ul class="dark-nav light-nav-tabs"> ... </ul> I would

Assets not loading in sails.js app

不打扰是莪最后的温柔 提交于 2020-01-06 14:48:32
问题 I moved from Arch Linux to Windows 7. I've installed nodejs, npm, sails, grunt. I created a new sails project with sails new <name> and started it with sails lift . My assets will be not compiled or injected by sails. .tmp/public does not exist, too. Maybe someone can help me out? 回答1: Check out this issue https://github.com/balderdashy/sails/issues/3013 Its probably that Grunt is defaulting to False, which means the grunt work flow is not building your assets or creating the public web

Less multiple parent usage

不羁的心 提交于 2020-01-06 12:45:51
问题 There is a something i've wondered. I am using less my project and i wonder is it possible to do something like; i want to do like this css result below; .dropdown-menu > li > a:hover, .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-submenu:hover > a, .dropdown-submenu:focus > a { text-decoration: none; color: #ffffff; background-color: #3DA857; background-image: -moz-linear-gradient(top, #3DA857, #3DA857); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(

LESS Mixins aren't available in other imported LESS files

北慕城南 提交于 2020-01-06 11:16:12
问题 I have this code: @import "vars.less"; // Desktop/Laptop Section @import "mixins-d-1.less"; @import "positioning.less"; @import "containers-d-1.less"; Inside containers-d-1.less I reference a mixin from mixins-d-1.less . However, I get an error saying that it's undefined. I'm able to pull my variables out of vars.less , why can't I pull my mixins out of mixins-d-1.less ? 回答1: The problem wasn't the importing at all, really. I made a mistake in how I was using media queries. Both files had the

Trouble outputting font property using less variables

*爱你&永不变心* 提交于 2020-01-06 08:25:09
问题 I'm using twitter bootstrap with less and I have the following: @serifFontFamily: 'Droid Serif', "Georgia", Times, serif; @baseFontSize: 100%/1.5; font: @baseFontSize @serfiFontFamily; it produces: font: 66.666666667% 'Droid Serif', "Georgia", Times, serif but I want to output this: font: 100%/1.5 'Droid Serif', "Georgia", Times, serif Any tips? 回答1: You can use @baseFontSize: ~"100%/1.5"; and less will interpret it as a string and not as an expression. 回答2: I had decomposed the property font

Change a single variable with less.js

南楼画角 提交于 2020-01-06 06:59:12
问题 I am trying to use less.js to make modifications to a less stylesheet for demonstration purposes. What I would like it to do is remember previous changes so I only have to send a single change each time for efficiency. Let's say I have the following: @PrimaryColor: #FFF; @SecondaryColor: #000; If I change one parameter, it works fine. less.modifyVars({ "@PrimaryColor": "#ff0000" }); The colors now look like this: @PrimaryColor: #ff0000; @SecondaryColor: #000; Now if I call the method again:

Less CSS: Can I call a mixin as an argument when calling another mixin?

爱⌒轻易说出口 提交于 2020-01-06 01:29:26
问题 I'm trying to call a mixin as an argument in another mixin but I get a syntax error. There's no variables in the offending mixin call, just arguments. I'm not sure if this is possible. The answers I've seen on here seem to be either hacks or to be dealing with variables and strings as arguments. Less CSS // color variables for user's color @userColor: #13acae; @darkUser: hsl(hue(@userColor), saturation(@userColor), lightness(tint(@userColor, 30%))); @lightUser: hsl(hue(@userColor), saturation

sails.js less livereload with grunt watch not working

不问归期 提交于 2020-01-05 09:07:08
问题 I got my less files compiled in css perfectly by grunt and I see result in .tmp/public/styles So now livereload with grunt-contrib-watch should be made naturally in sails generated project ? Or do I have to make a special configuration ? I found that in tasks/pipeline.js file but not sure of what to do. // CSS files to inject in order // // (if you're using LESS with the built-in default config, you'll want // to change `assets/styles/importer.less` instead.) var cssFilesToInject = [ 'styles/

Alter LESS Mixin when body class is present?

时光怂恿深爱的人放手 提交于 2020-01-05 08:32:49
问题 I have a LESS mixin. When a certain body class is present I want to alter one value of the mixin. .my-style() { font-weight: bold; color: red; } .my-style-altered() { color: blue; } .element { .my-style; } .body-class .element { .my-style-altered; } This is working fine. However my list of selectors is getting longer: .my-style() { font-weight: bold; color: red; } .my-style-altered() { color: blue; } .element, .element-2, .element-3 { .my-style; } .body-class .element, .body-class .element-2,

Alter LESS Mixin when body class is present?

独自空忆成欢 提交于 2020-01-05 08:32:12
问题 I have a LESS mixin. When a certain body class is present I want to alter one value of the mixin. .my-style() { font-weight: bold; color: red; } .my-style-altered() { color: blue; } .element { .my-style; } .body-class .element { .my-style-altered; } This is working fine. However my list of selectors is getting longer: .my-style() { font-weight: bold; color: red; } .my-style-altered() { color: blue; } .element, .element-2, .element-3 { .my-style; } .body-class .element, .body-class .element-2,