pyfedi/app/static/structure.scss

1111 lines
18 KiB
SCSS

/* This file contains SCSS used for creating the general structure of pages. Selectors should be things like body, h1,
nav, etc which are used site-wide */
@import "scss/colours";
@import "scss/mixins";
@import "scss/typography";
@import "scss/controls";
$min-touch-target: 44px;
html {
@include breakpoint(phablet) {
scroll-padding-top: 80px;
}
}
.container {
width: 100%;
padding-right: 0.75rem;
padding-left: 0.75rem;
margin-right: auto;
margin-left: auto;
max-width: inherit;
@include breakpoint(phablet) {
}
@include breakpoint(tablet) {
max-width: 960px;
}
@include breakpoint(laptop) {
max-width: 1200px;
}
@include breakpoint(desktop) {
max-width: 1550px;
}
@include breakpoint(bigbig) {
max-width: 1880px;
}
}
@include breakpoint(tablet) {
.navbar-expand-lg .navbar-nav .dropdown-menu {
overflow-y: auto;
max-height: 90vh;
overflow-x: hidden;
}
}
.low_bandwidth {
.dropdown-toggle::after {
display: none;
}
}
.skip-link {
position: absolute;
top: -40px; /* Adjust as needed to hide the link off-screen */
left: 0;
background-color: #fff; /* Background color to cover the link for screen readers */
z-index: 1060; /* Ensure it's above other content */
}
.skip-link:focus {
top: 0; /* Bring the link back into view when it receives focus */
}
.form-group {
margin-bottom: 1.1rem;
&.required {
label {
&:after {
content: '*';
color: red;
margin-left: 2px;
font-size: 80%;
position: relative;
top: -1px;
}
}
}
}
.card {
max-width: 350px;
margin-left: auto;
margin-right: auto;
.card-body > p > img, .card-body > p > a > img {
max-width: 100%;
}
}
#breadcrumb_nav {
font-size: 87%;
}
@include breakpoint(tablet) {
#breadcrumb_nav {
display: block;
font-size: 87%;
.breadcrumb {
padding: 0;
margin-bottom: 0;
background-color: inherit;
.breadcrumb-item + .breadcrumb-item::before {
content: ">";
}
}
}
}
.communities_table {
tbody tr th {
padding: 0;
a {
padding-top: 10px;
padding-bottom: 10px;
width: 100%;
display: inline-block;
}
}
}
.topics_list {
list-style-type: none;
display: grid;
grid-template-columns: repeat(auto-fit,minmax(152px, 1fr));
> li {
padding-bottom: 20px;
}
}
.community_header {
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
border-radius: 5px 5px 0 0; /* top-left | top-right | bottom-right | bottom-left */
height: 176px;
margin-left: -12px;
margin-right: -12px;
margin-top: -9px;
@include breakpoint(tablet) {
height: 240px;
}
#breadcrumb_nav {
@include breakpoint(tablet) {
padding-left: 13px;
padding-top: 13px;
}
.breadcrumb {
background-color: rgba(0,0,0,0.2);
display: inline-block;
padding: 5px 10px;
@include breakpoint(tablet) {
border-radius: 6px;
}
margin-bottom: 0;
.breadcrumb-item {
color: white;
display: inline-block;
a {
color: white;
}
}
.breadcrumb-item + .breadcrumb-item::before {
content: ">";
color: white;
}
}
}
}
.community_header_no_background, .community_header {
.community_icon {
width: 120px;
height: auto;
}
}
#choose_topics_card {
label.form-control-label {
display: none;
}
.form-group {
margin-bottom: 0;
}
ul.form-control {
border: none;
list-style-type: none;
padding-top: 0;
margin-bottom: 0;
li {
vertical-align: center;
label {
height: 44px;
}
}
}
}
.form-check .form-check-input {
position: relative;
top: 4px;
}
.post_reply_form {
label {
display: none;
}
.form-check {
position: absolute;
bottom: -14px;
left: 122px;
label {
display: inherit;
}
}
}
.add_reply {
.form-control-label {
display: none;
}
.form-check {
position: absolute;
bottom: -14px;
left: 122px;
}
}
.post_list {
.post_teaser {
border-bottom: solid 2px $light-grey;
padding-top: 8px;
padding-bottom: 8px;
h3 {
font-size: 110%;
margin-top: 4px;
margin-bottom: 0;
}
.meta_row, .main_row, .utilities_row {
a {
text-decoration: none;
}
}
.main_row {
position: relative;
.author {
margin-bottom: 30px;
display: inline-block;
max-width: 78%;
}
.post_utilities {
position: absolute;
bottom: -12px;
left: 10px;
a {
display: inline-block;
min-width: 44px;
line-height: 44px;
text-align: center;
&:first-child {
text-align: left;
}
}
}
.post_options {
position: absolute;
bottom: -1px;
}
}
.utilities_row {
a {
display: inline-block;
min-width: $min-touch-target;
min-height: $min-touch-target;
justify-content: center;
align-content: center;
}
.preview_image, .post_options {
text-align: center;
}
}
.thumbnail {
float: right;
padding-left: 0;
padding-right: 0;
position: relative;
.fe {
display: block;
position: absolute;
right: 0;
background-color: rgba(256,256,256, 0.7);
padding-bottom: 1px;
padding-left: 1px;
border-radius: 2px;
top: 0;
}
.fe-video {
left: 121px;
top: 0;
}
img {
height: 60px;
width: 60px;
border-radius: 5px;
object-fit: cover;
margin-left: 5px;
@include breakpoint(tablet) {
height: 70px;
width: 133px;
}
&.blur {
filter: blur(3px);
}
}
&.lbw {
.fe {
background: none;
}
.fe::before {
font-size: 28px;
padding-right: 7px;
}
}
&.missing_thumbnail {
.fe::before {
font-size: x-large;
opacity: 0.8;
}
}
}
&.blocked {
opacity: 0.2;
font-size: 80%;
.voting_buttons {
width: 46px;
line-height: 24px;
.upvote_button, .downvote_button {
font-size: 80%;
}
}
}
}
}
.post_utilities_bar {
display: flex;
min-height: $min-touch-target;
.cross_post_button {
display: flex;
justify-content: left;
align-items: center;
width: $min-touch-target;
height: $min-touch-target;
line-height: $min-touch-target;
padding: 3px;
padding-left: 0;
}
.post_options_link {
display: flex;
width: $min-touch-target;
height: $min-touch-target;
padding: 3px;
justify-content: center;
align-items: center;
}
}
#masonry {
display: flex;
.column {
flex: 1;
padding: 0;
padding-right: 5px;
&:last-child {
padding-right: 0;
}
}
.item {
position: relative;
margin-bottom: 5px;
img {
width: 100%;
display: block;
height: auto; /* Ensure aspect ratio is maintained */
}
.masonry_thumb a, .masonry_thumb a:active {
border: none;
}
.masonry_info {
position: absolute;
bottom: 0;
background-color: rgba(0, 0, 0, 0.3);
width: 100%;
text-align: center;
.voting_buttons_masonry {
width: 100%;
display: flex;
}
p {
margin-bottom: 0;
a {
color: white;
text-decoration: none;
line-height: 40px;
@include breakpoint(laptop) {
line-height: 30px;
}
}
}
.row {
margin-left: 0;
margin-right: 0;
.col {
padding: 0;
flex-direction: row;
display: inline-flex;
a {
color: white;
padding-top: 6px;
@include breakpoint(laptop) {
padding-top: 0;
}
}
.upvote_button, .downvote_button {
display: inline;
color: white;
padding-top: 10px;
@include breakpoint(laptop) {
padding-top: 5px;
}
width: 50%;
position: relative;
.htmx-indicator {
position: absolute;
width: 20px;
height: 20px;
left: 7px;
}
&.voted_up {
color: $green;
}
&.voted_down {
color: red;
}
}
}
.col-8 {
justify-content: center;
p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.reply_col {
justify-content: right;
padding-right: 5px;
}
}
}
.masonry_info_no_image {
background-color: rgba(0, 0, 0, 0.2);
width: 100%;
text-align: center;
p {
margin-bottom: 0;
a {
color: var(--bs-body-color);
text-decoration: none;
}
}
}
}
}
.layout_switcher {
@include breakpoint(tablet) {
float: right;
}
}
.url_thumbnail {
float: right;
margin-top: -6px;
}
.post_image {
img {
max-width: 100%;
max-height: 90vh;
}
}
.render_username {
display: inline;
a img {
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: bottom;
}
}
.comments > .comment {
margin-left: 0;
border-top: solid 1px $grey;
margin-right: 8px;
.comment_body {
hr {
margin-left: 15px;
margin-right: 15px;
opacity: 0.1;
}
}
&:first-child {
border-top: none;
padding-top: 0;
}
}
[data-bs-theme=dark] {
.post_list .post_teaser {
border-bottom: solid 1px $super-dark-grey;
.thumbnail .fe {
background-color: rgba(0,0,0,0.4);
}
}
.comments > .comment {
border-top-color: $super-dark-grey;
}
.downarea-textarea {
.form-control {
background-color: $super-dark-grey;
color: whitesmoke;
}
}
.comment .replies {
border-left-color: $super-dark-grey;
border-top-color: $super-dark-grey;
}
}
.post_body {
img {
max-height: 40vh;
max-width: 100%;
height: auto;
}
}
.comment_body {
img {
max-height: 40vh;
max-width: 100%;
height: auto;
}
}
#replies {
scroll-margin-top: 5em;
}
.post_replies > .col {
padding-right: 5px;
}
.post_type_image {
.post_image {
img {
max-width: 100%;
height: auto;
}
}
}
.voting_buttons_new {
display: inline-block;
.upvote_button, .downvote_button {
display: inline-block;
padding: 5px 0 5px 3px;
text-align: center;
position: relative;
cursor: pointer;
color: rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1));
min-width: $min-touch-target;
min-height: $min-touch-target;
&.digits_4 {
width: 68px;
}
&.digits_5 {
width: 76px;
}
&.digits_6 {
width: 84px;
}
&.voted_up {
color: green;
font-weight: bold;
}
&.voted_down {
color: darkred;
font-weight: bold;
}
}
.upvote_button {
top: 1px;
.htmx-indicator {
left: 13px;
top: 7px;
}
}
.downvote_button {
top: 1px;
.htmx-indicator {
left: 12px;
top: 5px;
}
}
.htmx-indicator{
position: absolute;
left: 3px;
width: 20px;
height: 20px;
top: 0;
}
.htmx-request .htmx-indicator{
display:inline;
position: absolute;
width: 20px;
height: 20px;
right: 14px;
top: 5px;
opacity: 1!important;
}
.htmx-request.htmx-indicator{
display:inline;
}
}
.voting_buttons {
float: right;
display: block;
min-width: $min-touch-target + 10;
padding: 0 0 5px 5px;
line-height: 30px;
font-size: 14px;
@include breakpoint(laptop) {
line-height: 25px;
}
div {
border: solid 1px $primary-colour;
}
.upvote_button, .downvote_button {
position: relative;
padding: 0 3px;
min-height: $min-touch-target;
min-width: $min-touch-target;
border-radius: 3px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
&.digits_4 {
width: 68px;
}
&.digits_5 {
width: 76px;
}
&.digits_6 {
width: 84px;
}
&.voted_up {
color: green;
font-weight: bold;
}
&.voted_down {
color: darkred;
font-weight: bold;
}
}
.downvote_button {
margin-top: 5px;
}
.htmx-indicator{
position: absolute;
width: 20px;
height: 20px;
}
.htmx-request .htmx-indicator{
display:inline;
position: absolute;
width: 20px;
height: 20px;
right: 14px;
top: 5px;
opacity: 1!important;
}
.htmx-request.htmx-indicator{
display:inline;
}
a {
text-decoration: none;
}
}
.comment {
clear: both;
margin-left: 15px;
padding-top: 8px;
.limit_height {
position: relative;
&.expanded {
max-height: none;
.show-more {
display: none;
}
}
}
.show-more {
text-decoration: none;
display: block;
text-align: center;
background-color: $dark-grey;
color: white;
margin-bottom: 15px;
height: 30px;
.fe-angles-down, .fe-angles-up {
margin-top: 7px;
display: inline-block;
}
@include breakpoint(laptop) {
height: 23px;
.fe-angles-down, .fe-angles-up {
display: inline;
}
}
}
.comment_author {
img {
width: 25px;
height: 25px;
border-radius: 50%;
vertical-align: middle;
}
a.unhide {
display: none;
text-decoration: none;
padding: 5px 15px;
position: relative;
top: 3px;
}
}
.comment_actions {
margin-top: -10px;
position: relative;
a {
text-decoration: none;
padding: 0;
}
.hide_button {
display: inline-block;
a {
padding: 5px 15px;
}
}
.notif_toggle {
text-decoration: none;
font-size: 87%;
padding: 5px 15px;
}
}
.replies {
margin-top: 0;
border-left: solid 1px $light-grey;
border-top: solid 1px $light-grey;
}
}
#add_local_community_form {
#url {
width: 297px;
display: inline-block;
padding-left: 3px;
}
}
#reasons {
border: none;
list-style-type: none;
padding: 0;
overflow-y: auto;
height: 230px;
}
.table {
tr th {
vertical-align: middle;
}
}
.show_menu {
display: block!important;
}
.moderator_list {
list-style-type: none;
padding-left: 0;
li {
display: inline-block;
padding-right: 5px;
}
}
fieldset {
legend {
font-weight: bold;
}
}
.profile_action_buttons, .rh_action_buttons {
float: right;
}
.preview_image_shown {
z-index: 1;
position: relative;
max-width: 92vw;
height: auto;
cursor: pointer;
@include breakpoint(tablet) {
max-width: 760px;
}
@include breakpoint(laptop) {
max-width: 800px;
}
@include breakpoint(desktop) {
max-width: 850px;
}
@include breakpoint(bigbig) {
max-width: 1180px;
}
}
.mobile_create_post {
float: right;
}
.post_body, .comment_body {
blockquote {
border-left: 2px solid var(--bs-secondary);
padding: 0.1em 5px;
font-style: italic;
}
}
.list-group-item:first-child {
padding-top: 0;
}
.skip-link:focus {
top: 0;
}
#choose_communities_in_topic_card {
max-width: inherit;
overflow: hidden;
}
#choose_community {
table th {
white-space: nowrap;
overflow: hidden;
img {
vertical-align: middle;
}
}
}
.warning_badge {
font-size: 12px;
border-radius: 2px;
margin-right: 2px;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: text-bottom;
line-height: 20px;
padding: 0 4px;
&.nsfw {
border:1px solid #FF585B;
color:#FF585B;
}
&.nsfl {
border:1px solid black;
color:black;
}
}
h1 .warning_badge {
position: relative;
left: 15px;
top: -6px;
}
[data-bs-theme=dark] .warning_badge.nsfl {
border:1px solid white;
color:white;
}
.post_title {
.warning_badge {
line-height: 32px;
margin-left: 15px;
}
}
.conversation {
position: relative;
.message {
width: 90%;
@include breakpoint(tablet) {
width: 70%;
}
max-width: 100%;
margin-bottom: 15px;
clear: both;
&.from_other_party {
float: right;
}
&.from_me {
float: left;
}
}
.message_created_at {
float: right;
}
form .form-control-label {
display: none;
}
.conversation_options {
position: absolute;
bottom: 0;
right: 0;
}
}
#post_reply_markdown_editor_enabler {
display: none;
position: absolute;
bottom: 3px;
right: 0;
@include breakpoint(phablet) {
display: inline-block;
}
}
.create_post_markdown_editor_enabler {
text-align: right;
margin-bottom: 10px;
display: block;
}
.redo_search {
display: inline;
input[type=search] {
width: unset;
display: inline;
font-size: inherit;
line-height: initial;
max-width: 100%;
}
}
.responsive-video {
max-width: 100%;
max-height: 90vh;
}
.post_language_chooser {
@include breakpoint(phablet) {
label {
display: none;
}
select {
max-width: 150px;
float: right;
margin-top: -5px;
}
}
}
.language-float-right {
@include breakpoint(phablet) {
max-width: 150px;
float: right;
}
}
#pollChoicesFieldset {
margin-bottom: 20px;
}
.post_poll {
ul {
list-style: none;
padding-left: 0;
li {
margin-bottom: 5px;
.vote_bar {
.vote_score {
background-color: $grey;
color: white;
text-align: right;
padding-right: 5px;
font-weight: bold;
}
}
}
}
}
.post_body, .comment_body {
word-wrap: break-word;
}