Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Jul 26, 2013 @ 14:15
    Matt Barlow | jacker.io
    0

    .Less + Clientdependency + Bootstrap - MVC

    My umbraco site is MVC, I have Bootstrap.less files, and have put in place .dotlesscss dll and included the references to the handler in my web.config

    <remove name="DotLessCss" />
    <add name="DotLessCss" verb="*" path="*.less" type="dotless.Core.LessCssHttpHandler, dotless.Core" preCondition="integratedMode" />

     

    Then in my Config folder - clientdependency.config I added:

    <clientDependency version="1" fileDependencyExtensions=".js,.css,.less">

    And in my view I have:

    @using ClientDependency.Core.Mvc
    @{
        Layout = null;
        Html.RequiresCss("/less/responsive.less");
        Html.RequiresCss("~/less/bootstrap.less");
    }
    @Html.Raw(Html.RenderJsHere())

     

    This all works fine, when debug is off, but when it's on the clientdependency kicks in and breaks the styling.. it's like the .less files aren't compiled when going via client dependency.

    Any ideas on this? Anyone got this working?

  • wolulcmit 357 posts 693 karma points
    Jul 26, 2013 @ 14:37
    wolulcmit
    100

    have you added the ClientDependency.Less.dll to your project?
    I think you can install it directly using NuGet

    PM> Install-Package ClientDependency-Less

    I got is working with Sass but there was an issue with the sass compiler they are using and the particular framework I wanted to use (should be fixed soon)
    https://github.com/Shandem/ClientDependency/issues/12

    I'm pretty sure .less will work out of the box.

    another alternative to try is the Optimus package, which has .less and .sass support.
    http://our.umbraco.org/projects/developer-tools/optimus

    I'm holding out for client dependency myself.

    - Tim

  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Jul 26, 2013 @ 17:00
    Matt Barlow | jacker.io
    0

    You my friend, are the man!

    Thanks, I installed that and installed the dependency-mvc package.

    I also removed ".less" from the clientdependency config, and hey presto it works!

    M

  • wolulcmit 357 posts 693 karma points
    Jul 26, 2013 @ 17:02
    wolulcmit
    1

    haha! so glad I could help

    - Tim

Please Sign in or register to post replies

Write your reply to:

Draft