less

Serving dynamic variables to a less file at runtime

风流意气都作罢 提交于 2019-12-11 07:31:52
问题 We have a large ASP.NET MVC application with a large amount of CSS, ~105 distinct files. These files are separated by component, which makes them easier to manage. At runtime, we minify/combine these using a handler. Additionally, our application utilizes skin settings; the administrator can customize fonts and colors for the site. Those skin settings are injected into CSS files using NVelocity, which although it's old is quite performant. I'd like to move the CSS to using less, which will

LESS: mixin to create Blink animation, passing @color -stops

别说谁变了你拦得住时间么 提交于 2019-12-11 07:15:40
问题 I wish to create a CSS animation that act like "Blink effect" using LESS. My purpose is to call a single mixin passing each time 2 @stop colors in order to get diffent color blink depending by css class of DOM element. Currently I have the following HTML: <p class='blink'> Loading... </p> <p class='blink alert'> <big>WARNING!!!! Operation failed.</big> </p> And here, LESS CODE: .blink { .animation-blink-mixin(@dark-green,@light-green); &.alert { .animation-blink-mixin(@dark-red,@light-red); }

CSS compilers and converting IE hacks to conditional css [closed]

浪尽此生 提交于 2019-12-11 07:09:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Skip to bottom for question, but first, a little context. So I have been looking into CSS compilers (like Sass & Less) for a while, and have been really interested in them, not because they help me understand anything easier (I've been doing css for a couple of years now) but rather they cut down on cruft and

LESS - Using a variable on a CSS class

社会主义新天地 提交于 2019-12-11 07:04:45
问题 This is a bit of a long shot, but I wondered if its possible to set a number as part of class and based on that number use it to set the height of the CSS HTML Example: <div class="div-height-100"></div> LESS Basic idea: .div-height-@var{ height: @height; } CSS Output: .div-height-100 { height: 100px; } The idea of this is due to having multiple empty-chart-loader DIVs all of which are different heights, and will save setting up a different CSS class for each height. Any help will be

How should I reset a less variable using its own value

爱⌒轻易说出口 提交于 2019-12-11 06:56:47
问题 I want to create a rgba from a color less variable and assign the result to the same variable, but I can't do this by the following code. @navbar-default-bg: rgba(red(@navbar-default-bg), green(@navbar-default-bg), blue(@navbar-default-bg), 0.9); 回答1: The above code would result in the following error being thrown on compilation: NameError: Recursive variable definition for @navbar-default-bg Recursive variable definitions won't work in Less because of the way Less does lazy loading of the

Installing SimpLESS in window 7 - “could not query info: Invalid HTTP Status Code (403)”

倾然丶 夕夏残阳落幕 提交于 2019-12-11 06:38:56
问题 I'm having problem of installing SimpLESS after downloaded from this website: http://wearekiss.com/simpless. I run from SimpLESS.exe and the error pop up was "could not query info: Invalid HTTP Status Code (403)" Is there any ideas on how to solve the problem? 回答1: My recommendation is to try again (perhaps both with the download and the execution). A 403 error is a reply back from the web server that it is refusing the request. I don't know if that was just a bug at the time you tried to

Lesscss Mixins with guards. Syntax Error

时光总嘲笑我的痴心妄想 提交于 2019-12-11 06:38:07
问题 I write my CSS with Lesscss using it on client side (with compiler less.js). There are good examples for guards usage in documentation, but it don't work for me. I can't understand, why... Code example goes here: @import "common-functions.less"; // variables @minHeaderWidth: auto; @maxHeaderWidth: 1200px; @minButtonsWidth: 50px; @maxButtonsWidth: 75px; // Mixins with guards .applyHeaderStyles(@headerWidth, @buttonsWidth) when (ispixel(@headerWidth)) { .my-headerElement { width: @headerWidth;

How to refer to two previous elements / tags / classes with LESS

安稳与你 提交于 2019-12-11 06:33:58
问题 I have this html markup: <figure class="about half"> <figcaption class="head_section"> <h3>About</h3> </figcaption> </figure> and this LESS set up: figure { //some style &.half { width: 48%; } figcaption { h3 { .about & & { // what i need to do but isn't working } } } &.about { h3 { // some style i have which is working } } } So, my question is how to refer two previus class of figure.about so as not to be out of style h3 . I hope that is clear... Much thx. 回答1: I'm still not sure I

LESS variable file not global

六眼飞鱼酱① 提交于 2019-12-11 06:32:14
问题 I use less-loader with webpack, the annoying part is I have to import the variable.less in every single of my module's less file. Why it can't be just global? 回答1: It's not clear from your question (can't tell if the problem you're having is something about your webpack setup), but if you're saying you have to do variables.less @var1: value1; @var2: value2; module1.less @import 'variables'; selectorA { propertyX: @var1 } module2.less @import 'variables'; selectorB { propertyY: @var2 } you can

Overwriting Twitter Bootstrap Less not working, adding new things does work

对着背影说爱祢 提交于 2019-12-11 06:28:47
问题 Twitter Bootstrap is ment to easily build on top of it. Now I'm experience a problem which I can not solve. I work with TB v. 2.3.2. In my own style.less file, I included TB: @import "../bootstrap/less/bootstrap.less"; In the original TB files, forms.less , this LESS can be found: // INPUT GROUPS // ------------ // Allow us to put symbols and text within the input field for a cleaner look .input-append, .input-prepend { display: inline-block; margin-bottom: @baseLineHeight / 2; vertical-align