Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

LESS with CQ

Avatar

Level 2

Is it possible to change the version of LESS CQ uses?  I have read in certain places that it isn't but was wondering if anybody has figured out a workaround for this?  Currently I can't get Twitter Bootstrap 3.0 in LESS to compile with the version of LESS used in CQ.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I significantly doubt if what you're asking is easy or even possible.

However, you could use an alternative approach if you're using Maven to build your projects. We've used a setup where the Maven build compiles the LESS files into CSS, before putting them into CRX as part of the clientlib. So our clientlib is defined to use CSS files that don't technically exist until compilation, then Maven creates them. Both the LESS and CSS files are deployed to CRX, but the LESS files are really only there for informational purposes.

The drawback is that you can't make ad hoc changes to the LESS files within CRXDE (that isn't your primary IDE is it?), but I've found this limitation quite easy to work around. I really like this setup, because it gives you a bit more flexibility in how your app compiles and it works around a few other limitations of CQ's built-in LESS compilation.

View solution in original post

2 Replies

Avatar

Former Community Member

rogerblanton87 wrote...

Is it possible to change the version of LESS CQ uses?  I have read in certain places that it isn't but was wondering if anybody has figured out a workaround for this?  Currently I can't get Twitter Bootstrap 3.0 in LESS to compile with the version of LESS used in CQ.

 

We've got Bootstrap 3.0 compiling in 5.6.1, but yes - the ClientLib system seems extremely unflexible.

Everything is possible if you're willing to bring a java decompiler to the party, but it's not something I'd recommend for a production environment.

Avatar

Correct answer by
Former Community Member

I significantly doubt if what you're asking is easy or even possible.

However, you could use an alternative approach if you're using Maven to build your projects. We've used a setup where the Maven build compiles the LESS files into CSS, before putting them into CRX as part of the clientlib. So our clientlib is defined to use CSS files that don't technically exist until compilation, then Maven creates them. Both the LESS and CSS files are deployed to CRX, but the LESS files are really only there for informational purposes.

The drawback is that you can't make ad hoc changes to the LESS files within CRXDE (that isn't your primary IDE is it?), but I've found this limitation quite easy to work around. I really like this setup, because it gives you a bit more flexibility in how your app compiles and it works around a few other limitations of CQ's built-in LESS compilation.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----