Custom CSS file does not exist!

2
I have tried to add some custom css styles to my project. There should be a custom css file in the theme folder of the project. However I could not find  that file. I have tried to create a new custom css file but it did not worked when i added some css classes and run the application. As a solution  I included my css classes inside the main css file which is not recommended but worked properly. I am using Mendix Studio Pro 8.8.1. What could be the location of the custom css file? Or what could be the best solution to generate  custom css classes for my project?
asked
2 answers
5

Hi Hasan,

It not recommended to add styling the main CSS. This will give you trouble upgrading to newer version of Atlas themes in the future.

If you want to add a new CSS file, you have to reference this in  <projectfolder>/theme/settings.json

Include here the relative path, for example

"cssFiles": [
   "styles/web/css/main.css",
    "styles/web/css/my-custom-file.css"
],

And work with SASS you can use Calyso https://docs.mendix.com/howto/front-end/calypso#1-introduction for compiling.

Cheers, Andries

 

answered
2

The best option is to use sass. See your theme folder /theme/styles/web/sass

See this tutorial: https://docs.mendix.com/howto/front-end/style-with-gulp-and-sass#1-introduction

answered