[theme] add data-userclass to body tag
This commit is contained in:
parent
ef3492e9b5
commit
74fd48a0f2
2 changed files with 14 additions and 1 deletions
|
@ -532,15 +532,21 @@ class BasePage
|
||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
global $config, $user;
|
||||||
|
|
||||||
$head = $this->head_html();
|
$head = $this->head_html();
|
||||||
$body = $this->body_html();
|
$body = $this->body_html();
|
||||||
|
|
||||||
|
$body_attrs = [
|
||||||
|
"data-userclass" => $user->class->name,
|
||||||
|
];
|
||||||
|
|
||||||
print emptyHTML(
|
print emptyHTML(
|
||||||
rawHTML("<!doctype html>"),
|
rawHTML("<!doctype html>"),
|
||||||
HTML(
|
HTML(
|
||||||
["lang" => "en"],
|
["lang" => "en"],
|
||||||
HEAD(rawHTML($head)),
|
HEAD(rawHTML($head)),
|
||||||
BODY(rawHTML($body))
|
BODY($body_attrs, rawHTML($body))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,3 +217,10 @@ ARTICLE TABLE {
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 2px 2px 6px rgba(0,0,0,0.6);
|
box-shadow: 2px 2px 6px rgba(0,0,0,0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// example of how to apply specific styles to specific thumbs for specific userclasses
|
||||||
|
/*
|
||||||
|
BODY[data-userclass="anonymous"] .thumb[data-rating="e"] IMG {
|
||||||
|
filter: blur(5px);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
Reference in a new issue