Using @import with relative path and dotless.Core.Less.Parse
See original GitHub issueIn our system we have a scenario where we need to use…
dotless.Core.Less.Parse(LESSInputAsString, config)
The problem here is that if LESSInputAsString
contains a @import
statement we need to force dotLESS to look for these imports relative to a specific folder.
Each “template” in our system generates it’s own supporting files directory and this is where any additional .less files would be kept. We need to point dotLESS to this folder and have it look there (or at least start there for relative paths) when using @import
Issue Analytics
- State:
- Created 12 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
c# - Parse of '@import (less)' statement raises ...
NET MVC 5 Project with dotLess 1.4.1. Attempt to use @import (less) statement inside of a simple less file, that only imports a...
Read more >Resolving relative paths for @import and @insert directives ...
I just committed a new version that sets the current workingdirectory to the file's path so all imports are relative to the .less...
Read more >Setup dotLess CSS In ASP.NET MVC Project
In this article you will learn how to create and setup dotLess ... Add your .less file to your project and reference that...
Read more >Adding LESS support to the ASP.NET Optimization Framework
We now need to create an IPathResolver implementation that can convert both absolute and relative paths into virtual paths. This is necessary ...
Read more >LESS - Quick Guide
It is used to import the contents of the LESS or CSS files. Example. The following example demonstrates the use of importing in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I think it should be configurable, so keep this bug open.
If all your less files are stored in the database you could create your own virtual file system accessor like the unit tests do - then less wouldn’t have to access the file system at all.
Might it be possible to get some example syntax for how one would use this CurrentDirectory configuration option? I have no problem sub-classing and overriding the method, but I’m not sure what to do with my resulting IImporter object so I eventually build up to an object with a Parse method that gives me back a string. :S