1 Reply Latest reply on Mar 15, 2013 9:59 AM by craigdowney

    Image paths with LESS in CQ 5.5?

    craigdowney Level 1

      I'm working with LESS in CQ 5.5 and running into an issue with background images. A relative url "url(images/bg.png)" gets compiled in the generated css to "apps/myapp/components/mycomponent/clientlib/css/images/bg.png". This means that the final browser request ends up looking for an image at "apps/myapp/components/mycomponent/apps/myapp/components/mycomponent/clientlib/css/images/bg.png". This appears to be a bug, has anyone run into this issue and found a fix or workaround?

        • 1. Re: Image paths with LESS in CQ 5.5?
          craigdowney Level 1

          For anyone who is interested, I found a work around. The url needs to be escaped. url("images/bg.png") becomes url(~"clientlib/css/images/bg.png"). Or if you want to define an image path variable:

           

          @image_path: ~"clientlib/css/images/"

           

          then: url(~"@{image_path}bg.png")

           

          Note the double escape tildas or it won't work.

           

          -Craig