0

I have been trying to figure out how to make this happen but i could not find the right thing to connect to the group of people.

The information i have until now is that i have ID for each group of people, but don't know how to use it to referred the change to those users in this group.

Also it could also be a connection between the leader of the group, but could not find this connection.

  • So, you will have a number of users with different permissions, say if you are building a website for school, permissions will be principal, teacher, student, other_faculities, etc. So you have the ID of each group of people and when a user login, you can check that id and find the group which the particular user belongs in, right ? So based on that id, add a class to the root element(body), and based on that class, you can switch theme,(background, color, font etc). It will be really easy if you are using scss. Happy coding – Abin Thaha Sep 29 '21 at 15:03

2 Answers2

1

So, as per my comment, consider you have a number of permission, you have the id of permissions and you can differentiate the logged in used based on that.

So based on the id, you can add a class name to the root element, in my sample, I added the class teacher to body, so the background-color will be green and color will be white.

Instead of that, you can try other classes also, like principal, student etc, so you can change the theme as required.

body {
  background-color: red;
  color: #000;
}
body.principal {
  background-color: yellow;
}

body.teacher {
  background-color: green;
}
body.student {
  background-color: white;
  color: #fff;
}
<body class="teacher">
  <h2>Welcome User</h2>
  <section>
    Content
  </section>
</body>
Abin Thaha
  • 4,493
  • 3
  • 13
  • 41
0

Add to your <body> element a class like group-idOfGroup and then create specific CSS rules for that class:

.group-idOfGroup div p{
    color:red;
}