Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-15-2013, 04:40 PM   PM User | #1
moss2076
Regular Coder

 
Join Date: Oct 2005
Posts: 332
Thanks: 42
Thanked 2 Times in 2 Posts
moss2076 is an unknown quantity at this point
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
moss2076 is offline   Reply With Quote
Old 03-16-2013, 02:45 AM   PM User | #2
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
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
tracknut is offline   Reply With Quote
Old 03-16-2013, 08:15 PM   PM User | #3
moss2076
Regular Coder

 
Join Date: Oct 2005
Posts: 332
Thanks: 42
Thanked 2 Times in 2 Posts
moss2076 is an unknown quantity at this point
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.
moss2076 is offline   Reply With Quote
Old 03-17-2013, 02:26 AM   PM User | #4
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 892
Thanks: 4
Thanked 206 Times in 205 Posts
tracknut is an unknown quantity at this point
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
tracknut is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:52 PM.


Advertisement
Log in to turn off these ads.