mirror of
https://github.com/spikecodes/libreddit
synced 2024-12-27 02:55:38 +01:00
bd413060c6
* Initial implementation of award parsing * Posts: Implement awards as part of post * Posts: remove parse_awards dead code * Posts: initial implementation of displaying Awards at the post title * Posts: Proxy static award images * Client: i.redd.it should take path as argument not ID * Posts: Just like Reddit make award size 16px * Templates: limit the awards to 4 awards to increase performance * Comments: Make awards a property of comments and display them * Format and correct /img/:id * Update comment.html * [Optimization] Awards is not longer async * [Revert] Posts can now display more than 4 awards again * [Implementation] Awards not display on the frontpage * [Implementation] Display count on awards * Post: Start working on awards css * Awards: Move the image size to css * Awards: Start implementing tooltips * Refactor awards code and tweak CSS indentation * Unify Awards::new and Awards::parse * Use native tooltips and brighten awards background Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
1418 lines
23 KiB
CSS
1418 lines
23 KiB
CSS
/* Define themes */
|
|
|
|
/* Constants */
|
|
:root {
|
|
--nsfw: #ff5c5d;
|
|
--admin: #ea0027;
|
|
}
|
|
|
|
@font-face {
|
|
font-family: 'Inter';
|
|
src: url('/Inter.var.woff2') format('woff2-variations');
|
|
font-style: normal;
|
|
}
|
|
|
|
/* Automatic theme selection */
|
|
:root, .dark{
|
|
/* Default & fallback theme (dark) */
|
|
--accent: aqua;
|
|
--green: #5cff85;
|
|
--text: white;
|
|
--foreground: #222;
|
|
--background: #0f0f0f;
|
|
--outside: #1f1f1f;
|
|
--post: #161616;
|
|
--panel-border: 1px solid #333;
|
|
--highlighted: #333;
|
|
--visited: #aaa;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
/* Browser-defined light theme */
|
|
@media (prefers-color-scheme: light) {
|
|
:root {
|
|
--accent: #009a9a;
|
|
--green: #00a229;
|
|
--text: black;
|
|
--foreground: #f5f5f5;
|
|
--background: #ddd;
|
|
--outside: #ececec;
|
|
--post: #eee;
|
|
--panel-border: 1px solid #ccc;
|
|
--highlighted: white;
|
|
--visited: #555;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
}
|
|
|
|
/* Light theme setting */
|
|
.light {
|
|
--accent: #009a9a;
|
|
--green: #00a229;
|
|
--text: black;
|
|
--foreground: #f5f5f5;
|
|
--background: #ddd;
|
|
--outside: #ececec;
|
|
--post: #eee;
|
|
--panel-border: 1px solid #ccc;
|
|
--highlighted: white;
|
|
--visited: #555;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Black theme setting */
|
|
.black {
|
|
--accent: #009a9a;
|
|
--green: #00a229;
|
|
--text: white;
|
|
--foreground: #0f0f0f;
|
|
--background: black;
|
|
--outside: black;
|
|
--post: black;
|
|
--panel-border: 2px solid #0f0f0f;
|
|
--highlighted: #0f0f0f;
|
|
--visited: #aaa;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Dracula theme setting */
|
|
.dracula {
|
|
--accent: #bd93f9;
|
|
--green: #50fa7b;
|
|
--text: #f8f8f2;
|
|
--foreground: #3d4051;
|
|
--background: #282a36;
|
|
--outside: #393c4d;
|
|
--post: #333544;
|
|
--panel-border: 2px solid #44475a;
|
|
--highlighted: #4e5267;
|
|
--visited: #969692;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Nord theme setting */
|
|
.nord {
|
|
--accent: #8fbcbb;
|
|
--green: #a3be8c;
|
|
--text: #eceff4;
|
|
--foreground: #3b4252;
|
|
--background: #2e3440;
|
|
--outside: #434c5e;
|
|
--post: #434c5e;
|
|
--panel-border: 2px solid #4c566a;
|
|
--highlighted: #3b4252;
|
|
--visited: #a3a5aa;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Laserwave theme setting */
|
|
.laserwave {
|
|
--accent: #eb64b9;
|
|
--green: #74dfc4;
|
|
--text: #e0dfe1;
|
|
--foreground: #302a36;
|
|
--background: #27212e;
|
|
--outside: #3e3647;
|
|
--post: #3e3647;
|
|
--panel-border: 2px solid #2f2738;
|
|
--highlighted: #302a36;
|
|
--visited: #91889b;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Violet theme setting */
|
|
.violet {
|
|
--accent: #7c71dd;
|
|
--green: #5cff85;
|
|
--text: white;
|
|
--foreground: #1F2347;
|
|
--background: #12152b;
|
|
--outside: #181c3a;
|
|
--post: #181c3a;
|
|
--panel-border: 1px solid #1F2347;
|
|
--highlighted: #1F2347;
|
|
--visited: #aaa;
|
|
--shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
/* Gold theme setting */
|
|
.gold {
|
|
--accent: #f2aa4c;
|
|
--green: #5cff85;
|
|
--text: white;
|
|
--foreground: #234;
|
|
--background: #101820;
|
|
--outside: #1b2936;
|
|
--post: #1b2936;
|
|
--panel-border: 0px solid black;
|
|
--highlighted: #234;
|
|
--visited: #aaa;
|
|
--shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
/* Rosebox theme setting */
|
|
.rosebox {
|
|
--accent: #a57562;
|
|
--green: #a3be8c;
|
|
--text: white;
|
|
--foreground: #222;
|
|
--background: #262626;
|
|
--outside: #222;
|
|
--post: #222;
|
|
--panel-border: 1px solid #222;
|
|
--highlighted: #262626;
|
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
/* General */
|
|
|
|
::selection {
|
|
color: var(--foreground);
|
|
background: var(--accent);
|
|
}
|
|
|
|
:focus-visible {
|
|
outline: 2px solid var(--accent);
|
|
}
|
|
|
|
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote,
|
|
pre, form, fieldset, table, th, td, select, input {
|
|
margin: 0;
|
|
color: var(--text);
|
|
font-family: "Inter", sans-serif;
|
|
}
|
|
|
|
body {
|
|
background: var(--background);
|
|
font-size: 15px;
|
|
padding-top: 60px;
|
|
}
|
|
|
|
nav {
|
|
display: grid;
|
|
grid-template-areas: "logo searchbox links";
|
|
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
|
|
color: var(--accent);
|
|
background: var(--outside);
|
|
box-shadow: var(--shadow);
|
|
|
|
font-size: 20px;
|
|
|
|
z-index: 2;
|
|
top: 0;
|
|
padding: 5px 15px;
|
|
min-height: 40px;
|
|
width: calc(100% - 30px);
|
|
position: fixed;
|
|
}
|
|
|
|
nav * { color: var(--text); }
|
|
nav #reddit, #code > span { color: var(--accent); }
|
|
nav #code > svg { stroke: var(--accent); }
|
|
|
|
nav #logo {
|
|
grid-area: logo;
|
|
white-space: nowrap;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
nav #links {
|
|
grid-area: links;
|
|
margin-left: 10px;
|
|
display: flex;
|
|
}
|
|
|
|
nav #links svg {
|
|
display: none;
|
|
}
|
|
|
|
nav #version {
|
|
opacity: 50%;
|
|
vertical-align: -2px;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
nav #libreddit {
|
|
vertical-align: -2px;
|
|
}
|
|
|
|
#settings_link {
|
|
opacity: 0.8;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
#reddit_link {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
#code {
|
|
margin-left: 10px;
|
|
}
|
|
|
|
main {
|
|
display: flex;
|
|
justify-content: center;
|
|
max-width: 1000px;
|
|
padding: 10px 20px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.wide main {
|
|
max-width: calc(100% - 40px);
|
|
}
|
|
|
|
.wide #column_one {
|
|
width: 100%;
|
|
max-width: 100%;
|
|
}
|
|
|
|
#column_one {
|
|
max-width: 750px;
|
|
border-radius: 5px;
|
|
overflow: inherit;
|
|
}
|
|
|
|
footer {
|
|
display: flex;
|
|
justify-content: center;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
footer > a {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
button {
|
|
background: none;
|
|
border: none;
|
|
font-weight: bold;
|
|
}
|
|
|
|
hr {
|
|
margin: 20px 0;
|
|
}
|
|
|
|
a {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
}
|
|
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
svg {
|
|
stroke: var(--text);
|
|
}
|
|
|
|
img[src=""] {
|
|
display: none;
|
|
}
|
|
|
|
aside {
|
|
flex-grow: 1;
|
|
margin: 20px 20px 0 10px;
|
|
max-width: 350px;
|
|
}
|
|
|
|
.post, .panel {
|
|
border: var(--panel-border);
|
|
}
|
|
|
|
.dot {
|
|
font-size: 12px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
/* User & Subreddit */
|
|
|
|
#user, #subreddit, #sidebar {
|
|
margin: 40px auto 0 auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
height: max-content;
|
|
background: var(--outside);
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#user *, #subreddit * { text-align: center; }
|
|
|
|
#user, #sub_meta, #sidebar_contents { padding: 20px; }
|
|
|
|
#sidebar, #sidebar_contents { margin-top: 10px; }
|
|
#sidebar_label { padding: 10px; }
|
|
|
|
#user_icon, #sub_icon {
|
|
width: 100px;
|
|
height: 100px;
|
|
border: 2px solid var(--accent);
|
|
border-radius: 100%;
|
|
padding: 10px;
|
|
margin: 10px;
|
|
}
|
|
|
|
#user_title, #sub_title {
|
|
margin: 0 20px;
|
|
font-size: 20px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
#user_description, #sub_description {
|
|
margin: 0 15px;
|
|
text-align: left;
|
|
}
|
|
|
|
#user_name, #user_description:not(:empty), #user_icon,
|
|
#sub_name, #sub_icon, #sub_description:not(:empty) {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
#user_details, #sub_details {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
grid-column-gap: 20px;
|
|
}
|
|
|
|
#user_details > label, #sub_details > label {
|
|
color: var(--accent);
|
|
}
|
|
|
|
/* Subscriptions */
|
|
|
|
#sub_subscription, #user_subscription {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
#multisub {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.subscribe, .unsubscribe {
|
|
padding: 10px 20px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.subscribe {
|
|
color: var(--foreground);
|
|
background-color: var(--accent);
|
|
}
|
|
|
|
.unsubscribe {
|
|
color: var(--text);
|
|
background-color: var(--highlighted);
|
|
}
|
|
|
|
/* Feeds */
|
|
|
|
#feeds {
|
|
position: relative;
|
|
border-radius: 5px;
|
|
border: var(--panel-border);
|
|
background-color: var(--outside);
|
|
align-items: center;
|
|
box-sizing: border-box;
|
|
font-size: 15px;
|
|
display: inline-block;
|
|
}
|
|
|
|
#feeds > summary {
|
|
padding: 8px 15px;
|
|
}
|
|
|
|
#feed_list {
|
|
position: absolute;
|
|
display: flex;
|
|
min-width: 100%;
|
|
max-height: 500px;
|
|
border-radius: 5px;
|
|
box-shadow: var(--shadow);
|
|
background: var(--outside);
|
|
flex-direction: column;
|
|
overflow: auto;
|
|
z-index: 1;
|
|
}
|
|
|
|
#feed_list > p {
|
|
font-size: 13px;
|
|
opacity: 0.5;
|
|
padding: 5px 20px;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
#feed_list > a {
|
|
padding: 10px 20px;
|
|
transition: 0.2s background;
|
|
}
|
|
|
|
#feed_list > .selected {
|
|
background-color: var(--accent);
|
|
color: var(--foreground);
|
|
}
|
|
|
|
#feed_list > a:not(.selected):hover {
|
|
background-color: var(--foreground);
|
|
}
|
|
|
|
/* Wiki Pages */
|
|
|
|
#wiki {
|
|
background: var(--foreground);
|
|
padding: 35px;
|
|
}
|
|
|
|
#top {
|
|
background: var(--highlighted);
|
|
width: 100%;
|
|
display: flex;
|
|
}
|
|
|
|
#top > * {
|
|
flex-grow: 1;
|
|
text-align: center;
|
|
height: 35px;
|
|
line-height: 35px;
|
|
}
|
|
|
|
#top > div {
|
|
border-bottom: 2px solid var(--text);
|
|
}
|
|
|
|
/* Sorting and Search */
|
|
|
|
select, #search, #sort_options, #inside, #searchbox > *, #sort_submit {
|
|
height: 40px;
|
|
}
|
|
|
|
.search_label {
|
|
max-width: 300px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
select {
|
|
background: var(--outside);
|
|
transition: 0.2s background;
|
|
}
|
|
|
|
select, #search {
|
|
border: none;
|
|
padding: 0 15px;
|
|
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
border-radius: 5px 0px 0px 5px;
|
|
}
|
|
|
|
#searchbox {
|
|
grid-area: searchbox;
|
|
display: flex;
|
|
box-shadow: var(--shadow);
|
|
border-radius: 5px;
|
|
}
|
|
|
|
#searchbox > *, #sort_submit { background: var(--highlighted); }
|
|
|
|
#search {
|
|
border-right: 2px var(--outside) solid;
|
|
min-width: 0;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
#inside {
|
|
display: flex;
|
|
align-items: center;
|
|
border-right: 2px var(--outside) solid;
|
|
padding: 0 10px;
|
|
max-width: 50%;
|
|
}
|
|
|
|
#restrict_sr { margin-right: 5px; }
|
|
|
|
input[type="submit"], button.submit {
|
|
border: 0;
|
|
border-radius: 0px 5px 5px 0px;
|
|
}
|
|
|
|
button.submit {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
select:hover { background: var(--foreground); }
|
|
|
|
input[type="submit"]:hover { color: var(--accent); }
|
|
button.submit:hover > svg { stroke: var(--accent); }
|
|
|
|
#timeframe {
|
|
margin: 0 2px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
#sort_options + #timeframe:not(#search_sort > #timeframe) {
|
|
margin-left: 10px;
|
|
border-radius: 5px 0px 0px 5px;
|
|
}
|
|
|
|
#search_sort {
|
|
background: var(--highlighted);
|
|
border-radius: 5px;
|
|
overflow: auto;
|
|
}
|
|
|
|
#search_sort > #search {
|
|
border: 0;
|
|
background: transparent;
|
|
}
|
|
|
|
#search_sort > *, #searchbox > * { font-size: 15px; }
|
|
|
|
#search_sort > :not(:first-child), #search_sort > #sort_options {
|
|
margin: 0;
|
|
border-radius: 0;
|
|
border-right: 0;
|
|
border-left: 2px solid var(--background);
|
|
box-shadow: none;
|
|
background: transparent;
|
|
}
|
|
|
|
#sort, #search_sort {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
#sort_options, footer > a {
|
|
border-radius: 5px;
|
|
box-shadow: var(--shadow);
|
|
background: var(--outside);
|
|
display: flex;
|
|
overflow: auto;
|
|
}
|
|
|
|
#sort_options > a, footer > a {
|
|
color: var(--text);
|
|
padding: 10px 20px;
|
|
text-align: center;
|
|
cursor: pointer;
|
|
transition: 0.2s background;
|
|
}
|
|
|
|
#sort_options > a.selected {
|
|
background: var(--accent);
|
|
color: var(--foreground);
|
|
}
|
|
|
|
#sort_options > a:not(.selected):hover {
|
|
background: var(--foreground);
|
|
}
|
|
|
|
#search_subreddits {
|
|
border-radius: 5px;
|
|
background: var(--post);
|
|
box-shadow: var(--shadow);
|
|
transition: 0.2s background;
|
|
border: var(--panel-border);
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.search_subreddit {
|
|
padding: 16px 20px;
|
|
display: flex;
|
|
}
|
|
|
|
.search_subreddit_left {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.search_subreddit_left:not(:empty) {
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.search_subreddit_left img {
|
|
width: 35px;
|
|
height: 35px;
|
|
border-radius: 100%;
|
|
}
|
|
|
|
.search_subreddit_right {
|
|
overflow: auto;
|
|
}
|
|
|
|
a.search_subreddit:hover {
|
|
text-decoration: none;
|
|
background: var(--foreground);
|
|
}
|
|
|
|
.search_subreddit:not(:last-child) {
|
|
border-bottom: 1px solid var(--highlighted);
|
|
}
|
|
|
|
.search_subreddit_header {
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.search_subreddit_name {
|
|
font-weight: bold;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.search_subreddit_description {
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
#more_subreddits {
|
|
justify-content: center;
|
|
color: var(--accent);
|
|
font-weight: 600;
|
|
text-align: center;
|
|
}
|
|
|
|
/* Post */
|
|
|
|
.sep {
|
|
display: none;
|
|
}
|
|
|
|
.thread {
|
|
word-break: break-word;
|
|
}
|
|
|
|
.thread_nav {
|
|
color: var(--accent);
|
|
font-weight: bold;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
.post {
|
|
border-radius: 5px;
|
|
background: var(--post);
|
|
box-shadow: var(--shadow);
|
|
display: grid;
|
|
transition: 0.2s background;
|
|
grid-template: "post_score post_header post_thumbnail" auto
|
|
"post_score post_title post_thumbnail" 1fr
|
|
"post_score post_media post_thumbnail" auto
|
|
"post_score post_body post_thumbnail" auto
|
|
"post_score post_notification post_thumbnail" auto
|
|
"post_score post_footer post_thumbnail" auto
|
|
/ minmax(40px, auto) minmax(0, 1fr) fit-content(min(20%, 152px));
|
|
}
|
|
|
|
.post:not(:last-child) { margin-bottom: 10px; }
|
|
|
|
.post:hover {
|
|
background: var(--foreground);
|
|
}
|
|
|
|
.post_score {
|
|
padding-top: 16px;
|
|
padding-left: 12px;
|
|
font-size: 13px;
|
|
font-weight: bold;
|
|
color: var(--accent);
|
|
grid-area: post_score;
|
|
text-align: center;
|
|
border-radius: 5px 0 0 5px;
|
|
transition: 0.2s background;
|
|
}
|
|
|
|
.post_score .label {
|
|
display: none;
|
|
}
|
|
|
|
.post_header {
|
|
margin: 15px 20px 5px 12px;
|
|
grid-area: post_header;
|
|
line-height: 25px;
|
|
}
|
|
|
|
.post_subreddit {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.post_title {
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
line-height: 1.5;
|
|
margin: 5px 15px 5px 12px;
|
|
grid-area: post_title;
|
|
}
|
|
|
|
.post:not(.highlighted) .post_title a:visited {
|
|
color: var(--visited);
|
|
}
|
|
|
|
.post_notification {
|
|
grid-area: post_notification;
|
|
margin: 5px 15px;
|
|
text-align: center;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.post_notification a {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.post_flair {
|
|
background: var(--accent);
|
|
color: var(--background);
|
|
padding: 4px;
|
|
margin-right: 5px;
|
|
border-radius: 5px;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.awards {
|
|
background-color: var(--foreground);
|
|
border-radius: 5px;
|
|
margin: auto;
|
|
padding: 5px;
|
|
}
|
|
|
|
.awards .award {
|
|
margin-right: 2px;
|
|
}
|
|
|
|
.award {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
.award > img {
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.author_flair:empty, .post_flair:empty {
|
|
display: none;
|
|
}
|
|
|
|
.emoji {
|
|
width: 1.25em;
|
|
height: 1.25em;
|
|
display: inline-block;
|
|
background-size: contain;
|
|
background-position: 50% 50%;
|
|
background-repeat: no-repeat;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.nsfw {
|
|
color: var(--nsfw);
|
|
margin-left: 5px;
|
|
border: 1px solid var(--nsfw);
|
|
padding: 3px;
|
|
font-size: 12px;
|
|
border-radius: 5px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.post_media_image, .post .__NoScript_PlaceHolder__, .post_media_video, .gallery {
|
|
max-width: calc(100% - 40px);
|
|
grid-area: post_media;
|
|
margin: 15px auto 5px auto;
|
|
height: auto;
|
|
}
|
|
|
|
|
|
.post_media_video.short {
|
|
max-height: 512px;
|
|
width: auto;
|
|
}
|
|
|
|
.post_media_image.short svg, .post_media_image.short img{
|
|
max-height: 512px;
|
|
width: auto;
|
|
}
|
|
|
|
.post_media_image svg{
|
|
max-width: 100%;
|
|
height: auto;
|
|
align-self: center;
|
|
background-color: var(--highlighted);
|
|
background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 100 100' width='100' height='100' xmlns='http://www.w3.org/2000/svg'><path d='M15,20 h70 a10,10 0 0 1 10,10 v45 a10,10 0 0 1 -10,10 h-70 a10,10 0 0 1 -10,-10 v-45 a10,10 0 0 1 10,-10 z' fill='none' stroke='rgba(128,128,128,0.5)' stroke-width='3' /><path d='M15,75 l25,-35 l15,20 l10,-10 l20, 25 z' stroke='none' fill='rgba(128,128,128,0.5)' /><circle cx='75' cy='35' r='7' stroke='none' fill='rgba(128,128,128,0.5)'/></svg>");
|
|
background-position: 50%;
|
|
background-repeat: no-repeat;
|
|
vertical-align: bottom;
|
|
}
|
|
|
|
.post_media_image img {
|
|
max-width: 100%;
|
|
vertical-align: bottom;
|
|
}
|
|
|
|
.gallery img {
|
|
max-width: 100%;
|
|
vertical-align: bottom;
|
|
}
|
|
|
|
.gallery figcaption {
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.gallery .outbound_url {
|
|
color: var(--accent);
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
display: block;
|
|
padding-top: 5px;
|
|
}
|
|
|
|
#post_url {
|
|
color: var(--accent);
|
|
margin: 5px 15px;
|
|
grid-area: post_media;
|
|
}
|
|
|
|
.post_body {
|
|
opacity: 0.9;
|
|
font-weight: normal;
|
|
padding: 5px 15px 5px 12px;
|
|
grid-area: post_body;
|
|
width: calc(100% - 30px);
|
|
}
|
|
|
|
/* Used only for text post preview */
|
|
.post_preview {
|
|
-webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);;
|
|
mask-image: linear-gradient(180deg,#000 60%,transparent);
|
|
opacity: 0.8;
|
|
max-height: 250px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.post_footer {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
opacity: 0.5;
|
|
font-size: 14px;
|
|
grid-area: post_footer;
|
|
margin: 5px 20px 15px 15px;
|
|
}
|
|
|
|
.post_comments {
|
|
font-weight: bold;
|
|
}
|
|
|
|
#post_links {
|
|
display: flex;
|
|
list-style: none;
|
|
padding: 0;
|
|
font-weight: bold;
|
|
}
|
|
|
|
#post_links > li {
|
|
margin-right: 15px;
|
|
}
|
|
|
|
.post_thumbnail {
|
|
border-radius: 5px;
|
|
border: var(--panel-border);
|
|
display: grid;
|
|
overflow: hidden;
|
|
background-color: var(--background);
|
|
grid-area: post_thumbnail;
|
|
margin: 5px;
|
|
}
|
|
|
|
.post_thumbnail svg {
|
|
grid-area: 1 / 1 / 2 / 2;
|
|
width: 100%;
|
|
height: auto;
|
|
object-fit: cover;
|
|
align-self: center;
|
|
justify-self: center;
|
|
}
|
|
|
|
.post_thumbnail.no_thumbnail {
|
|
background-color: var(--highlighted);
|
|
}
|
|
|
|
.post_thumbnail.no_thumbnail svg {
|
|
grid-area: 1 / 1 / 2 / 2;
|
|
align-self: center;
|
|
justify-self: center;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.post_thumbnail span {
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
text-align: center;
|
|
background-color: rgba(0,0,0,0.8);
|
|
color: white;
|
|
grid-area: 1 / 1 / 2 / 2;
|
|
padding: 5px;
|
|
align-self: end;
|
|
}
|
|
|
|
.post_thumbnail img {
|
|
max-width: 100%;
|
|
}
|
|
|
|
.stickied {
|
|
--accent: var(--green);
|
|
border: 1px solid var(--green);
|
|
}
|
|
|
|
/* Comment */
|
|
|
|
.comment {
|
|
margin: 10px 0;
|
|
border-radius: 5px;
|
|
display: flex;
|
|
}
|
|
|
|
.comment_left, .comment_right {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.comment_left {
|
|
text-align: center;
|
|
min-width: 50px;
|
|
padding: 5px 0;
|
|
align-items: center;
|
|
}
|
|
|
|
.comment_title { font-size: 20px; }
|
|
.comment_link { text-decoration: underline; }
|
|
.comment_author { opacity: 0.9; }
|
|
|
|
.author_flair {
|
|
background: var(--highlighted);
|
|
color: var(--text);
|
|
padding: 5px;
|
|
margin-right: 5px;
|
|
border-radius: 5px;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.comment_subreddit {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.comment_score {
|
|
color: var(--accent);
|
|
background: var(--foreground);
|
|
min-width: 40px;
|
|
border-radius: 5px;
|
|
padding: 10px 0;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.comment_right {
|
|
word-wrap: anywhere;
|
|
padding: 10px 0 10px 5px;
|
|
flex-grow: 1;
|
|
flex-shrink: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.comment_data > * {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.comment_image {
|
|
max-width: 500px;
|
|
align-self: center;
|
|
}
|
|
|
|
.comment_body {
|
|
opacity: 0.9;
|
|
font-weight: normal;
|
|
padding: 5px 5px;
|
|
margin: 5px 0;
|
|
overflow: auto;
|
|
}
|
|
|
|
.comment_body.highlighted {
|
|
background: var(--highlighted);
|
|
}
|
|
|
|
.comment_body > p:not(:first-child) {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.comment_body a {
|
|
text-decoration: underline;
|
|
color: var(--accent);
|
|
}
|
|
|
|
.deeper_replies {
|
|
color: var(--accent);
|
|
margin-left: 15px;
|
|
}
|
|
|
|
::marker {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.replies > .comment {
|
|
margin-left: -20px;
|
|
padding: 5px;
|
|
}
|
|
|
|
.created {
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.edited {
|
|
opacity: 0.4;
|
|
font-style: italic;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.line {
|
|
width: 2px;
|
|
height: 100%;
|
|
background: var(--foreground);
|
|
}
|
|
|
|
summary.comment_data {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.moderator, .admin { opacity: 1; }
|
|
.op, .moderator, .admin { font-weight: bold; }
|
|
|
|
.op { color: var(--accent); }
|
|
.moderator { color: var(--green); }
|
|
.admin { color: var(--admin); }
|
|
|
|
/* Layouts */
|
|
|
|
.compact .post:not(.highlighted) {
|
|
border-radius: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.compact .post:first-of-type {
|
|
border-radius: 5px 5px 0 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.compact .post:last-of-type {
|
|
border-radius: 0 0 5px 5px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.compact .post.highlighted { border-radius: 5px; }
|
|
.compact .post:not(:last-of-type):not(.highlighted):not(.stickied) { border-bottom: 0; }
|
|
|
|
.compact .post_score {
|
|
padding-top: 15px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.compact .post_header {
|
|
margin: 11px 15px 2.5px 12px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.compact .post_title, .compact #post_url, .compact .post_body {
|
|
margin: 2.5px 15px;
|
|
}
|
|
|
|
.compact .post_preview {
|
|
display: none;
|
|
}
|
|
|
|
.compact .post_media {
|
|
max-width: calc(100% - 30px);
|
|
margin: 2.5px auto;
|
|
}
|
|
|
|
.compact .post_footer {
|
|
margin: 5px 15px 15px 15px;
|
|
}
|
|
|
|
.compact .post_thumbnail {
|
|
width: 75px;
|
|
height: 75px;
|
|
}
|
|
|
|
.compact footer {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
/* Settings */
|
|
|
|
#settings {
|
|
max-width: 450px;
|
|
}
|
|
|
|
#settings_note {
|
|
font-size: 14px;
|
|
margin-top: 10px;
|
|
opacity: 0.75;
|
|
}
|
|
|
|
#settings_note a {
|
|
color: var(--accent);
|
|
}
|
|
|
|
|
|
.prefs {
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 20px;
|
|
background: var(--post);
|
|
border-radius: 5px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.prefs > div {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
height: 35px;
|
|
align-items: center;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.prefs > p {
|
|
font-weight: 500;
|
|
}
|
|
|
|
.prefs select {
|
|
border-radius: 5px;
|
|
box-shadow: var(--shadow);
|
|
margin-left: 20px;
|
|
background: var(--foreground);
|
|
}
|
|
|
|
aside.prefs {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
#save {
|
|
background: var(--highlighted);
|
|
padding: 10px 15px;
|
|
border-radius: 5px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
input[type="submit"] {
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
}
|
|
|
|
#settings_subs .unsubscribe {
|
|
margin-left: 30px;
|
|
}
|
|
|
|
#settings_subs a {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.helper {
|
|
padding: 10px;
|
|
width: 250px;
|
|
background: var(--highlighted) !important;
|
|
}
|
|
|
|
/* Markdown */
|
|
|
|
.md {
|
|
width: 100%;
|
|
}
|
|
|
|
.md > *:not(:first-child) {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.md h1 { font-size: 22px; }
|
|
.md h2 { font-size: 20px; }
|
|
.md h3 { font-size: 18px; }
|
|
.md h4 { font-size: 16px; }
|
|
.md h5 { font-size: 14px; }
|
|
.md h6 { font-size: 12px; }
|
|
|
|
.md blockquote {
|
|
padding: 10px;
|
|
margin: 4px 0 4px 5px;
|
|
border-left: 4px solid var(--highlighted);
|
|
background: var(--post);
|
|
}
|
|
|
|
.md a, .md a * {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.md .md-spoiler-text {
|
|
background: var(--highlighted);
|
|
color: transparent;
|
|
}
|
|
|
|
.md .md-spoiler-text:hover {
|
|
background: var(--foreground);
|
|
color: var(--text);
|
|
}
|
|
|
|
.md li { margin: 10px 0; }
|
|
.toc_child { list-style: none; }
|
|
|
|
.md pre {
|
|
background: var(--outside);
|
|
padding: 20px;
|
|
margin-top: 10px;
|
|
border-radius: 5px;
|
|
box-shadow: var(--shadow);
|
|
overflow: auto;
|
|
}
|
|
|
|
.md table {
|
|
margin: 5px;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.md code {
|
|
font-family: monospace, sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.md code:not(.md pre > code) { background: var(--highlighted); }
|
|
|
|
/* Tables */
|
|
|
|
table, td, th { border: var(--panel-border); }
|
|
|
|
table {
|
|
border-width: 3px;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
td, th {
|
|
padding: 10px;
|
|
}
|
|
|
|
/* Errors */
|
|
|
|
#error { text-align: center; }
|
|
#error h1 { margin-bottom: 10px; }
|
|
#error h3 { opacity: 0.85; }
|
|
#error a { color: var(--accent); }
|
|
|
|
/* Mobile */
|
|
|
|
@media screen and (max-width: 800px) {
|
|
body { padding-top: 120px }
|
|
|
|
main {
|
|
flex-direction: column-reverse;
|
|
padding: 10px;
|
|
margin: 0 0 10px 0;
|
|
max-width: 100%;
|
|
}
|
|
|
|
nav {
|
|
grid-template-areas: 'logo links' 'searchbox searchbox';
|
|
padding: 10px;
|
|
width: calc(100% - 20px);
|
|
}
|
|
|
|
nav #links { margin-left: auto; }
|
|
nav #links span { display: none; }
|
|
nav #links svg { display: block; }
|
|
|
|
#subscriptions { position: unset; }
|
|
|
|
#sub_list {
|
|
left: 10px;
|
|
right: 10px;
|
|
min-width: auto;
|
|
}
|
|
|
|
#settings {
|
|
max-width: unset;
|
|
}
|
|
|
|
aside, #subreddit, #user {
|
|
margin: 0;
|
|
max-width: 100%;
|
|
}
|
|
|
|
#user, #sidebar { margin: 20px 0; }
|
|
#logo, #links { margin-bottom: 5px; }
|
|
#searchbox { width: calc(100vw - 35px); }
|
|
}
|
|
|
|
@media screen and (max-width: 480px) {
|
|
body { padding-top: 100px; }
|
|
#version { display: none; }
|
|
|
|
.post {
|
|
grid-template: "post_header post_header post_thumbnail" auto
|
|
"post_title post_title post_thumbnail" 1fr
|
|
"post_media post_media post_thumbnail" auto
|
|
"post_body post_body post_thumbnail" auto
|
|
"post_notification post_notification post_thumbnail" auto
|
|
"post_score post_footer post_thumbnail" auto
|
|
/ auto 1fr fit-content(min(20%, 152px));
|
|
}
|
|
|
|
.post_score {
|
|
margin: 5px 0px 20px 15px;
|
|
padding: 0;
|
|
}
|
|
|
|
.compact .post_score { padding: 0; }
|
|
|
|
.post_score::before { content: "↑" }
|
|
|
|
.post_header { font-size: 14px; }
|
|
.post_footer { margin-left: 15px; }
|
|
|
|
.replies > .comment {
|
|
margin-left: -12px;
|
|
padding: 5px 0;
|
|
}
|
|
|
|
.comment_left {
|
|
min-width: auto;
|
|
padding: 5px 0px;
|
|
align-items: initial;
|
|
margin-top: -5px;
|
|
}
|
|
|
|
.line {
|
|
margin-left: 5px;
|
|
}
|
|
|
|
/* .thread { margin-left: -5px; } */
|
|
.comment_right { padding: 5px 0 10px 2px; }
|
|
.comment_author { margin-left: 12px; }
|
|
.comment_data { margin-left: 12px; }
|
|
.comment_data::marker { font-size: 25px; }
|
|
.created { width: 100%; }
|
|
|
|
.comment_score {
|
|
min-width: 32px;
|
|
height: 20px;
|
|
font-size: 15px;
|
|
padding: 7px 0px;
|
|
margin-right: -5px;
|
|
}
|
|
}
|