@import resolution

231 views
Skip to first unread message

jamie...@gmail.com

unread,
Apr 4, 2012, 11:32:41 AM4/4/12
to dot...@googlegroups.com
I'm hoping to use dotLess as part of my web resource server. I'm using the dotless.Core.Less.Parse method to transform files from LESS to CSS. This works fine except for @import, since I assume dotLess assume the paths are relative to the current application path - in this case, they aren't. My imports are scattered in a few directories, as defined by the web resource server. Is there a way to tell LESS where to look for @import files, preferably as a list of directories to search, or failing that a way to control the resolution of an import file path?

Thanks

Luke Page

unread,
Apr 4, 2012, 3:51:30 PM4/4/12
to dot...@googlegroups.com

1. Set the current directory
2. Override Importer and override the CurrentDirectory property.
3. As above but override the import function.. see the current implementation. This would allow you to search multiple locations.
4. Pop a full path on to the path list before parsing.. not near a computer to check exactly how to do this...

Lawrence Chang

unread,
Apr 17, 2012, 12:58:00 AM4/17/12
to DotLess (Less Css for .NET)
One elegant way would be to create an event/delegate inside the
importer module that allows hooking in a custom function to retrieve
the content of an imported file. This would allow DotLess to be used
with wide range of applications that don't always stores everything
under a local file structure. Any thoughts from the developers? Thanks!
Reply all
Reply to author
Forward
0 new messages