oasis/src/assets/style.css

341 lines
6.6 KiB
CSS
Raw Normal View History

:root {
2019-09-27 16:50:37 +00:00
--thin-stroke: 1px;
--medium-stroke: 3px;
--heavy-stroke: 6px;
--common-radius: 2px;
2019-09-27 16:50:37 +00:00
/* light mode */
2019-09-27 16:50:37 +00:00
--blue: hsl(240, 75%, 50%);
--highlight-shadow: hsl(240, 66%, 92%);
--highlight: hsl(240, 88%, 88%);
--almost-white: hsl(240, 12.5%, 98.4%);
--off-white: hsl(240, 12%, 92%);
--discreet: hsl(240, 12%, 96%);
--primary: hsl(240, 17%, 17%);
--red: hsl(330, 75%, 50%);
--secondary: hsl(240, 8%, 38%);
--background: var(--almost-white);
2019-09-27 16:50:37 +00:00
--heavy: black;
/* dark mode
2019-09-27 16:50:37 +00:00
--blue: hsl(240, 50%, 50%);
--highlight-shadow: hsl(240, 66%, 25%);
--highlight: hsl(240, 88%, 33%);
--almost-white: hsl(240, 12.5%, 1.6%);
--off-white: hsl(240, 12%, 12.5%);
--discreet: hsl(240, 12%, 4%);
--primary: hsl(240, 8.3%, 66%);
--red: hsl(330, 75%, 50%);
--secondary: hsl(240, 8%, 62%);
--background: var(--almost-white);
--heavy: hsl(240, 12.5%, 75%);
*/
}
2019-09-24 21:51:15 +00:00
html {
display: flex;
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
"Roboto",
"Oxygen",
"Ubuntu",
"Cantarell",
"Fira Sans",
"Droid Sans",
"Helvetica Neue",
sans-serif;
justify-content: center;
font-size: 12pt;
line-height: 1.5;
margin: 0;
padding: 0;
}
/* https://www.desmos.com/calculator/3elcf5cwhn */
h1 { font-size: 150%; }
h2 { font-size: 128%; }
h3 { font-size: 120%; }
h4 { font-size: 116%; }
h5 { font-size: 113%; }
h6 { font-size: 111%; }
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0.5em 0;
}
ul,
ol {
padding-left: 1.5rem;
}
a {
color: var(--blue);
}
button {
cursor: pointer;
}
2019-06-25 17:18:45 +00:00
pre {
2019-06-25 16:52:34 +00:00
overflow-x: auto;
2019-09-24 21:51:15 +00:00
background-color: var(--almost-white);
padding: 1rem;
font-size: 92%;
border-radius: var(--common-radius);
border: var(--thin-stroke) solid var(--off-white);
}
.message.private {
background-color: var(--discreet);
}
.message.reply {
margin-top: 0;
margin-bottom: -1px;
}
.message.thread-target {
box-shadow: 0 0 0 var(--medium-stroke) var(--highlight-shadow);
border-color: var(--highlight);
}
.message img,
.message video {
max-width: 100%;
2019-09-17 01:10:49 +00:00
max-height: 30em;
border: var(--thin-stroke) dotted var(--off-white);
}
.message > :first-child {
margin-top: 0;
padding-top: 0;
}
.message > :last-child {
margin-bottom: 0;
padding-bottom: 0;
}
.message code {
max-width: 100%;
overflow-wrap: break-word;
padding: 0.125em 0.25em;
margin: 0;
font-size: 85%;
background-color: var(--almost-white);
border-radius: var(--common-radius);
border: var(--thin-stroke) solid var(--off-white);
}
2019-06-25 16:52:34 +00:00
.message pre code {
color: inherit;
padding: 0;
margin: 0;
font-size: 100%;
background-color: initial;
border: initial;
border-radius: initial;
2019-06-25 16:52:34 +00:00
}
@media screen {
html {
min-height: 100%;
color: var(--primary);
2019-09-27 16:50:37 +00:00
background-color: var(--background);
}
body {
2019-06-29 21:19:25 +00:00
width: 100%;
2019-09-24 21:51:15 +00:00
max-width: 42rem;
margin: 0 1rem;
overflow: scroll;
}
}
nav > ul > li > a {
color: var(--secondary);
text-decoration: none;
font-weight: bold;
}
.message {
padding: 1.5rem;
margin: 1rem 0;
border-radius: var(--common-radius);
border: var(--thin-stroke) solid var(--off-white);
2019-06-28 20:55:05 +00:00
word-wrap: break-word;
}
2019-06-28 20:55:05 +00:00
.message > header.metadata {
height: 1.5rem;
display: flex;
}
.message > header > a > .avatar {
width: 1.5rem;
height: 1.5rem;
border-radius: var(--common-radius);
margin-right: 0.5rem;
}
.message > footer > a,
.message > footer > form > button {
color: var(--secondary);
font-weight: bold;
}
.message > header > .text > .author {
font-weight: bold;
}
.message > header > .text > .author > a {
2019-09-27 16:50:37 +00:00
color: var(--heavy);
text-decoration: none;
}
/*
* HACK: centered-footer
*
* When someone likes a message we want to submit the form and then redirect
* them back to the original page. Unfortunately when you link to anchor tags
* that scrolls the browser so that they're at the *top* of the page, not the
* center of the page. In our view we have an empty div with an appropriate
* anchor tag, so here we use CSS to center it on the screen.
*
* The code below creates padding-top that takes up 50% of the height of the
* viewport and then gets rid of it with negative margin. This has no effect
* on the display of the item, but means that when we link to the anchor tag
* it centers this empty element vertically on the screen.
*
* We also use `pointer-events: none` to ensure that this invisible div doesn't
* capture cursor events (clicks, drags, etc) on surrounding elements, because
* otherwise we could have a problem where someone clicks above the invisible
* div but the browser things they're clicking the gigantic amount of padding.
*/
.message > .centered-footer {
padding-top: 50vh;
margin-top: -50vh;
pointer-events: none;
}
2019-08-07 02:44:09 +00:00
.message > footer {
display: flex;
justify-content: space-between;
}
.message > footer > * {
text-decoration: none;
}
.message > footer > form > button.liked {
color: var(--red);
}
.message > footer > form {
display: inline-block;
}
.message > footer > form > button {
display: inline-block;
border: 0;
background: transparent;
cursor: pointer;
padding: 0;
}
.message blockquote {
margin-left: 0;
border-left: var(--heavy-stroke) solid var(--off-white);
padding-left: 1rem;
}
2019-09-19 20:31:47 +00:00
nav > ul {
display: flex;
justify-content: space-between;
margin: 1rem 0;
2019-09-19 20:31:47 +00:00
padding: 0;
}
nav > ul > li {
list-style: none;
}
.profile {
margin-top: 1.5rem;
display: flex;
margin-bottom: 1.5rem;
}
.profile > img,
.profile > h1 {
display: inline-block;
}
.profile > img {
width: 4rem;
height: 4rem;
margin-right: 2rem;
border-radius: var(--common-radius);
}
progress {
display: block;
width: 100%;
}
textarea {
2019-09-27 16:50:37 +00:00
background-color: var(--background);
box-sizing: border-box;
display: block;
font-size: 1rem;
padding: 1rem;
resize: vertical;
width: 100%;
margin: 1rem 0;
height: 6rem;
transition: 0.0625s all ease;
border: var(--thin-stroke) solid var(--off-white);
border-radius: var(--common-radius);
}
2019-08-13 20:53:11 +00:00
/*
* Make textaarea big when textarea siblings are active.
* Make textarea big when focus is in form.
*
* This ensures that trying to click the submit button doesn't change the form.
*/
*:active ~ textarea,
form:focus-within > textarea {
height: 12rem;
border-color: var(--highlight);
}
2019-08-13 20:53:11 +00:00
/* content warning! */
summary {
padding: 1rem 0.5rem;
background-color: hsl(45, 100%, 83%);
margin: 1rem 0;
cursor: pointer;
color: hsl(45, 100%, 20%);
border: var(--thin-stroke) solid hsl(45, 100%, 66%);
2019-08-13 20:53:11 +00:00
}
.md-mention {
-moz-user-select: all;
-ms-user-select: all;
-webkit-user-select: all;
user-select: all;
background: none;
margin: 0;
padding: 0;
border: 0;
}