I have a website with a client interface that has a directory, home page, contact page, page about us, etc. There is also a management interface. I would like to implement a kind of hierarchy where any elements inside an element with the class "admin" inherit the properties specified in the administrator stylesheet, and anything else inherits from the client stylesheet. The purpose of this is so that the administrator can log into the admin interface, where they have access to a lot of advanced materials, but they can also navigate to the client interface, where they can perform basic tasks (for example, hide directory entries, run script debugging if the client reports a problem, etc.). I would like all client-side admin tools to have properties taken from the admin stylesheet,not client-it will change the background color and so on.
Is there an easy way to customize the namespace to simplify the task, for example:
.admin {
.list {
.list-subtitle
{
}
.list-item
{
}
}
a
{
}
}
.customer
{
.list
{
.list-subtitle
{
}
.list-item
{
}
}
a
{
}
}
I know this could be like:
.admin .list {}
.admin .list .list-item {}
.admin a
I just don't want to put .admin all the time.
Does anyone have any suggestions on how I can do this? I suppose I could write a .net class that sets this and writes the stylesheet according to what fits in it, but then I could not read the styles, it’s so easy to add that everything will look like Classes.Add (blah) etc.
Thanks in advance for any answers ...
Hi,
Richard
<ul class="customer">
<li>Will appear as a customer control</li>
<li>Will appear as a customer control</li>
<li class="admin">Will appear as an admin control</li>
</ul>
<div class="customer">
<ul class="admin">
<li>Will appear as an admin control</li>
<li>Will appear as an admin control</li>
<li>Will appear as an admin control</li>
</ul>
</div>
, , , - "admin" "admin" , . , . , , , , .
CSS, - , - Less . ( , , , - , Less!).
,