philomena/assets/css/common/_base.scss

505 lines
8.4 KiB
SCSS
Raw Permalink Normal View History

2019-08-18 02:43:44 +02:00
/*
* This file contains base styles that are overridden by custom stylesheets. These stylesheets need
* to be placed in this directory, and they are imported at the bottom of the file.
*
2020-05-02 04:00:29 +02:00
* Define rules that are not supposed to be overridden after the @imports at the bottom of the file.
*/
2019-08-18 02:43:44 +02:00
2020-05-02 04:00:29 +02:00
@import "dimensions";
2019-08-18 02:43:44 +02:00
@import "global";
2019-12-06 22:38:36 +01:00
// Because FA is a SPECIAL SNOWFLAKE.
$fa-font-path: '@fortawesome/fontawesome-free/webfonts';
2019-12-06 22:38:36 +01:00
@import "@fortawesome/fontawesome-free/scss/fontawesome.scss";
@import "@fortawesome/fontawesome-free/scss/solid.scss";
@import "@fortawesome/fontawesome-free/scss/regular.scss";
@import "@fortawesome/fontawesome-free/scss/brands.scss";
@import "normalize-scss/sass/normalize/import-now";
2019-08-18 02:43:44 +02:00
body {
background-color: $background_color;
color: $foreground_color;
font-family: $font_family_base;
font-size: 13px;
margin: 0;
padding: 0;
2020-09-12 22:19:55 +02:00
line-height: 1.15;
2019-08-18 02:43:44 +02:00
}
/* normalize.css breakage */
sup, sub {
line-height: 1.15em;
}
sub {
bottom: -0.15em;
}
2019-08-18 02:43:44 +02:00
h1, h2, h3, h4, h5 {
font-weight: normal;
text-rendering: optimizeLegibility;
margin-bottom: 0.62em;
line-height: 1.15em;
2019-08-18 02:43:44 +02:00
}
h1 { font-size: 24px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
h4 {
font-size: 17px;
margin-top: 1em;
margin-bottom: 0.5em;
}
// Slightly dirty, no clean way to strip top margins off headers though
2019-08-18 02:43:44 +02:00
.remove-top-margin {
margin-top: 0;
}
h5 {
margin-top: 0.5em;
margin-bottom: 0.3em;
font-size: 15px;
}
h6 {
font-size: 10px;
margin: 2px;
margin-bottom: 0;
}
2021-09-22 21:55:06 +02:00
.paragraph {
2019-08-18 02:43:44 +02:00
hyphens: none;
2021-09-22 21:55:06 +02:00
margin-bottom: var(--padding-small);
margin-top: var(--padding-small);
2021-09-22 00:54:26 +02:00
margin-left: 2px;
line-height: 1.35em;
}
.communication__body__text .paragraph {
margin-bottom: var(--padding-normal);
2019-08-18 02:43:44 +02:00
}
2021-10-01 15:44:49 +02:00
.paragraph img, .communication__body__text img, .block__content img {
max-width: 100%;
}
2021-09-22 21:55:06 +02:00
p {
@extend .paragraph;
}
2019-08-18 02:43:44 +02:00
pre {
background-color: $meta_color;
padding: 10px;
font-size: 11px;
font-family: $font_family_monospace;
border: 1px solid $meta_border_color;
max-width: 100%;
2021-10-01 16:17:51 +02:00
overflow-y: hidden;
overflow-x: auto;
code {
border: 0;
background: 0;
padding: 0;
}
2019-08-18 02:43:44 +02:00
}
a, a:active, a:visited {
color: $link_color;
text-decoration: none;
}
a:hover {
color: $link_hover_color;
}
img {
margin: 0;
border: 0;
vertical-align: bottom;
}
.clearfix {
clear: both;
height: 0;
}
/* Child selectors, as opposed to flat BEM classes, are justified in this case.
* HTML tables are bulky to begin with; adding .table__row and .table__cell to every
* item will hinder the development speed and decrease readability. */
.table {
padding-left: 10px;
width: 100%;
border-collapse: collapse;
border: $border;
th {
font-weight: bold;
text-align: left;
padding: 5px;
&.center {
text-align: center;
}
}
> thead > tr {
background: $background_color;
}
> tbody {
border: $border;
> tr {
@include even-odd;
}
}
td {
padding: 5px;
}
}
.table__tiny-column {
width: 50px;
}
.border-vertical {
border-top: 2px solid $border_color;
}
.background-success {
background-color: $success_light_color;
}
.background-warning {
background-color: $warning_light_color;
}
.background-danger {
background-color: $danger_light_color;
}
hr {
border: 0;
height: 1px;
background: $border_color;
2021-10-01 15:44:49 +02:00
margin: var(--padding-small);
2019-08-18 02:43:44 +02:00
}
#error_explanation {
margin: 1em 0;
background: $warning_light_color;
border: 1px solid $warning_color;
padding: 0.62em;
li {
margin: 3px;
margin-left: 15px;
}
h2 {
font-size: 19px;
}
}
//rules page. API page also borrows stuff from here
.rule {
padding: 5px;
h2 {
background: $background_odd_color;
border: $border;
padding: 5px;
padding-bottom: 7px;
}
h2.important {
background: $danger_light_color;
border-color: $danger_color;
}
// Make HTML lists with multi-line text readable
ul {
margin: 0;
padding: 5px 20px;
}
li {
padding: 5px 0;
}
}
.walloftext {
font-size: 14px;
@media (max-width: 900px) {
width: 95%;
}
}
// Text Editor
2019-08-18 02:43:44 +02:00
blockquote {
margin: 1em 2em;
border: 1px dotted $foreground_color;
2021-10-04 23:52:28 +02:00
padding: var(--padding-small);
2019-08-18 02:43:44 +02:00
background-color: inherit;
}
2021-10-04 23:52:28 +02:00
blockquote .paragraph {
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
// Prevent blockquote from gaining far too much indentation and breaking.
blockquote blockquote blockquote blockquote blockquote blockquote {
margin: 1em 0;
padding: 1em 2px;
}
// Horizontal space is at a high premium on mobile.
@media (max-width: $min_px_width_for_desktop_layout) {
blockquote {
margin: 1em 4px;
2021-10-05 00:00:30 +02:00
padding: var(--padding-small) 4px;
}
}
2021-12-12 18:34:30 +01:00
.spoiler, .spoiler-revealed {
display: inline-block;
position: relative;
}
.spoiler::before, .spoiler-revealed::before {
content: ' ';
display: block;
position: absolute;
pointer-events: none;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: $admin_links_hover_color;
}
.spoiler:hover::before, .spoiler-revealed::before {
display: none;
}
2019-08-18 02:43:44 +02:00
.spoiler {
background-color: $admin_links_hover_color;
color: $admin_links_hover_color;
a {
color: $admin_links_hover_color;
}
code {
background: 0;
border: 0;
}
2019-08-18 02:43:44 +02:00
&:not(:hover) > .image-show-container {
background: $admin_links_hover_color;
> * {
visibility: hidden;
}
}
}
.spoiler:hover, .spoiler-revealed {
background-color: $admin_links_color;
color: $foreground_color;
a {
color: $link_color;
}
a:hover {
color: $link_dark_color;
}
code {
@extend code;
}
2019-08-18 02:43:44 +02:00
}
2019-12-26 06:03:27 +01:00
.literal {
white-space: pre-wrap;
}
.editor-syntax-reference {
2019-08-18 02:43:44 +02:00
margin-bottom: 6px;
}
@mixin image-alt-size($name, $size) {
@media (min-width: $size) {
img[alt=#{$name}] {
max-height: $size !important;
max-width: $size !important;
}
}
2021-09-12 16:33:05 +02:00
}
@include image-alt-size(tiny, $image_tiny_size);
@include image-alt-size(small, $image_small_size);
@include image-alt-size(medium, $image_medium_size);
@include image-alt-size(large, $image_large_size);
2021-09-22 00:43:51 +02:00
table {
2021-09-22 00:43:51 +02:00
@extend .table;
2021-09-12 16:33:05 +02:00
}
code {
2021-09-23 15:53:20 +02:00
background-color: $meta_color;
border: 1px solid $meta_border_color;
padding: 0 4px;
}
2019-08-18 02:43:44 +02:00
//donations
.donate-button {
background: 0;
border: 0;
margin-left: 170px;
}
.button_to {
display: inline;
}
/* User titles (admin/mod/assistant) and channel states (live/off air) */
.label {
2020-09-17 20:15:33 +02:00
padding: 6px;
2019-08-18 02:43:44 +02:00
overflow-y: hidden;
}
.label--small {
font-size: 9px;
overflow: hidden;
}
.label--block {
display: inline-block;
margin: 2px 6px 6px 0;
}
.label--narrow {
padding: 0 2px;
}
.label--success {
background: $success_light_color;
border: 1px solid $success_color;
}
.label--danger {
background: $danger_light_color;
border: 1px solid $danger_color;
}
.label--warning {
background: $warning_light_color;
border: 1px solid $warning_color;
}
.label--purple {
background: $assistant_color;
border: 1px solid $assistant_border_color;
}
.label--primary {
background: $primary_light_color;
border: 1px solid $primary_color;
}
.large-text {
font-size: 15px;
}
.small-text {
font-size: 10px;
}
.page-current {
padding: 0 $header_spacing;
2019-08-18 02:43:44 +02:00
}
i.favicon-home {
background-image: url("/favicon.svg");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
min-width: 1em;
height: 1em;
display: inline-block;
}
// changelog
.commit-sha {
@extend .label--purple;
padding: 2px;
font-size: 12px;
font-family: $font_family_monospace;
vertical-align: top;
}
.commit-message {
display: block;
}
span.stat {
font-size: 18px;
}
.seamless-frame {
border: 0;
overflow: hidden;
padding: 0;
}
@import "barline";
@import "blocks";
@import "burger";
@import "buttons";
@import "dropdown";
@import "forms";
@import "header";
@import "layout";
@import "media";
@import "shame";
@import "text";
@import "views/adverts";
@import "views/approval";
@import "views/badges";
@import "views/channels";
@import "views/comments";
@import "views/commissions";
@import "views/communications";
@import "views/duplicate_reports";
@import "views/filters";
@import "views/galleries";
@import "views/images";
@import "views/notifications";
@import "views/pages";
@import "views/polls";
@import "views/posts";
@import "views/profiles";
@import "views/pagination";
@import "views/search";
@import "views/staff";
@import "views/stats";
@import "views/tags";
2019-08-18 02:43:44 +02:00
.no-overflow {
overflow: hidden;
}
.no-overflow-x {
overflow-x: hidden;
}
.hidden {
display: none !important;
}