Jahia Dev Forum > Import LESS CSS...

1 (1 Good)
0 (0 Bad)

Import LESS CSS in Jahia

by  ahmadyounis »  2012/10/03 12:31

How to import a LESS CSS file ( example : styles.less ) into jahia??

http://www.lesscss.org/

 

<link rel="stylesheet/less" type="text/css" href="styles.less">
<script src="less.js" type="text/javascript"></script>

This is is not working.

 

  (ahmadyounis)

Number of messages  4
Registration date
0 (0 Good)
0 (0 Bad)

Re: Import LESS CSS in Jahia

by  faissah »  2012/10/12 21:23

Hi,

Have you tried using our JSTL syntax to add ressources?

    <template:addResources type="javascript" resources="less.js"/>

And including less.js in the javascript folder of your module/jahiapps

Regards,

Fabrice
 

Fabrice  (faissah)

Number of messages  262
Registration date
0 (0 Good)
0 (0 Bad)

Re: Re: Import LESS CSS in Jahia

by  ahmadyounis »  2012/10/15 07:41

Hi

 

I have tried this:

 

<template:addResources type="css" resources="styles.less"/>
<template:addResources type="javascript" resources="less.js"/>

 

but importing styles.less  will generate this:

<link rel="stylesheet" type="text/css" href="styles.less">

and in fact we nedd this:

<link rel="stylesheet/less" type="text/css" href="styles.less">

  (ahmadyounis)

Number of messages  4
Registration date
0 (0 Good)
0 (0 Bad)

Re : Re: Re: Import LESS CSS in Jahia

by  fmarchon »  2013/10/22 07:05

Hi

 

You could do a mix of both:

1. for the CSS, just let it the same

<link rel="stylesheet/less" type="text/css" href="styles.less">

2. for the javascript:

<template:addResources type="javascript" resources="less.js"/>

 

For the CSS, it would not be minified or aggregate by Jahia in live mode.

 

Regards,

Fabrice

  (fmarchon)

Number of messages  1
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page