That question is not small at all. You want role/user dependent CSS, so you have two options:
Option 1) load the CSS dynamically using a call to require pointing to the correct file, via a javascript snippet:
Code:
var user = dashboard.context.user;
var cssFiles = {
"default": "default.css",
"alice": "alice.css",
"bob": "bob.css"
};
var cssFileToLoad = cssFiles[user] || cssFiles["default"];
require(['css!./' + cssFiletoLoad], function(){});
Option 2) Inject some css class in the 'body' element and create specific css:
Add the javascript snippet:
Code:
var user = dashboard.context.user;
var cssClasses = {
"alice": "user-alice",
"bob": "user-bob"
};
$('body').addClass(cssClasses[user]);
and any CSS overrides:
Code:
.user-alice table {
background: pink;
}
.user-bob table {
background: blue;
}
I would go for Option 2.