microblog.pub/app/scss/main.scss

572 lines
8.7 KiB
SCSS
Raw Normal View History

2022-07-01 19:35:34 +02:00
$font-stack: Helvetica, sans-serif;
2022-07-14 15:33:40 +02:00
$background: #ddd;
2022-07-14 16:31:16 +02:00
$light-background: #e6e6e6;
2022-07-14 15:33:40 +02:00
$text-color: #111;
$primary-color: #1d781d;
$secondary-color: #781D78;
2022-07-03 22:01:47 +02:00
$form-background-color: #ccc;
2022-07-14 18:40:38 +02:00
$form-text-color: #333;
2022-07-14 15:33:40 +02:00
$muted-color: #555; // solarized comment text
2022-07-29 21:26:19 +02:00
$primary-button-text-color: #fff;
2022-08-04 19:10:57 +02:00
$code-highlight-background: #f0f0f0;
2022-07-01 19:35:34 +02:00
2022-07-04 20:49:23 +02:00
// Load custom theme
2022-07-29 21:01:45 +02:00
@import "theme.scss";
2022-07-09 08:15:33 +02:00
2022-08-22 18:50:20 +02:00
.primary-color {
color: $primary-color;
}
2022-08-29 21:42:54 +02:00
#admin {
.admin-menu {
margin-bottom: 30px;
padding: 0 20px;
}
}
.empty-state {
padding: 20px;
}
.public-top-menu {
margin: 30px 0 0 0;
}
.width-95 {
width: 95%;
}
.bold {
font-weight: bold;
}
.admin-new {
textarea {
font-size: 1.2em;
width: 95%;
}
}
.show-more-wrapper {
.p-summary {
display: inline-block;
}
Use <details> element for sensitive text The sensitive text feature was implemented with <label> and hidden checkbox <input> elements. There were two issues with this implementation: 1. The user couldn't navigate to the "show/hide more" button using keyboard. 2. The label indicates two actions at the same time ("show/hide more"), making it unclear what the function of the checkbox was and what the current show/collapse state was. As it is generally preferrable to use built-in HTML elements for the best semantic, this commit moves to use the <details> and <summary> elements for the sensitive text feature. The browser will open/collapse the content in <details> automatically when the user clicks on the <summary>, and keyboard navigation support is built-in. This commit also changes the button to display "show more" or "show less" depending on the state for visual clarity. This button is hidden from the accessibility tree using `aria-label="false"`, as the <details> element already exposes its state to the tree and we want to avoid duplicated information. A few caveats: * The "show/hide sensitive content" button for sensitive attachments hasn't been changed yet as I'd like to get more feedback about the new implementation. * As the summary/content warning text itself is also part of the <summary> tag, the user can now also click on them to toggle the visibility of the sensitive text. This may not be desirable as the current interface does not make it clear that this could happen; the user may try to select some text from the summary and be surprised by the sensitive text being expanded. One way to improve this would be to add an event listener to the summary text and call `preventDefault`, but this would introduce JavaScript code.
2022-11-25 07:56:57 +01:00
.show-more-btn {
margin-left: 5px;
}
Use <details> element for sensitive text The sensitive text feature was implemented with <label> and hidden checkbox <input> elements. There were two issues with this implementation: 1. The user couldn't navigate to the "show/hide more" button using keyboard. 2. The label indicates two actions at the same time ("show/hide more"), making it unclear what the function of the checkbox was and what the current show/collapse state was. As it is generally preferrable to use built-in HTML elements for the best semantic, this commit moves to use the <details> and <summary> elements for the sensitive text feature. The browser will open/collapse the content in <details> automatically when the user clicks on the <summary>, and keyboard navigation support is built-in. This commit also changes the button to display "show more" or "show less" depending on the state for visual clarity. This button is hidden from the accessibility tree using `aria-label="false"`, as the <details> element already exposes its state to the tree and we want to avoid duplicated information. A few caveats: * The "show/hide sensitive content" button for sensitive attachments hasn't been changed yet as I'd like to get more feedback about the new implementation. * As the summary/content warning text itself is also part of the <summary> tag, the user can now also click on them to toggle the visibility of the sensitive text. This may not be desirable as the current interface does not make it clear that this could happen; the user may try to select some text from the summary and be surprised by the sensitive text being expanded. One way to improve this would be to add an event listener to the summary text and call `preventDefault`, but this would introduce JavaScript code.
2022-11-25 07:56:57 +01:00
summary {
display: inline-block;
}
Use <details> element for sensitive text The sensitive text feature was implemented with <label> and hidden checkbox <input> elements. There were two issues with this implementation: 1. The user couldn't navigate to the "show/hide more" button using keyboard. 2. The label indicates two actions at the same time ("show/hide more"), making it unclear what the function of the checkbox was and what the current show/collapse state was. As it is generally preferrable to use built-in HTML elements for the best semantic, this commit moves to use the <details> and <summary> elements for the sensitive text feature. The browser will open/collapse the content in <details> automatically when the user clicks on the <summary>, and keyboard navigation support is built-in. This commit also changes the button to display "show more" or "show less" depending on the state for visual clarity. This button is hidden from the accessibility tree using `aria-label="false"`, as the <details> element already exposes its state to the tree and we want to avoid duplicated information. A few caveats: * The "show/hide sensitive content" button for sensitive attachments hasn't been changed yet as I'd like to get more feedback about the new implementation. * As the summary/content warning text itself is also part of the <summary> tag, the user can now also click on them to toggle the visibility of the sensitive text. This may not be desirable as the current interface does not make it clear that this could happen; the user may try to select some text from the summary and be surprised by the sensitive text being expanded. One way to improve this would be to add an event listener to the summary text and call `preventDefault`, but this would introduce JavaScript code.
2022-11-25 07:56:57 +01:00
summary::-webkit-details-marker {
display: none
}
Use <details> element for sensitive text The sensitive text feature was implemented with <label> and hidden checkbox <input> elements. There were two issues with this implementation: 1. The user couldn't navigate to the "show/hide more" button using keyboard. 2. The label indicates two actions at the same time ("show/hide more"), making it unclear what the function of the checkbox was and what the current show/collapse state was. As it is generally preferrable to use built-in HTML elements for the best semantic, this commit moves to use the <details> and <summary> elements for the sensitive text feature. The browser will open/collapse the content in <details> automatically when the user clicks on the <summary>, and keyboard navigation support is built-in. This commit also changes the button to display "show more" or "show less" depending on the state for visual clarity. This button is hidden from the accessibility tree using `aria-label="false"`, as the <details> element already exposes its state to the tree and we want to avoid duplicated information. A few caveats: * The "show/hide sensitive content" button for sensitive attachments hasn't been changed yet as I'd like to get more feedback about the new implementation. * As the summary/content warning text itself is also part of the <summary> tag, the user can now also click on them to toggle the visibility of the sensitive text. This may not be desirable as the current interface does not make it clear that this could happen; the user may try to select some text from the summary and be surprised by the sensitive text being expanded. One way to improve this would be to add an event listener to the summary text and call `preventDefault`, but this would introduce JavaScript code.
2022-11-25 07:56:57 +01:00
&:not([open]) .show-more-btn::after {
content: 'show more';
}
&[open] .show-more-btn::after {
content: 'show less';
}
}
.sensitive-attachment {
display: inline-block;
.sensitive-attachment-state {
display: none;
}
.sensitive-attachment-state:checked ~ .sensitive-attachment-box div {
display:none;
}
.sensitive-attachment-box {
position: relative;
div {
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
backdrop-filter: blur(2em);
}
}
}
2022-08-03 19:53:55 +02:00
blockquote {
border-left: 3px solid $secondary-color;
margin-left: 0;
padding-left: 1.5em;
}
.muted {
color: $muted-color;
}
2022-07-09 08:15:33 +02:00
.light-background {
background: $light-background;
}
2022-07-04 20:49:23 +02:00
2022-07-01 19:35:34 +02:00
2022-06-22 20:11:22 +02:00
body {
2022-07-01 19:35:34 +02:00
font-family: $font-stack;
font-size: 20px;
line-height: 32px;
background: $background;
2022-07-03 22:01:47 +02:00
color: $text-color;
2022-07-01 19:35:34 +02:00
margin: 0;
padding: 0;
display: flex;
min-height: 100vh;
flex-direction: column;
}
a {
2022-07-14 18:40:38 +02:00
text-decoration: none;
2022-07-01 19:35:34 +02:00
}
2022-07-12 19:52:29 +02:00
2022-08-10 08:58:18 +02:00
dl {
display: flex;
dt {
width: 200px;
flex: 0 0 auto;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
dd {
flex: 1 1 auto;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
p {
display: inline;
}
}
}
2022-07-03 22:42:14 +02:00
.shared-header {
2022-07-12 19:52:29 +02:00
margin-left: 20px;
margin-top: 30px;
margin-bottom: -20px;
strong {
color: $primary-color;
}
2022-08-27 09:14:16 +02:00
span {
color: $muted-color;
}
2022-07-03 22:42:14 +02:00
}
2022-07-12 19:52:29 +02:00
div.highlight {
2022-08-04 19:10:57 +02:00
background: $code-highlight-background;
2022-07-14 19:05:45 +02:00
padding: 0 10px;
2022-07-12 19:52:29 +02:00
overflow: auto;
display: block;
2022-07-12 22:24:15 +02:00
margin: 20px 0;
2022-07-03 22:42:14 +02:00
}
2022-07-12 19:52:29 +02:00
2022-07-09 08:15:33 +02:00
.box {
padding: 0 20px;
}
2022-07-01 19:35:34 +02:00
code, pre {
2022-07-03 22:01:47 +02:00
color: $secondary-color; // #cb4b16; // #268bd2; // #2aa198;
2022-07-03 22:42:14 +02:00
font-family: monospace;
2022-07-01 19:35:34 +02:00
}
2022-07-14 18:40:38 +02:00
2022-07-03 22:01:47 +02:00
.form {
input, select, textarea {
font-size: 20px;
border: 0;
padding: 5px;
background: $form-background-color;
color: $form-text-color;
&:focus {
outline: 1px solid $secondary-color;
}
}
input[type=submit] {
font-size: 20px;
outline: none;
background: $primary-color;
2022-07-29 21:26:19 +02:00
color: $primary-button-text-color;
2022-07-14 18:40:38 +02:00
padding: 5px 12px;
cursor: pointer;
2022-07-03 22:01:47 +02:00
}
}
2022-07-14 18:40:38 +02:00
2022-07-01 19:35:34 +02:00
header {
2022-07-09 08:15:33 +02:00
padding: 0 20px;
2022-07-01 19:35:34 +02:00
.title {
font-size: 1.3em;
text-decoration: none;
.handle {
font-size: 0.85em;
2022-07-03 22:01:47 +02:00
color: $muted-color;
2022-07-01 19:35:34 +02:00
}
}
.counter {
2022-07-03 22:01:47 +02:00
color: $muted-color;
2022-07-01 19:35:34 +02:00
}
2022-07-29 21:35:02 +02:00
.summary {
a:hover {
text-decoration: underline;
}
}
2022-07-01 19:35:34 +02:00
}
a {
2022-07-03 22:01:47 +02:00
color: $primary-color;
&:hover {
color: $secondary-color;
}
2022-06-22 20:11:22 +02:00
}
#main {
2022-09-20 20:00:35 +02:00
display: flex;
2022-06-22 20:11:22 +02:00
flex: 1;
}
main {
2022-07-01 19:35:34 +02:00
width: 100%;
2022-07-09 08:15:33 +02:00
max-width: 1000px;
2022-07-01 19:35:34 +02:00
margin: 30px auto;
2022-06-22 20:11:22 +02:00
}
2022-08-28 17:36:58 +02:00
2022-09-20 20:00:35 +02:00
.main-flex {
display: flex;
flex: 1;
}
2022-08-28 17:36:58 +02:00
.centered {
display: flex;
2022-09-20 20:00:35 +02:00
flex: 1;
2022-08-28 17:36:58 +02:00
justify-content: center;
align-items: center;
2022-09-20 20:00:35 +02:00
div {
display: block;
}
2022-08-28 17:36:58 +02:00
}
2022-06-22 20:11:22 +02:00
footer {
2022-08-24 21:18:30 +02:00
width: 100%;
max-width: 1000px;
margin: 20px auto;
color: $muted-color;
p {
margin: 0;
}
2022-07-01 19:35:34 +02:00
}
2022-08-26 07:43:39 +02:00
.tiny-actor-icon {
max-width: 24px;
max-height: 24px;
position: relative;
top: 5px;
}
2022-07-01 19:35:34 +02:00
.actor-box {
display: flex;
column-gap: 20px;
2022-07-09 08:15:33 +02:00
margin:10px 0;
2022-07-01 19:35:34 +02:00
.icon-box {
flex: 0 0 50px;
}
.actor-handle {
font-size: 0.85em;
line-height: 1em;
2022-07-03 22:01:47 +02:00
color: $muted-color;
2022-07-01 19:35:34 +02:00
}
.actor-icon {
max-width: 50px;
}
2022-06-22 20:11:22 +02:00
}
2022-07-25 22:51:53 +02:00
#articles {
list-style-type: none;
margin: 30px 0;
padding: 0 20px;
li {
display: block;
2022-08-29 21:42:54 +02:00
span {
padding-right:10px;
}
2022-07-25 22:51:53 +02:00
}
}
2022-06-22 20:11:22 +02:00
#notifications, #followers, #following {
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
li {
2022-07-05 08:14:50 +02:00
display: block;
2022-06-22 20:11:22 +02:00
}
}
2022-07-15 20:01:55 +02:00
@mixin admin-button() {
font-size: 20px;
line-height: 32px;
font-family: $font-stack;
background: $form-background-color;
color: $form-text-color;
border: 1px solid $background;
padding: 8px 10px 5px 10px;
cursor: pointer;
&:hover {
border: 1px solid $form-text-color;
}
}
.show-sensitive-btn, .show-more-btn, .label-btn {
2022-07-15 20:01:55 +02:00
@include admin-button;
padding: 10px 5px;
2022-07-15 20:01:55 +02:00
margin: 20px 0;
}
2022-08-29 21:42:54 +02:00
.show-hide-sensitive-btn {
display:inline-block;
}
.no-margin-top {
margin-top: 0;
}
.float-right {
float: right;
}
ul.poll-items {
list-style-type: none;
padding: 0;
li {
display: block;
p {
margin: 20px 0 10px 0;
.poll-vote {
padding-left: 20px;
}
}
.poll-bar {
width:100%;height:20px;
line {
stroke: $secondary-color;
stroke-width: 20px;
}
}
}
}
.attachment-wrapper {
.attachment-item {
margin-top: 20px;
}
img.attachment {
margin: 0;
}
a.attachment {
display: inline-block;
margin-bottom: 15px;
}
audio.attachment {
width: 480px;
}
}
2022-07-03 22:42:14 +02:00
nav {
2022-07-14 18:40:38 +02:00
form {
margin: 15px 0;
}
input[type=submit], button {
2022-07-15 20:01:55 +02:00
@include admin-button;
2022-07-14 18:40:38 +02:00
}
2022-07-03 22:42:14 +02:00
}
2022-06-22 20:11:22 +02:00
nav.flexbox {
ul {
display: flex;
2022-07-01 19:35:34 +02:00
flex-wrap: wrap;
2022-06-22 20:11:22 +02:00
align-items: center;
list-style-type: none;
margin: 0;
padding: 0;
}
ul li {
margin-right: 20px;
&:last-child {
margin-right: 0px;
}
}
2022-09-21 21:00:17 +02:00
a:not(.label-btn) {
2022-07-14 18:40:38 +02:00
color: $primary-color;
2022-07-01 19:35:34 +02:00
text-decoration: none;
2022-07-14 18:40:38 +02:00
&:hover, &:active {
color: $secondary-color;
text-decoration: underline;
}
2022-07-01 19:35:34 +02:00
}
2022-09-21 21:00:17 +02:00
a.active:not(.label-btn) {
2022-07-04 21:13:04 +02:00
color: $secondary-color;
2022-06-22 20:11:22 +02:00
font-weight: bold;
}
}
2022-09-21 21:00:17 +02:00
// after nav.flexbox to override default behavior
a.label-btn {
color: $form-text-color;
&:hover {
text-decoration: none;
color: $form-text-color;
}
}
2022-07-09 08:15:33 +02:00
.ap-object {
margin: 15px 0;
padding: 20px;
nav {
color: $muted-color;
}
.in-reply-to {
display: inline;
color: $muted-color;
}
2022-07-14 18:40:38 +02:00
.e-content, .activity-og-meta {
a:hover {
text-decoration: underline;
2022-07-09 08:15:33 +02:00
}
}
.activity-attachment {
2022-08-29 21:42:54 +02:00
margin: 30px 0 20px 0;
2022-07-09 08:15:33 +02:00
img, audio, video {
max-width: 740px;
}
2022-07-07 20:37:16 +02:00
}
2022-07-14 15:16:58 +02:00
img.inline-img {
2022-07-14 15:33:40 +02:00
display: block;
2022-07-14 15:16:58 +02:00
max-width: 740px;
}
2022-07-07 20:37:16 +02:00
}
2022-08-29 21:42:54 +02:00
.activity-og-meta {
display: flex;
column-gap: 20px;
margin: 20px 0;
img {
max-width: 200px;
max-height: 100px;
}
small {
display: block;
}
}
2022-07-09 08:15:33 +02:00
.ap-object-expanded {
border: 2px dashed $secondary-color;
}
2022-06-22 20:11:22 +02:00
.error-box, .scolor {
2022-07-26 18:51:20 +02:00
color: $secondary-color;
}
2022-06-25 10:20:07 +02:00
.actor-action {
margin-top:20px;
2022-07-09 08:15:33 +02:00
margin-bottom:-20px;
padding: 0 20px;
2022-06-25 10:20:07 +02:00
span {
2022-07-03 22:01:47 +02:00
color: $muted-color;
2022-06-25 10:20:07 +02:00
}
2022-11-20 10:13:17 +01:00
span.new {
color: $secondary-color;
}
2022-06-25 10:20:07 +02:00
}
2022-07-03 22:01:47 +02:00
.actor-metadata {
color: $muted-color;
}
2022-06-27 20:55:44 +02:00
.emoji, .custom-emoji {
max-width: 25px;
}
2022-08-29 21:42:54 +02:00
.indieauth-box {
display: flex;
column-gap: 20px;
.indieauth-logo {
flex: initial;
width: 100px;
img {
max-width: 100px;
}
}
.indieauth-details {
flex: 1;
div {
padding-left: 20px;
a {
font-size: 1.2em;
font-weight: 600;
}
}
}
}
.public-interactions {
display: flex;
column-gap: 20px;
flex-wrap: wrap;
margin-top: 20px;
.interactions-block {
flex: 0 1 30%;
max-width: 50%;
.facepile-wrapper {
display: flex;
column-gap: 20px;
row-gap: 20px;
flex-wrap: wrap;
margin-top: 20px;
a {
height: 50px;
img {
max-width: 50px;
}
}
.and-x-more {
display: inline-block;
align-self: center;
}
}
}
}
.error-title {
a {
text-decoration: underline;
}
}
.ap-place {
h3 {
display: inline;
font-weight: normal;
}
h3::after {
content: ': ';
}
}
2022-11-19 08:12:33 +01:00
.margin-top-20 {
margin-top: 20px;
}
.video-wrapper {
position: relative;
}
.video-gif-overlay {
display: none;
}
.video-gif-mode + .video-gif-overlay {
display: block;
position: absolute;
top: 5px;
left: 5px;
padding: 0 3px;
font-size: 0.8em;
background: rgba(0,0,0,.5);
color: #fff;
}