Compile Less to CSS

Adrià Gual asked on July 8, 2022 12:00


I'm using Kentico 13 .NET Core MVC and currently I'm trying to make some changes in Site.less and Menu.less files located in wwwroot/Content/Styles.

In the _Layout.cshtml view, by default, Kentico is loading all the generated CSS of Site.css which includes at the same time all the imports less files.

The problem is: my changes are not being displayed because Kentico is never compiling the changes I do in less files. I assume somehow I must be able to force it, but how? Or what will be the correct way to do changes? Directly in Site.css makes no sense I guess.

Thank you. Regards.

Recent Answers

Brenden Kehren answered on July 8, 2022 15:41

These are things you'll have to do or add in using either some front-end dev tools or use the .NET bundling features. This is NOT a Kentico Xperience specific "thing".

However, Xperience does do some bundling for your widgets as you can see here in the documentation, but it does not do ALL of your main site styles and scripts.

0 votesVote for this answer Mark as a Correct answer

Adrià Gual answered on July 11, 2022 09:57

Thanks for your answer Brenden.

As long as I read, .NET Core have already installed Gulp by default and DancingGoat project has Gruntfile.js file in the root of the project with some tasks there.

Could be possible that expanding this file would be the correct solution for it?


0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 11, 2022 13:34

As far as I'm aware, ,Net Core does NOT have Gulp installed by default. Yes, you could extend the Grunt file if you'd like from the Dancing Goat sample site

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.