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.

 

  • Import LESS CSS in Jahia
    2013/01/02 09:49

    ahmadyounis <p> How to import a LESS CSS file ( example : styles.less ) into jahia??</p> <p> <a href="http://lesscss.org/">http://www.lesscss.org/</a></p> <p> &nbsp;</p> <div> &lt;link rel=&quot;stylesheet/less&quot; type=&quot;text/css&quot; href=&quot;styles.less&quot;&gt;</div> <div> &lt;script src=&quot;less.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div> <p> This is is not working.</p> <p> &nbsp;</p>

  • Number of messages  4
    Registration date Oct 3, 2012
    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  264
    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">

  • Re: Re: Import LESS CSS in Jahia
    2012/10/15 07:41

    ahmadyounis <p> Hi</p> <p> &nbsp;</p> <p> I have tried this:</p> <p> &nbsp;</p> <div id="content"> <div class="chat in"> <div class="msg Nth"> &lt;template:addResources type=&quot;css&quot; resources=&quot;styles.less&quot;/&gt;</div> <div id="insert"> &lt;template:addResources type=&quot;javascript&quot; resources=&quot;less.js&quot;/&gt;</div> </div> </div> <p> &nbsp;</p> <p> but importing&nbsp;<span style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">styles.less </span>&nbsp;will generate this:</p> <p> <span style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">&lt;link rel=&quot;</span><span style="color:#ff0000;"><span style="font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">stylesheet</span></span><span style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">&quot; type=&quot;text/css&quot; href=&quot;styles.less&quot;&gt;</span></p> <p> and in fact we nedd this:</p> <p> <span style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">&lt;link rel=&quot;</span><span style="color:#ff0000;"><span style="font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">stylesheet/less</span></span><span style="color: rgb(102, 102, 102); font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; font-size: 12.727272033691406px; line-height: 18.015151977539063px; ">&quot; type=&quot;text/css&quot; href=&quot;styles.less&quot;&gt;</span></p>

  • Number of messages  4
    Registration date Oct 15, 2012
    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