Base solution for your next web application
Open Closed

Editing LESS files #391


User avatar
0
ideutsch created

Hello. Is there a recommended way to go about editing the .less files in App/common/views? It seems like the .less files aren't automatically compiling to css in both release and debug modes. Is editing these less files not supported by the framework?


8 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    It's related to Visual Studio rather than the framework. Which VS versiyon are you using? In VS2013, Web Essentials extension automatically compiles it. In VS2015, Web Essentials less support is dropped. But there is another extension "Web Compiler" (<a class="postlink" href="https://github.com/madskristensen/WebCompiler">https://github.com/madskristensen/WebCompiler</a>) does it. I'm using it for VS2015.

  • User Avatar
    0
    dparizek created

    Maybe add a note about this to tutorials??

    Adding more keywords - styles, css not added, less not included, styling, style not showing

    <cite>hikalkan: </cite> Hi,

    It's related to Visual Studio rather than the framework. Which VS versiyon are you using? In VS2013, Web Essentials extension automatically compiles it. In VS2015, Web Essentials less support is dropped. But there is another extension "Web Compiler" (<a class="postlink" href="https://github.com/madskristensen/WebCompiler">https://github.com/madskristensen/WebCompiler</a>) does it. I'm using it for VS2015.

  • User Avatar
    0
    dparizek created

    So if we are using VS2015, and install web compiler, less files automagically taken care of?

    Are there any docs on how to mod the CSS where for what? and how that fits into the build system? That is all a VS extensions thing, not part of ABP correct?

    In the tutorial I add the less file to make the People Delete and Edit buttons float right, but those styles never get included. Adding just a .css file does not get included either. I assume then nothing is automatically scanning for those files and then adding references somewhere. So I need to add a reference somewhere?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can take a look at WebCompiler's home page. They have a short explanation about the tool.

    Compile on build option might be good for you. <a class="postlink" href="https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebCompiler">https://marketplace.visualstudio.com/it ... ebCompiler</a>

  • User Avatar
    0
    dparizek created

    I can get the file to compile fine.

    I just cannot get it to show up on the site. Like it is not getting included somehow. But that should be happening automatically, right?

    From docs: "All scripts and styles in the App folder (and subfolders) are bundled (see AppBundleConfig class). Any scripts and styles that you place there will be automatically added to the layout."

    This is still correct right?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Is your project MPA or SPA ? If it's a SPA, it should work like you said but if it's a MPA, then you need to add your css file to your cshtml file. Just like in this one <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-samples/blob/master/PhoneBook-MPA/Acme.PhoneBook.Web/Areas/Mpa/Views/PhoneBook/Index.cshtml">https://github.com/aspnetzero/aspnet-ze ... dex.cshtml</a>

  • User Avatar
    0
    dparizek created

    SPA. and works fine now. I had stupid bug on my part, sorry.

  • User Avatar
    0
    ismcagdas created
    Support Team

    No problem, I'm glad that it's working :)