C S S V A R I A B L E S
This commit is contained in:
parent
26d17455dc
commit
5186ee9027
25 changed files with 50 additions and 38 deletions
|
@ -23,7 +23,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__entry {
|
&__entry {
|
||||||
color: inherit;
|
color: var(--user-colour);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
border: 1px solid var(--accent-colour);
|
border: 1px solid var(--accent-colour);
|
||||||
|
|
|
@ -49,7 +49,10 @@
|
||||||
&__datetime,
|
&__datetime,
|
||||||
&__user,
|
&__user,
|
||||||
&__action {
|
&__action {
|
||||||
color: inherit;
|
--action-colour: inherit;
|
||||||
|
|
||||||
|
background-color: var(--action-colour);
|
||||||
|
color: var(--user-colour);
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
margin-right: 1px;
|
margin-right: 1px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -170,6 +173,7 @@
|
||||||
&__action {
|
&__action {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 6px 2px;
|
padding: 6px 2px;
|
||||||
|
background-color: var(--accent-colour);
|
||||||
border-right: 1px solid var(--accent-colour);
|
border-right: 1px solid var(--accent-colour);
|
||||||
writing-mode: sideways-lr;
|
writing-mode: sideways-lr;
|
||||||
text-orientation: sideways;
|
text-orientation: sideways;
|
||||||
|
@ -234,6 +238,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
|
color: var(--user-colour);
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__user {
|
&__user {
|
||||||
|
color: var(--user-colour);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__user {
|
&__user {
|
||||||
|
color: var(--user-colour);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__username {
|
&__username {
|
||||||
|
color: var(--user-colour);
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
line-height: 1.7em;
|
line-height: 1.7em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
|
color: var(--user-colour);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
color: inherit;
|
color: var(--user-colour);
|
||||||
|
text-shadow: 0 0 5px var(--user-colour);
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
line-height: 1.4em;
|
line-height: 1.4em;
|
||||||
font-family: @mio-font-heading;
|
font-family: @mio-font-heading;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__link {
|
&__link {
|
||||||
color: inherit;
|
color: var(--user-colour);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__username {
|
&__username {
|
||||||
|
color: var(--user-colour);
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
|
@ -52,5 +52,10 @@
|
||||||
width: 50px;
|
width: 50px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__name {
|
||||||
|
color: var(--user-colour);
|
||||||
|
text-shadow: 0 0 5px var(--user-colour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__username {
|
&__username {
|
||||||
|
color: var(--user-colour);
|
||||||
|
text-shadow: 0 0 5px var(--user-colour);
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
|
color: var(--user-colour);
|
||||||
|
text-shadow: 0 0 5px var(--user-colour);
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
line-height: 1.4em;
|
line-height: 1.4em;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
--site-background-meta: no-repeat center / cover fixed;
|
--site-background-meta: no-repeat center / cover fixed;
|
||||||
--site-background-image: initial;
|
--site-background-image: initial;
|
||||||
|
|
||||||
|
--user-colour: inherit;
|
||||||
--accent-colour: @default-accent-colour;
|
--accent-colour: @default-accent-colour;
|
||||||
--text-colour: @default-text-colour;
|
--text-colour: @default-text-colour;
|
||||||
--text-colour-inverted: color(#fff - @default-text-colour);
|
--text-colour-inverted: color(#fff - @default-text-colour);
|
||||||
|
|
|
@ -58,10 +58,7 @@ function comments_parse_for_display(string $text): string
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<a href="/profile.php?u=%d" class="comment__mention", style="%s">@%s</a>',
|
'<a href="/profile.php?u=%d" class="comment__mention", style="%s">@%s</a>',
|
||||||
$info['user_id'],
|
$info['user_id'],
|
||||||
html_colour($info['user_colour'], [
|
html_colour($info['user_colour']),
|
||||||
'color' => '%s',
|
|
||||||
'text-shadow' => '0 0 5px %s',
|
|
||||||
]),
|
|
||||||
$info['username']
|
$info['username']
|
||||||
);
|
);
|
||||||
}, $text);
|
}, $text);
|
||||||
|
|
|
@ -50,17 +50,12 @@
|
||||||
|
|
||||||
<div class="header__user__info">
|
<div class="header__user__info">
|
||||||
{% if current_user is defined %}
|
{% if current_user is defined %}
|
||||||
<a href="/profile.php?u={{ current_user.user_id }}"
|
<a href="/profile.php?u={{ current_user.user_id }}" class="header__user__name"
|
||||||
class="header__user__name"
|
style="{{ current_user.user_colour|html_colour }}" title="{{ current_user.username }}">
|
||||||
style="{{ current_user.user_colour|html_colour({
|
|
||||||
'color': '%s',
|
|
||||||
'text-shadow': '0 0 5px %s',
|
|
||||||
}) }}" title="{{ current_user.username }}">
|
|
||||||
{{ current_user.username }}
|
{{ current_user.username }}
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="/auth.php?m=login"
|
<a href="/auth.php?m=login" class="header__user__name">
|
||||||
class="header__user__name">
|
|
||||||
Guest
|
Guest
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
{% if is_valid %}
|
{% if is_valid %}
|
||||||
<div class="changelog__change" id="#c{{ change.change_id }}">
|
<div class="changelog__change" id="#c{{ change.change_id }}">
|
||||||
<div class="changelog__change__line"
|
<div class="changelog__change__line"
|
||||||
style="{{ change.action_colour|html_colour({'border-color':'%s'}) }}">
|
style="{{ change.action_colour|html_colour('--accent-colour'}) }}">
|
||||||
<div class="changelog__change__action {{ change.action_class is defined and change.action_class is not null ? ' changelog__change__action--' ~ change.action_class : '' }} changelog__change__action--{{ change.action_colour|colour_get_css_contrast }}"
|
<div class="changelog__change__action {{ change.action_class is defined and change.action_class is not null ? ' changelog__change__action--' ~ change.action_class : '' }} changelog__change__action--{{ change.action_colour|colour_get_css_contrast }}"
|
||||||
style="{{ change.action_colour|html_colour({'background-color':'%s','border-color':'%s'}) }}">
|
style="{{ change.action_colour|html_colour('--accent-colour') }}">
|
||||||
{{ change.action_name }}
|
{{ change.action_name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
<a class="changelog__action{{ change.action_class is defined and change.action_class is not null ? ' changelog__action--' ~ change.action_class : '' }} changelog__action--{{ change.action_colour|colour_get_css_contrast }}"
|
<a class="changelog__action{{ change.action_class is defined and change.action_class is not null ? ' changelog__action--' ~ change.action_class : '' }} changelog__action--{{ change.action_colour|colour_get_css_contrast }}"
|
||||||
href="{{ change_url|format(change.change_id) }}"
|
href="{{ change_url|format(change.change_id) }}"
|
||||||
{% if change.action_colour is defined %}style="{{ change.action_colour|html_colour({'background-color':'%s'}) }}"{% endif %}>
|
{% if change.action_colour is defined %}style="{{ change.action_colour|html_colour('--action-colour') }}"{% endif %}>
|
||||||
<div class="changelog__action__text">
|
<div class="changelog__action__text">
|
||||||
{{ change.action_name|default('Unknown') }}
|
{{ change.action_name|default('Unknown') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -98,8 +98,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="forum__listing__entry__activity__info">
|
<div class="forum__listing__entry__activity__info">
|
||||||
{% if forum.recent_post_user_id is not null %}
|
{% if forum.recent_post_user_id is not null %}
|
||||||
by <a
|
by <a href="/profile.php?u={{ forum.recent_post_user_id }}"
|
||||||
href="/profile.php?u={{ forum.recent_post_user_id }}"
|
|
||||||
style="{{ forum.recent_post_user_colour|html_colour }}"
|
style="{{ forum.recent_post_user_colour|html_colour }}"
|
||||||
class="forum__listing__entry__activity__user">{{ forum.recent_post_username }}</a>,
|
class="forum__listing__entry__activity__user">{{ forum.recent_post_username }}</a>,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<form action="?v=action{{ edit_action is defined ? '&a=' ~ edit_action.action_id : '' }}" method="post">
|
<form action="?v=action{{ edit_action is defined ? '&a=' ~ edit_action.action_id : '' }}" method="post">
|
||||||
<h1 class="container__title">
|
<h1 class="container__title">
|
||||||
{% if edit_action is defined %}
|
{% if edit_action is defined %}
|
||||||
Editing <span style="{{ edit_action.action_colour|html_colour }}">{{ edit_action.action_name }}</span> ({{ edit_action.action_id }})
|
Editing <span style="{{ edit_action.action_colour|html_colour }};color:var(--user-colour)">{{ edit_action.action_name }}</span> ({{ edit_action.action_id }})
|
||||||
{% else %}
|
{% else %}
|
||||||
Adding a new action
|
Adding a new action
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<div class="changelog-actions-tags__list">
|
<div class="changelog-actions-tags__list">
|
||||||
{% for action in changelog_actions %}
|
{% for action in changelog_actions %}
|
||||||
<a href="?v=action&a={{ action.action_id }}" class="changelog-actions-tags__entry"
|
<a href="?v=action&a={{ action.action_id }}" class="changelog-actions-tags__entry"
|
||||||
style="{{ action.action_colour|html_colour({'border-color':'%s'}) }}">
|
style="{{ action.action_colour|html_colour('border-color') }}">
|
||||||
<div class="listing__entry__content changelog-tags__content">
|
<div class="listing__entry__content changelog-tags__content">
|
||||||
<div class="changelog-tags__text">
|
<div class="changelog-tags__text">
|
||||||
{{ action.action_name }} ({{ action.action_count }})
|
{{ action.action_name }} ({{ action.action_count }})
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<div class="usercard__container">
|
<div class="usercard__container">
|
||||||
<div class="avatar usercard__avatar"
|
<div class="avatar usercard__avatar"
|
||||||
style="{{ role.role_colour|html_colour({'background-color':'%s'}) }}">
|
style="{{ role.role_colour|html_colour('background-color') }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="usercard__content">
|
<div class="usercard__content">
|
||||||
|
|
|
@ -13,10 +13,7 @@
|
||||||
{% if post.user_id is not null %}
|
{% if post.user_id is not null %}
|
||||||
<a class="news__preview__user" href="/profile.php?u={{ post.user_id }}">
|
<a class="news__preview__user" href="/profile.php?u={{ post.user_id }}">
|
||||||
<div class="avatar news__preview__user__avatar" style="background-image:url('/profile.php?u={{ post.user_id }}&m=avatar')"></div>
|
<div class="avatar news__preview__user__avatar" style="background-image:url('/profile.php?u={{ post.user_id }}&m=avatar')"></div>
|
||||||
<div class="news__preview__user__name" style="{{ post.user_colour|html_colour({
|
<div class="news__preview__user__name" style="{{ post.user_colour|html_colour }}">
|
||||||
'color': '%s',
|
|
||||||
'text-shadow': '0 0 5px %s',
|
|
||||||
}) }}">
|
|
||||||
{{ post.username }}
|
{{ post.username }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -3,10 +3,7 @@
|
||||||
<div class="avatar avatar--new profile__header__avatar" style="background-image:url('{{ image }}')"></div>
|
<div class="avatar avatar--new profile__header__avatar" style="background-image:url('{{ image }}')"></div>
|
||||||
|
|
||||||
<div class="profile__header__details__content">
|
<div class="profile__header__details__content">
|
||||||
<div class="profile__header__username" style="{{ profile.user_colour|html_colour({
|
<div class="profile__header__username" style="{{ profile.user_colour|html_colour }}">
|
||||||
'color': '%s',
|
|
||||||
'text-shadow': '0 0 5px %s',
|
|
||||||
}) }}">
|
|
||||||
{{ profile.username }}
|
{{ profile.username }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,7 @@
|
||||||
|
|
||||||
<div class="usercard__details">
|
<div class="usercard__details">
|
||||||
<div class="usercard__name"
|
<div class="usercard__name"
|
||||||
{% if user.user_colour is defined %}style="{{ user.user_colour|html_colour({
|
{% if user.user_colour is defined %}style="{{ user.user_colour|html_colour }}"{% endif %}>
|
||||||
'color': '%s',
|
|
||||||
'text-shadow': '0 0 5px %s',
|
|
||||||
}) }}"{% endif %}>
|
|
||||||
{{ user.username }}
|
{{ user.username }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
13
utility.php
13
utility.php
|
@ -346,12 +346,21 @@ function html_link(string $url, ?string $content = null, $attributes = []): stri
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_colour(?int $colour, array $attribs = []): string
|
function html_colour(?int $colour, $attribs = '--user-colour'): string
|
||||||
{
|
{
|
||||||
$colour = $colour ?? colour_none();
|
$colour = $colour ?? colour_none();
|
||||||
|
|
||||||
|
if (is_string($attribs)) {
|
||||||
|
$attribs = [
|
||||||
|
$attribs => '%s',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
if (!$attribs) {
|
if (!$attribs) {
|
||||||
$attribs['color'] = '%s';
|
$attribs = [
|
||||||
|
'color' => '%s',
|
||||||
|
'--user-colour' => '%s',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$css = '';
|
$css = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue