Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Posts
    336
    Thanks
    43
    Thanked 2 Times in 2 Posts

    How to compile LESS into a single CSS file with Joomla?

    Has anyone here used LESS to compile a single CSS file?

    Im using Joomla 3, and just cannot work it out after spending 3 days trawling through the internet and various websites Ive got nowhere with it.

    So if anyone is using Joomla and has compiled LESS into a CSS file in their own template can you let me know how its done!

    Cheers

    Tom

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,301
    Thanks
    10
    Thanked 283 Times in 282 Posts
    I use LESS, but just compile it as a separate task from anything else. I.e. you give Joomla a CSS file, it doesn't know about the LESS file. I'm not using Joomla, so it could be I'm missing a significant point here

    Dave

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Posts
    336
    Thanks
    43
    Thanked 2 Times in 2 Posts
    Thanks for replying, I have found the solution in the form of a Joomla extension plugin which compiles my template.less file into a template.css file when the index.php page is loaded. So that is working great, but leads me on to another question which you may be able to answer if you are already using Less....

    If I import specific LESS files (eg nav.less and footer.less - made up names here) by using the '@import' function in my template.less file, is the code from those files actually being added into my template.css file as it is compiled, or are these files merely being linked to my css file? Does that question make sense?

    Im asking because I havent actually tried it yet.

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,301
    Thanks
    10
    Thanked 283 Times in 282 Posts
    I don't know specifically, but it would seem it would have to do the import the .less file at the time it is being read in, which in you case is the run-time as a user launches your index.php page.

    To me, that's not a good long-term solution. Compiling your .less into .css every time someone browses your page is inefficient. It might be an easy method during debugging, but once the page is set, I'd get a final version of the css kicked out and remove references to .less from your code.

    Dave


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •