How to write custom CSS/SCSS classes in Mendix 9?

0
I tried almost every document to write custom CSS in Mendix 9 project but still classes I am writing are not getting deployed. I have created my project in version 8.18 and now migrated to 9.4. Can someone please help. Thank you so much.
asked
3 answers
4

hi,

Refer these

https://docs.mendix.com/howto/front-end/customize-styling-new#previewing-styling

https://docs.mendix.com/releasenotes/studio-pro/9.0#theme-folder

answered
2

Hello Ankush,

 

I suppose you have tried this already but I’m gonna tell you anyway. Have you added your classes to the custom-variables.scss? In the ‘C:\...\Mendix\{projectname}\theme\web’ folder you have a file called “custom-variables.scss” or something like that, and it should be a long list of css variables. If you add a class (e.g. → .class {background: red;} at the end) you should be able to use that class in studio pro, by setting the class name in the properties of the item you want to apply that custom css to. If you want to add your custom css in a seperate file you can do that but you need to import the file into the “main.scss” file afterwards.

This is basically how to add custom css. Maybe check if your files are all in the right directory before deploying but it should work like this.

answered
1

Hi Ankush,

you can refer this, 

https://docs.mendix.com/howto8/front-end/calypso

answered