Is it possible to do conditional styling of a page depending on an attribute like User Profile?

0
I want to add CSS changes on a navigation list on a page based on which usertype(admin/user etc) is currently logged in the system. Please help if this is posisble. Thank you.
asked
2 answers
0

I think this blog can help you out, the same functionality can be applied to user-roles. On login / startup make a a helper entity and apply a style based on the helper attributes!

 

How to implement dark mode in your apps

 

It could also be possible to do it in pure css based on the class Daan above here gave.

So something like this:

.profile-desktop {
         .yournavigation-class {
              your:properties;
         }
}

 

answered
0

Hi Sohil,

 

Mendix adds a class to the HTML body based on the userrole of the user:

So any CSS specific for a certain userrole can be prefixed by:

body.role-userroleX {
//Userrole specific CSS
}

Hope this helps!

answered