pinafore/src/scss/global.scss

252 lines
4.8 KiB
SCSS
Raw Normal View History

@font-face {
font-family: PinaforeRegular;
src: local("BlinkMacSystemFont"),
local("Segoe UI"),
local("Roboto"),
local("Oxygen-Sans"),
local("Ubuntu"),
local("Cantarell"),
local("Fira Sans"),
local("Droid Sans"),
local("Helvetica Neue");
}
@font-face {
font-family: PinaforeEmoji;
src: local("Apple Color Emoji"),
local("Segoe UI Emoji"),
local("Segoe UI Symbol"),
local("Twemoji Mozilla"),
local("Noto Color Emoji"),
local("EmojiOne Color"),
local("Android Emoji");
}
2018-01-12 17:36:31 +01:00
body {
margin: 0;
font-family: system-ui, -apple-system, PinaforeRegular, sans-serif;
2018-01-12 17:36:31 +01:00
font-size: 14px;
2018-02-11 01:22:12 +01:00
line-height: 1.4;
2018-01-12 18:05:03 +01:00
color: var(--body-text-color);
2018-01-12 18:01:46 +01:00
background: var(--body-bg);
-webkit-tap-highlight-color: transparent; // fix for blue background on spoiler tap on Chrome for Android
overflow-x: hidden; // Prevent horizontal scrolling on mobile Firefox on small screens
2018-01-12 17:36:31 +01:00
}
.main-content {
contain: content; // see https://www.w3.org/TR/2018/CR-css-contain-1-20181108/#valdef-contain-content
// these paddings should be kept in sync with getMainTopMargin.js
@supports (-webkit-overflow-scrolling: touch) {
// fixes iOS Safari horizontal scrolling (see https://github.com/nolanlawson/pinafore/issues/667)
overflow-x: hidden;
}
padding-top: 42px;
2018-03-27 18:34:29 +02:00
@media (max-width: 991px) {
padding-top: 52px;
2018-03-27 18:34:29 +02:00
}
2018-01-31 07:40:40 +01:00
@media (max-width: 767px) {
padding-top: 62px;
2018-01-31 07:40:40 +01:00
}
2018-01-16 03:29:28 +01:00
}
main {
2018-01-12 17:36:31 +01:00
position: relative;
2018-01-16 06:58:31 +01:00
width: 602px;
max-width: 100vw;
padding: 0;
2018-01-12 17:36:31 +01:00
box-sizing: border-box;
margin: 30px auto 15px;
2018-01-12 18:01:46 +01:00
background: var(--main-bg);
border: 1px solid var(--main-border);
2018-01-12 17:36:31 +01:00
border-radius: 1px;
2018-03-17 02:03:35 +01:00
min-height: 70vh;
2018-01-14 20:34:53 +01:00
@media (max-width: 767px) {
2018-01-16 03:29:28 +01:00
margin: 5px auto 15px;
2018-01-14 20:34:53 +01:00
}
2018-01-12 17:36:31 +01:00
}
2018-03-07 18:25:07 +01:00
footer {
width: 602px;
max-width: 100vw;
box-sizing: border-box;
2018-03-27 18:34:29 +02:00
margin: 15px auto;
2018-03-07 18:25:07 +01:00
border-radius: 1px;
background: var(--main-bg);
font-size: 0.9em;
2018-03-11 20:13:12 +01:00
padding: 20px;
2018-03-07 18:25:07 +01:00
border: 1px solid var(--main-border);
}
2018-01-12 17:36:31 +01:00
h1, h2, h3, h4, h5, h6 {
margin: 0 0 0.5em 0;
font-weight: 400;
line-height: 1.2;
}
h1 {
font-size: 2em;
}
a {
2018-01-12 18:01:46 +01:00
color: var(--anchor-text);
2018-01-12 17:36:31 +01:00
text-decoration: none;
&:visited {
color: var(--anchor-text);
}
&:hover {
text-decoration: underline;
}
2018-01-12 17:36:31 +01:00
}
input {
2018-01-12 18:01:46 +01:00
border: 1px solid var(--input-border);
2018-01-12 17:36:31 +01:00
padding: 5px;
2018-02-26 01:26:43 +01:00
box-sizing: border-box;
2018-01-12 17:36:31 +01:00
}
input[type=search] {
-webkit-appearance: none; // reset Safari user agent stylesheet
}
// Fixes gray/black background when using a dark GTK theme
input, textarea {
background: inherit;
color: inherit;
}
textarea {
font-family: system-ui, -apple-system, PinaforeRegular, sans-serif, PinaforeEmoji;
}
2018-03-07 08:27:36 +01:00
button, .button {
2018-01-12 17:36:31 +01:00
font-size: 1.2em;
2018-01-12 18:01:46 +01:00
background: var(--button-bg);
2018-01-12 17:36:31 +01:00
border-radius: 2px;
padding: 10px 15px;
2018-01-12 18:01:46 +01:00
border: 1px solid var(--button-border);
2018-01-12 17:36:31 +01:00
cursor: pointer;
2018-01-12 18:01:46 +01:00
color: var(--button-text);
2018-01-12 17:36:31 +01:00
2018-01-14 03:59:49 +01:00
&:hover {
background: var(--button-bg-hover);
2018-03-07 08:27:36 +01:00
text-decoration: none;
2018-01-14 03:59:49 +01:00
}
2018-01-12 17:36:31 +01:00
2018-01-14 03:59:49 +01:00
&:active {
background: var(--button-bg-active);
}
2018-01-12 17:36:31 +01:00
2018-01-14 03:59:49 +01:00
&[disabled] {
opacity: 0.35;
pointer-events: none;
cursor: not-allowed;
}
2018-01-12 17:36:31 +01:00
2018-01-14 03:59:49 +01:00
&.primary {
border: 1px solid var(--button-primary-border);
background: var(--button-primary-bg);
color: var(--button-primary-text);
&:hover {
background: var(--button-primary-bg-hover);
}
2018-01-12 17:36:31 +01:00
2018-01-14 03:59:49 +01:00
&:active {
background: var(--button-primary-bg-active);
}
}
2018-01-12 17:36:31 +01:00
}
p, label, input {
font-size: 1.3em;
}
ul, li, p {
padding: 0;
margin: 0;
}
2018-01-14 05:33:14 +01:00
.hidden {
opacity: 0;
2018-01-21 19:53:15 +01:00
}
*:focus {
outline: 2px solid var(--focus-outline);
}
.container:focus {
// the outline causes choppy rendering on Edge and isn't visible or necessary anyway
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17343598/
outline: none;
}
2018-01-21 19:53:15 +01:00
button::-moz-focus-inner {
border: 0;
}
2018-02-07 05:54:49 +01:00
/* Firefox hacks to remove ugly red border.
Unnecessary since it gives a warning if you submit an empty field anyway. */
input:required, input:invalid {
box-shadow: none;
2018-02-26 05:45:11 +01:00
}
textarea {
font-family: inherit;
font-size: inherit;
box-sizing: border-box;
2018-03-03 06:55:04 +01:00
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
2018-03-31 02:25:22 +02:00
25% {
transform: rotate(90deg);
}
2018-03-03 06:55:04 +01:00
50% {
transform: rotate(180deg);
}
2018-03-31 02:25:22 +02:00
75% {
transform: rotate(270deg);
}
2018-03-03 06:55:04 +01:00
100% {
transform: rotate(360deg);
}
}
.spin {
2018-04-03 17:58:59 +02:00
animation: spin 1.5s infinite linear;
2018-03-24 17:38:04 +01:00
}
.ellipsis::after {
content: "\2026";
}
/* via https://stackoverflow.com/a/19758620 */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
/* this gets injected as raw HTML, so it's easiest to just define it in global.scss */
.inline-custom-emoji {
width: 1.4em;
height: 1.4em;
margin: -0.1em 0;
object-fit: contain;
vertical-align: middle;
}
.inline-emoji {
font-family: PinaforeEmoji, sans-serif;
}