I would like to use my @variable (@variable: "file.less") to import file.less into main.less.
I tried this way:
@var: 'file.less'; @import @var
or as follows:
@import "@var"
or
@import "@{var}"
but that will not work.
Any ideas?
@imports are processed before @variables, so it will not work.
Check out the beta for LESS 1.4.0. It should be able to handle variables in @import statements.
https://github.com/cloudhead/less.js/issues/410
// An example from the issue for this feature: @theme: winter; @import "@{theme}/theme.less";
Beta is available for node through:
npm install -g less@beta
Or for the browser at https://github.com/cloudhead/less.js/blob/master/dist/less-1.4.0-beta.js
What about:
@import url(@var);
?
No, this does not work.
Source: https://habr.com/ru/post/927913/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/927908/how-i-can-increase-the-touch-area-for-controls-togglebutton&usg=ALkJrhg3ej2M7SkBgXti7cVU5w6_ZWnVeAHow to avoid explicit type signatures here? - haskellError setting contact synchronization (ASP.NET) in tridion - tridionAnd in freemarker - freemarkerRegex in javascript - match string like "ABC12" - javascriptHow to find out the correct encoding when I call BaseFont.createFont () with itext? - fontsshould i use setDaemon () in android? - androidShould I use Disruptor (LMAX) with a large model in memory and CQRS? - javaWhat hooks do we have to complete the workflow when the application exits - androidWhy is MAX () 100 times slower than ORDER BY ... LIMIT 1? - performanceAll Articles