[TWIG][CSS] Accessibility improvements, all general links provide proper feedback now. Base theme CSS progress, page now looks more as it should. Panels WIP.

This commit is contained in:
Eliseu Amaro 2021-07-21 19:21:48 +01:00 committed by Hugo Sales
parent 98e7e94dfa
commit c06e666816
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 115 additions and 33 deletions

View File

@ -26,6 +26,7 @@
--accent-green: #2EC4B6; --accent-green: #2EC4B6;
--shadow: 0px 0px 16px 0px #383E51; --shadow: 0px 0px 16px 0px #383E51;
--shadow-light: 0px 0px 16px 0px #8E8DBE;
} }
/* TYPOGRAPHY */ /* TYPOGRAPHY */
@ -64,7 +65,7 @@ h3 {
p { p {
font-family: var(--main-font); font-family: var(--main-font);
font-size: var(--small-size); font-size: var(--medium-size);
font-weight: 400; font-weight: 400;
letter-spacing: -0.30px; letter-spacing: -0.30px;
word-spacing: -0.10px; word-spacing: -0.10px;
@ -85,25 +86,31 @@ li {
a:link { a:link {
text-decoration: none; text-decoration: none;
color: var(--white);
outline: 0; outline: 0;
color: var(--bg3);
} }
a:visited { a:visited {
text-decoration: none;
color: var(--white);
outline: 0; outline: 0;
color: var(--bg3);
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
a:focus,
a:hover { a:hover,
color: var(--accent-blue); a:active {
border-radius: var(--unit-size);
padding: 0 var(--unit-size) 0 var(--unit-size);
background: var(--white);
color: var(--bg1) !important;
transition: all 0.8s ease; transition: all 0.8s ease;
} }
a:focus { hr {
color: var(--accent-blue); color: var(--bg3);
transition: all 0.8s ease; border-radius: var(--main-size);
margin-bottom: var(--main-size);
} }
/* DEFAULTS */ /* DEFAULTS */
@ -114,6 +121,7 @@ html {
height: 100%; height: 100%;
width: auto; width: auto;
color: var(--white); color: var(--white);
font-family: var(--main-font);
/* BLENDING BANDING IN FIREFOX */ /* BLENDING BANDING IN FIREFOX */
background-image: radial-gradient(ellipse at 50% 5%, var(--bg1), var(--bg2)), background-image: radial-gradient(ellipse at 50% 5%, var(--bg1), var(--bg2)),
@ -133,7 +141,7 @@ html {
height: calc(5 * var(--unit-size)); height: calc(5 * var(--unit-size));
padding: var(--small-size); padding: var(--small-size);
background-image: radial-gradient(ellipse at 50% 5%, var(--bg1), var(--bg3)), background-image: radial-gradient(ellipse at 50% 5%, var(--bg1), var(--accent-blue)),
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAElBMVEUAAACUkpSEhoSMioyMjoyEgoRr6djFAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAU1JREFUKJEVUcl1xTAIpAVLSgECXIAYUoCAX0Bi919LlCPLm5ValiOUUe2+ZRVFuYpKXFsUX9aIp0V6GtC8VRhNL0X2fikvswhKrNDhes7pbpPkufFAtI0B76LEjfc2bgdHDk6RX4A/sjt6LCylfoYpNYYJx/9COhIugsjluzN9VGZ/Hnl51jIH2ba+Ywsy2RJCFdoDe8Obw61TXGAv+ewExMRJs7gd7YcimPuk42uMqY2VJ1fK+bDL32rb7kwok/la/u7Mrz7Xf0DTssSP2Btp1ZS0zw35tM/SsJKgWNLcRh+/th1QqntwtM3Tx0LNosoBYbM3qjJFiMeLsMH2i5BcQdU3n9sJHOE1Hoqn1GA/bm4s0YkVB/y4r0PbltF32FpljXmdlOOwbDvFWkoDYLppSG4pnM6UxX3Src1lhXeU36FOu3o+R2vNaHME/wESUl9/3zMniwAAAABJRU5ErkJggg==); url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAElBMVEUAAACUkpSEhoSMioyMjoyEgoRr6djFAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAU1JREFUKJEVUcl1xTAIpAVLSgECXIAYUoCAX0Bi919LlCPLm5ValiOUUe2+ZRVFuYpKXFsUX9aIp0V6GtC8VRhNL0X2fikvswhKrNDhes7pbpPkufFAtI0B76LEjfc2bgdHDk6RX4A/sjt6LCylfoYpNYYJx/9COhIugsjluzN9VGZ/Hnl51jIH2ba+Ywsy2RJCFdoDe8Obw61TXGAv+ewExMRJs7gd7YcimPuk42uMqY2VJ1fK+bDL32rb7kwok/la/u7Mrz7Xf0DTssSP2Btp1ZS0zw35tM/SsJKgWNLcRh+/th1QqntwtM3Tx0LNosoBYbM3qjJFiMeLsMH2i5BcQdU3n9sJHOE1Hoqn1GA/bm4s0YkVB/y4r0PbltF32FpljXmdlOOwbDvFWkoDYLppSG4pnM6UxX3Src1lhXeU36FOu3o+R2vNaHME/wESUl9/3zMniwAAAABJRU5ErkJggg==);
background-blend-mode: multiply; background-blend-mode: multiply;
background-attachment: fixed; background-attachment: fixed;
@ -179,6 +187,89 @@ html {
padding: var(--small-size); padding: var(--small-size);
} }
/* NAVIGATION */
.navigation {
display: flex;
flex-direction: column;
width: 100%;
text-align: center;
}
.navigation nav {
padding: var(--small-size);
background: radial-gradient(ellipse at 50% 100%, var(--bg1), transparent 35%);
}
.navigation a {
font-family: var(--display-font);
font-size: var(--main-size);
color: var(--accent-blue);
}
.active {
color: var(--white) !important;
}
.sec-nav ul {
display: flex;
justify-content: space-around;
padding-left: 20%;
padding-right: 20%;
}
.sec-nav a {
font-size: var(--medium-size);
}
/* NOTES */
.notes {
margin-top: var(--main-size);
}
.note {
background-image: radial-gradient(ellipse at 10% 10%, var(--bg3), var(--accent-blue)),
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAElBMVEUAAACUkpSEhoSMioyMjoyEgoRr6djFAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAU1JREFUKJEVUcl1xTAIpAVLSgECXIAYUoCAX0Bi919LlCPLm5ValiOUUe2+ZRVFuYpKXFsUX9aIp0V6GtC8VRhNL0X2fikvswhKrNDhes7pbpPkufFAtI0B76LEjfc2bgdHDk6RX4A/sjt6LCylfoYpNYYJx/9COhIugsjluzN9VGZ/Hnl51jIH2ba+Ywsy2RJCFdoDe8Obw61TXGAv+ewExMRJs7gd7YcimPuk42uMqY2VJ1fK+bDL32rb7kwok/la/u7Mrz7Xf0DTssSP2Btp1ZS0zw35tM/SsJKgWNLcRh+/th1QqntwtM3Tx0LNosoBYbM3qjJFiMeLsMH2i5BcQdU3n9sJHOE1Hoqn1GA/bm4s0YkVB/y4r0PbltF32FpljXmdlOOwbDvFWkoDYLppSG4pnM6UxX3Src1lhXeU36FOu3o+R2vNaHME/wESUl9/3zMniwAAAABJRU5ErkJggg==);
background-blend-mode: multiply;
border-radius: var(--unit-size);
}
.note-info {
display: flex;
border-radius: var(--unit-size);
box-sizing: border-box;
background-color: #00000022;
font-size: var(--main-size);
padding: var(--unit-size);
}
.note-info .avatar {
width: var(--main-size);
height: auto;
}
.note-content {
padding: var(--small-size);
}
.note-content p {
font-size: var(--medium-size);
padding-left: var(--small-size);
padding-right: var(--small-size);
}
.note-attachments {
display: flex;
}
.note-attachments > div {
margin: var(--small-size) 0 0 0;
border-radius: var(--unit-size);
background-color: #00000033;
}
.note-attachments > div figure {
margin: 0;
padding: var(--small-size);
}
figcaption a:link {
font-size: var(--small-size);
color: var(--white);
}
/* EVERY SIDE PANEL DETAIL ELEMENT */ /* EVERY SIDE PANEL DETAIL ELEMENT */
.panel { .panel {
all: unset; all: unset;
@ -189,11 +280,7 @@ html {
height: 100%; height: 100%;
} }
/* /* ANIMATIONS */
[data-foo]::before {
open: attr(data-foo) "close";
}
*/
.content { .content {
animation: fadeIn 200ms cubic-bezier(0, 0.55, 0.45, 1); animation: fadeIn 200ms cubic-bezier(0, 0.55, 0.45, 1);
} }
@ -214,14 +301,10 @@ details[open] > div {
} }
} }
/* SIDE PANELS OPEN BY DEFAULT ON DESKTOP */ /* MEDIA QUERIES */
@media (min-width: 900px) { @media (min-width: 900px) {
.panel-mobile {
display: none;
}
} }
@media (max-width: 900px) { @media (max-width: 900px) {
.panel-desktop {
display: none;
}
} }

View File

@ -27,7 +27,7 @@
<ul> <ul>
<li> <li>
<a href="{{ path('main_public') }}" <a href="{{ path('main_public') }}"
class='hover-effect {{ active('main_public', 'main_all', "home_all") }}'>Timeline</a> class='{{ active('main_public', 'main_all', "home_all") }}'>Timeline</a>
</li> </li>
</ul> </ul>
</nav> </nav>
@ -36,12 +36,12 @@
<ul> <ul>
<li> <li>
<a href="{{ path('main_public') }}" <a href="{{ path('main_public') }}"
class='hover-effect {{ active('main_public') }}'>Public</a> class='{{ active('main_public') }}'>Public</a>
</li> </li>
{% if user_nickname is defined %} {% if user_nickname is defined %}
<li> <li>
<a href="{{ path("home_all", {'nickname' : user_nickname}) }}" <a href="{{ path("home_all", {'nickname' : user_nickname}) }}"
class='hover-effect {{ active("home_all") }}'>Home</a> class='{{ active("home_all") }}'>Home</a>
</li> </li>
{% endif %} {% endif %}
<li> <li>
@ -51,7 +51,7 @@
{% for tab in main_nav_tabs %} {% for tab in main_nav_tabs %}
<li> <li>
<a href="{{ path(tab['route']) }}" <a href="{{ path(tab['route']) }}"
class='hover-effect {{ active(tab['route']) }}'>{{ tab['title'] }}</a> class='{{ active(tab['route']) }}'>{{ tab['title'] }}</a>
</li> </li>
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -1,11 +1,10 @@
<div class="h-entry hentry note"> <div class="note">
<div class="note-info"> <div class="note-info">
{% set nickname = note.getActorNickname() %} {% set nickname = note.getActorNickname() %}
<a class="u-url" href="{{ path('settings_avatar') }}"> <a href="{{ path('settings_avatar') }}">
{# Microformat's h-card properties indicates a face icon is a "u-logo" #} <img class="avatar" src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
<img class="u-logo avatar" src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar"> <b>{{ nickname }}</b>
<b class="p-nickname">{{ nickname }}</b>
</a> </a>
{% set reply_to = note.getReplyToNickname() %} {% set reply_to = note.getReplyToNickname() %}
@ -13,7 +12,7 @@
{% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %} {% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %}
{% endif %} {% endif %}
</div> </div>
<div class="e-content entry-content note-content"> <div class="note-content">
{% block markdown %} {% block markdown %}
{% apply markdown_to_html %} {% apply markdown_to_html %}
{{ note.getContent() }} {{ note.getContent() }}
@ -40,7 +39,7 @@
{# {% endif %} #} {# {% endif %} #}
</div> </div>
{% if replies is defined %} {% if replies is defined %}
<div class="u-in-reply-to replies"> <div class="replies">
{% for conversation in replies %} {% for conversation in replies %}
{% include '/note/view.html.twig' with {'note': conversation['note'], 'skip_reply_to': true, 'have_user': have_user, 'replies': conversation['replies']} only %} {% include '/note/view.html.twig' with {'note': conversation['note'], 'skip_reply_to': true, 'have_user': have_user, 'replies': conversation['replies']} only %}
{% endfor %} {% endfor %}