less

Overriding class definitions with Less

旧城冷巷雨未停 提交于 2019-12-25 01:49:40
问题 I'm trying to customize a Joomla template, which is based on Bootstrap. Specifically, I'm trying to make a "hardcoded" .span4 have the width of a .span3. Sure, it would be much easier to change the markup, but I think that's what css is for, despite the way most of us use Bootstrap for defining layout and visual appearance. Besides, where would be the fun of learning? For that, this is what I'm trying in the my_css.less provided with the template: .row-fluid #top1.span4 { .row-fluid .span(3);

How to replace the deprecated javascriptEnabled option in less-loader with a new plugin

你离开我真会死。 提交于 2019-12-24 22:04:20
问题 I need to use inline js for my less files, and previously had a webpack config with something like this to enable inline js: module.exports = { ... module: { ... rules: [ ... { test: /\.less$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'less-loader', options: { javascriptEnabled: true }, }, ], }, ], }, }; However the javascriptEnabled option has been deprecated and the replacement for this is to use the @plugin syntax and use a js plugin. However, I am a bit

LESS: Nested Import In Class

ⅰ亾dé卋堺 提交于 2019-12-24 19:35:58
问题 I got a lot of less files that are imported into one main less file. That main file has some different variables containing hex-color. e.g: @black: #333; @green: #007f4b; ... @import "layout"; @import "html"; ... Is it possbile to do some thing with this base? e.g: @black: #333; @green: #007f4b; @import: "layout"; @import: "html"; .fanshop { @black: #111; @green: green; @import: "layout"; @import: "html"; } The result should look like: .headline { background-color: #333; } .fanshop .headline

How to detect and print changing variables LESS

怎甘沉沦 提交于 2019-12-24 17:57:40
问题 I want to create a simple script that changes LESS variables and print the CSS output in a div. this is my HTML <input type="text" id="choose-color" onchange="ModifyColorsInLess()"> <button onclick="writeCSS()">aggiorna</button> <div id="lesscode"></div> This is my js function writeCSS(){ var lessCode = ''; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function(){ if(xmlhttp.status === 200 && xmlhttp.readyState === 4){ lessCode = xmlhttp.responseText; new(less.Parser)()

Document Level Less

流过昼夜 提交于 2019-12-24 17:10:46
问题 I am working on a project for school and wanted to use the less library. I tried something like <link rel="stylesheet/less" type="text/css" href="style.less"> but this didn't work, I got the error XMLHttpRequest cannot load file:/// [..] /style.less. Cross origin requests are only supported for HTTP. Meaning I basically need to run a server for this implementation. However, since this is supposed to be a stand-alone project for a non-technical class, running a server is out of the question.

lessc using Ruby instead of Javascript

北慕城南 提交于 2019-12-24 17:07:51
问题 I am using lessc to compile my css in a node application. LESS was installed via NPM. Currently the output of lessc --version is lessc 1.3.3 (LESS Compiler) [Ruby] 2.3.2 How do I get it to say lessc 1.3.0 (LESS Compiler) [Javascript] in order to compile my css? 回答1: I've discovered the issue. I had the Rubygem version of less installed, and it was overriding the NPM installation of less. Uninstalling the gem allowed the NPM version of less to run when compiling less. 来源: https://stackoverflow

How to enable syntax highlighting for embedded LESS styles in WebStorm?

痞子三分冷 提交于 2019-12-24 16:33:50
问题 I am using Vue.js for one of my frontend projects. As you know, Vue comes with special syntax for components - each component can be declared in a single .vue file . That means, that you can define all related stuff in a single file like this: <tamplate> ...component template goes here... </template> <script> ...component code goes here... </script> <style> ...component style goes here... </style> Of course vue support in various IDEs isn't perfect yet. Vue is relatively young framework, but

Have 2 classes as parent selectors at different levels in Less?

╄→гoц情女王★ 提交于 2019-12-24 15:40:09
问题 I need this CSS: .class-1.class-a .target { background: red; } .class-1.class-b .target { background: blue; } I've got this working fine with this Less .target { .class-1.class-a & { background: red; } .class-1.class-b & { background: blue; } } However can my LESS be written more succinctly? Its seems a shame to write class-1 twice. I've tried this: .target { .class-1 & { &.class-a { background: red; } &.class-b { background: blue; } } } And also this: .target { .class-1 & { .class-a & {

Remove space when LESS variable value to string

一曲冷凌霜 提交于 2019-12-24 14:43:30
问题 Below is example less mixin code .mixin(@option) { .set(@options) when (@options = a){ @type: linear; } .set(@option); background: -webkit-~'@{type}'-gradient(...); } The output background: -webkit- linear -gradient(...); How can i remove the space around linear ? 回答1: Less does not support an inplace concatenation via variable interpolation in value statements. You need a temporary variable for this (+ an auxiliary variable in this particular case to handle parens), e.g.: @end-func: ~')';

Selecting a web page look and feel without reloading, with one CSS [closed]

夙愿已清 提交于 2019-12-24 14:08:05
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . The problem I need to redesign CSS structure of an existing web application. It supports "branding" — it's got 5 different look-and