gecko-dev/toolkit/themes/shared/aboutReader.css

859 строки
19 KiB
CSS

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Avoid adding ID selector rules in this style sheet, since they could
* inadvertently match elements in the article content. */
:root {
--body-padding: 64px;
--popup-border: rgba(0, 0, 0, 0.12);
--popup-shadow: rgba(49, 49, 49, 0.3);
--radio-button-border: rgb(177, 177, 179);
--grey-90-a10: rgba(12, 12, 13, 0.1);
--grey-90-a20: rgba(12, 12, 13, 0.2);
--grey-90-a30: rgba(12, 12, 13, 0.3);
--grey-90-a80: rgba(12, 12, 13, 0.8);
--grey-10: #f9f9fa;
--grey-20: #ededf0;
--grey-30: #d7d7db;
--grey-50: #737373;
--grey-80: #2a2a2e;
--blue-40: #45a1ff;
--blue-60: #0060df;
--active-color: #0B83FF;
--font-size: 12;
--content-width: 22em;
--line-height: 1.6em;
--tooltip-background: var(--grey-90-a80);
--tooltip-foreground: white;
--toolbar-button-hover: var(--grey-90-a10);
--toolbar-button-active: var(--grey-90-a20);
}
body {
--main-background: #fff;
--main-foreground: #333;
--toolbar-border: var(--grey-90-a20);
--toolbar-box-shadow: var(--grey-90-a10);
--popup-button-hover: #e0e0e1;
--popup-bgcolor: white;
--popup-button: #edecf0;
--selected-button: #d1e1ff;
--selected-border: #a0beff;
--popup-line: var(--grey-30);
--font-value-border: var(--grey-30);
--font-color: #000000;
--icon-fill: #3b3b3c;
--icon-disabled-fill: #8080807F;
/* light colours */
}
body.sepia {
--main-background: #f4ecd8;
--main-foreground: #5b4636;
--toolbar-border: #5b4636;
}
body.dark {
--main-background: #333;
--main-foreground: #eee;
--toolbar-border: #4a4a4b;
--toolbar-box-shadow: black;
--toolbar-button-hover: var(--grey-90-a30);
--toolbar-button-active: var(--grey-90-a80);
--popup-button-hover: var(--grey-50);
--popup-bgcolor: #4c4a50;
--popup-button: #5c5c61;
--selected-button: var(--blue-40);
--selected-border: var(--blue-60);
--popup-line: #5c5c61;
--font-value-border: #656468;
--font-color: #fff;
--icon-fill: #fff;
--icon-disabled-fill: #ffffff66;
--tooltip-background: black;
--tooltip-foreground: white;
/* dark colours */
}
body {
margin: 0;
padding: var(--body-padding);
background-color: var(--main-background);
color: var(--main-foreground);
}
body.loaded {
transition: color 0.4s, background-color 0.4s;
}
body.dark *::-moz-selection {
background-color: #FFFFFF;
color: #0095DD;
}
body.dark a::-moz-selection {
color: #DD4800;
}
body.sans-serif,
body.sans-serif .remove-button {
font-family: Helvetica, Arial, sans-serif;
}
body.serif,
body.serif .remove-button {
font-family: Georgia, "Times New Roman", serif;
}
.container {
margin: 0 auto;
font-size: var(--font-size);
max-width: var(--content-width);
line-height: var(--line-height);
}
/* Override some controls and content styles based on color scheme */
body.light > .container > .header > .domain {
border-bottom-color: #333333 !important;
}
body.sepia > .container > .header > .domain {
border-bottom-color: #5b4636 !important;
}
body.dark > .container > .header > .domain {
border-bottom-color: #eeeeee !important;
}
body.sepia > .container > .footer {
background-color: #dedad4 !important;
}
body.light blockquote {
border-inline-start: 2px solid #333333 !important;
}
body.sepia blockquote {
border-inline-start: 2px solid #5b4636 !important;
}
body.dark blockquote {
border-inline-start: 2px solid #eeeeee !important;
}
.light-button {
color: #333333;
background-color: #ffffff;
}
.dark-button {
color: #eeeeee;
background-color: #333333;
}
.sepia-button {
color: #5b4636;
background-color: #f4ecd8;
}
.sans-serif-button {
font-family: Helvetica, Arial, sans-serif;
}
.serif-button {
font-family: Georgia, "Times New Roman", serif;
}
/* Loading/error message */
.reader-message {
margin-top: 40px;
display: none;
text-align: center;
width: 100%;
font-size: 0.9em;
}
/* Detector element to see if we're at the top of the doc or not. */
.top-anchor {
position: absolute;
top: 0;
width: 0;
height: 5px;
pointer-events: none;
}
/* Header */
.header {
text-align: start;
display: none;
}
.domain {
font-size: 0.9em;
line-height: 1.48em;
padding-bottom: 4px;
font-family: Helvetica, Arial, sans-serif;
text-decoration: none;
border-bottom: 1px solid;
color: #0095dd;
}
.header > h1 {
font-size: 1.6em;
line-height: 1.25em;
width: 100%;
margin: 30px 0;
padding: 0;
}
.header > .credits {
font-size: 0.9em;
line-height: 1.48em;
margin: 0 0 10px 0;
padding: 0;
font-style: italic;
}
.header > .meta-data {
font-size: 0.65em;
margin: 0 0 15px 0;
}
.reader-estimated-time {
text-align: match-parent;
}
/*======= Controls toolbar =======*/
.toolbar-container {
position: sticky;
z-index: 2;
top: 32px;
height: 0; /* take up no space, so body is at the top. */
/* As a stick container, we're positioned relative to the body. Move us to
* the edge of the viewport using margins, and take the width of
* the body padding into account for calculating our width.
*/
margin-inline-start: calc(-1 * var(--body-padding));
width: max(var(--body-padding), calc((100% - var(--content-width)) / 2 + var(--body-padding)));
font-size: var(--font-size); /* Needed to ensure `em` units match, is reset for .reader-controls */
}
.toolbar {
padding-block: 16px;
border: 1px solid var(--toolbar-border);
border-radius: 6px;
box-shadow: 0 2px 8px var(--toolbar-box-shadow);
width: 32px; /* basic width, without padding/border */
/* padding should be 16px, except if there's not enough space for that, in
* which case use half the available space for padding (=25% on each side).
* The 34px here is the width + borders. We use a variable because we need
* to know this size for the margin calculation.
*/
--inline-padding: min(16px, calc(25% - 0.25 * 34px));
padding-inline: var(--inline-padding);
/* Keep a maximum of 96px distance to the body, but center once the margin
* gets too small. We need to set the start margin, however...
* To center, we'd want 50% of the container, but we'd subtract half our
* own width (16px) and half the border (1px) and the inline padding.
* When the other margin would be 96px, we want 100% - 96px - the complete
* width of the actual toolbar (34px + 2 * padding)
*/
margin-inline-start: max(calc(50% - 17px - var(--inline-padding)), calc(100% - 96px - 34px - 2 * var(--inline-padding)));
font-family: Helvetica, Arial, sans-serif;
list-style: none;
-moz-user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
.toolbar {
transition-property: border-color, box-shadow;
transition-duration: 250ms;
}
.toolbar .button {
transition-property: opacity;
transition-duration: 250ms;
}
.toolbar-container.scrolled .toolbar:not(:hover) {
border-color: transparent;
box-shadow: 0 2px 8px transparent;
}
.toolbar-container.scrolled .toolbar:not(:hover) .button {
opacity: 0.6;
}
.toolbar-container.transition-location {
transition-duration: 250ms;
transition-property: width;
}
}
.toolbar-container.overlaps .button {
opacity: 0.1;
}
.dropdown-open .toolbar {
border-color: transparent;
box-shadow: 0 2px 8px transparent;
}
.reader-controls {
/* We use `em`s above this node to get it to the right size. However,
* the UI inside the toolbar should use a fixed, smaller size. */
font-size: 11px;
}
.button {
position: relative;
width: 32px;
height: 32px;
padding: 0;
border: none;
border-radius: 4px;
margin: 4px 0;
background-color: transparent;
background-size: 16px 16px;
background-position: center;
background-repeat: no-repeat;
color: var(--font-color);
}
.button:hover,
.button:-moz-focusring {
background-color: var(--toolbar-button-hover);
}
.open .button,
.button:active {
background-color: var(--toolbar-button-active);
color: var(--active-color);
fill: var(--active-color);
}
.hover-label {
position: absolute;
top: 6px;
inset-inline-start: 36px;
white-space: pre; /* make sure we don't wrap */
background-color: var(--tooltip-background);
color: var(--tooltip-foreground);
padding: 4px 8px;
border-radius: 2px;
visibility: hidden;
pointer-events: none;
}
.button:hover > .hover-label,
.button:-moz-focusring > .hover-label {
visibility: visible;
}
button {
-moz-context-properties: fill;
color: var(--font-color);
fill: var(--icon-fill);
}
button:disabled {
fill: var(--icon-disabled-fill);
}
.toolbar button::-moz-focus-inner {
border: 0;
}
.dropdown {
text-align: center;
list-style: none;
margin: 0;
padding: 0;
position: relative;
}
.dropdown li {
margin: 0;
padding: 0;
}
/* Don't show hover styles while dropdowns are open, except in the dropdown. */
.dropdown-open {
pointer-events: none;
}
.dropdown-open .dropdown-popup {
pointer-events: initial;
}
/*======= Popup =======*/
.dropdown .dropdown-popup {
text-align: start;
position: absolute;
inset-inline-start: 40px;
z-index: 1000;
background-color: var(--popup-bgcolor);
visibility: hidden;
border-radius: 4px;
border: 1px solid var(--popup-border);
box-shadow: 0 4px 6px 0 var(--popup-shadow);
border-bottom-width: 0;
}
.dropdown-popup > hr {
display: none;
}
.open > .dropdown-popup {
visibility: visible;
}
.dropdown-arrow {
position: absolute;
height: 24px;
width: 16px;
inset-inline-start: -16px;
background-image: url("chrome://global/skin/reader/RM-Type-Controls-Arrow.svg");
display: block;
-moz-context-properties: fill, stroke;
fill: var(--popup-bgcolor);
stroke: var(--popup-border);
pointer-events: none;
}
.dropdown-arrow:dir(rtl) {
transform: scaleX(-1);
}
/* Align the style dropdown (narrate does its own) */
.style-dropdown .dropdown-popup {
top: -57px;
}
.style-dropdown .dropdown-arrow {
top: 64px;
}
/*======= Font style popup =======*/
.font-type-buttons,
.font-size-buttons,
.color-scheme-buttons,
.content-width-buttons,
.line-height-buttons {
display: flex;
flex-direction: row;
justify-content: space-evenly;
}
.content-width-value,
.font-size-value,
.line-height-value {
background-color: var(--popup-button);
border-radius: 10px;
display: inline-block;
width: 50px;
border: 1px solid var(--font-value-border);
text-align: center;
margin: auto;
}
.font-type-buttons > button,
.font-size-buttons > button,
.color-scheme-buttons > button,
.content-width-buttons > button,
.line-height-buttons > button {
text-align: center;
border: 0;
}
.font-type-buttons > button,
.font-size-buttons > button,
.content-width-buttons > button,
.line-height-buttons > button {
width: 50%;
background-color: transparent;
}
.color-scheme-buttons > button {
font-size: 10px;
margin: 10px;
height: 34px;
border-radius: 4px;
width: 70px;
display: inline;
border: 1px solid var(--popup-border);
padding-block: 0 12px;
padding-inline: 0 21px;
}
.color-scheme-buttons .radio-button {
margin-block-end: -1px;
display: inline-block;
}
.font-type-buttons > button {
height: 70px;
margin: 10px;
background-color: var(--popup-button);
border-radius: 2px;
border: 1px solid var(--popup-line);
}
.font-type-buttons,
.font-size-buttons,
.content-width-buttons,
.line-height-buttons {
border-bottom: 1px solid var(--popup-line);
}
.font-size-buttons > button,
.content-width-buttons > button,
.line-height-buttons > button {
height: 60px;
width: 90px;
}
.font-type-buttons > button.selected:active:hover,
.font-type-buttons > button.selected:hover,
.font-type-buttons > button.selected {
background-color: var(--selected-button);
border: 1px solid var(--selected-border);
}
.color-scheme-buttons > button.selected,
.font-type-buttons > button:-moz-focusring,
.color-scheme-buttons > button:-moz-focusring {
border-color: var(--selected-border);
}
/* Make the serif button content the same size as the sans-serif button content. */
.font-type-buttons > button > .description {
font-size: 12px;
text-align: start;
display: inline-block;
min-width: 60%;
}
.description {
line-height: 1.5em;
vertical-align: middle;
}
.font-type-buttons > .sans-serif-button > .name {
background-image: url("chrome://global/skin/reader/RM-Sans-Serif.svg");
}
.font-type-buttons > .serif-button > .name{
background-image: url("chrome://global/skin/reader/RM-Serif.svg");
}
.font-type-buttons > .sans-serif-button > .name,
.font-type-buttons > .serif-button > .name {
display: inline-block;
height: 39px;
width: 60px;
background-size: contain;
background-repeat: no-repeat;
}
.font-size-buttons > button:enabled:hover,
.font-size-buttons > button:enabled:-moz-focusring,
.font-type-buttons > button:enabled:hover,
.content-width-buttons > button:enabled:hover,
.content-width-buttons > button:enabled:-moz-focusring,
.line-height-buttons > button:enabled:hover,
.line-height-buttons > button:enabled:-moz-focusring {
background-color: var(--popup-button-hover);
}
.font-size-buttons > button:enabled:active,
.font-size-buttons > button.selected,
.content-width-buttons > button:enabled:active,
.content-width-buttons > button.selected,
.line-height-buttons > button:enabled:active,
.line-height-buttons > button.selected {
background-color: #dadada;
}
.minus-button,
.plus-button,
.content-width-minus-button,
.content-width-plus-button,
.line-height-minus-button,
.line-height-plus-button {
background-color: transparent;
border: 0;
background-size: 18px 18px;
background-repeat: no-repeat;
background-position: center;
}
/*======= Toolbar icons =======*/
.close-button {
-moz-context-properties: fill;
background-image: url("chrome://global/skin/reader/close-16.svg");
}
.style-button {
background-image: url("chrome://global/skin/reader/RM-Type-Controls-24x24.svg");
}
.radio-button {
-moz-appearance: none;
-moz-outline-radius: 100%;
border-radius: 50%;
width: 10px;
height: 10px;
outline: 1px solid var(--radio-button-border);
background-color: #ffffff;
margin: 0;
margin-inline-end: 5px;
vertical-align: middle;
}
.radio-button:checked {
background-color: var(--blue-40);;
border: 2px solid #ffffff;
}
.font-type-buttons .radio-button {
margin-inline-start: -2px;
}
.minus-button {
background-image: url("chrome://global/skin/reader/RM-Minus-24x24.svg");
}
.plus-button {
background-image: url("chrome://global/skin/reader/RM-Plus-24x24.svg");
}
.content-width-minus-button {
background-size: 42px 16px;
background-image: url("chrome://global/skin/reader/RM-Content-Width-Minus-42x16.svg");
}
.content-width-plus-button {
background-size: 44px 16px;
background-image: url("chrome://global/skin/reader/RM-Content-Width-Plus-44x16.svg");
}
.line-height-minus-button {
background-size: 34px 14px;
background-image: url("chrome://global/skin/reader/RM-Line-Height-Minus-38x14.svg");
}
.line-height-plus-button {
background-size: 34px 24px;
background-image: url("chrome://global/skin/reader/RM-Line-Height-Plus-38x24.svg");
}
/* Mirror the line height buttons if the article is RTL. */
.reader-controls[articledir="rtl"] .line-height-minus-button,
.reader-controls[articledir="rtl"] .line-height-plus-button {
transform: scaleX(-1);
}
@media print {
.toolbar {
display: none !important;
}
}
/*======= Article content =======*/
/* Note that any class names from the original article that we want to match on
* must be added to CLASSES_TO_PRESERVE in ReaderMode.jsm, so that
* Readability.js doesn't strip them out */
.moz-reader-content {
display: none;
font-size: 1em;
}
@media print {
.moz-reader-content p,
.moz-reader-content code,
.moz-reader-content pre,
.moz-reader-content blockquote,
.moz-reader-content ul,
.moz-reader-content ol,
.moz-reader-content li,
.moz-reader-content figure,
.moz-reader-content .wp-caption {
margin: 0 0 10px 0 !important;
padding: 0 !important;
}
}
.moz-reader-content h1,
.moz-reader-content h2,
.moz-reader-content h3 {
font-weight: bold;
}
.moz-reader-content h1 {
font-size: 1.6em;
line-height: 1.25em;
}
.moz-reader-content h2 {
font-size: 1.2em;
line-height: 1.51em;
}
.moz-reader-content h3 {
font-size: 1em;
line-height: 1.66em;
}
.moz-reader-content a:link {
text-decoration: underline;
font-weight: normal;
}
.moz-reader-content a:link,
.moz-reader-content a:link:hover,
.moz-reader-content a:link:active {
color: #0095dd;
}
.moz-reader-content a:visited {
color: #c2e;
}
.moz-reader-content * {
max-width: 100%;
height: auto;
}
.moz-reader-content p,
.moz-reader-content p,
.moz-reader-content code,
.moz-reader-content pre,
.moz-reader-content blockquote,
.moz-reader-content ul,
.moz-reader-content ol,
.moz-reader-content li,
.moz-reader-content figure,
.moz-reader-content .wp-caption {
margin: -10px -10px 20px -10px;
padding: 10px;
border-radius: 5px;
}
.moz-reader-content li {
margin-bottom: 0;
}
.moz-reader-content li > ul,
.moz-reader-content li > ol {
margin-bottom: -10px;
}
.moz-reader-content p > img:only-child,
.moz-reader-content p > a:only-child > img:only-child,
.moz-reader-content .wp-caption img,
.moz-reader-content figure img {
display: block;
}
.moz-reader-content img[moz-reader-center] {
margin-left: auto;
margin-right: auto;
}
.moz-reader-content .caption,
.moz-reader-content .wp-caption-text
.moz-reader-content figcaption {
font-size: 0.9em;
line-height: 1.48em;
font-style: italic;
}
.moz-reader-content code,
.moz-reader-content pre {
white-space: pre-wrap;
}
.moz-reader-content blockquote {
padding: 0;
padding-inline-start: 16px;
}
.moz-reader-content ul,
.moz-reader-content ol {
padding: 0;
}
.moz-reader-content ul {
padding-inline-start: 30px;
list-style: disc;
}
.moz-reader-content ol {
padding-inline-start: 30px;
list-style: decimal;
}
table,
th,
td {
border: 1px solid currentColor;
border-collapse: collapse;
padding: 6px;
vertical-align: top;
}
table {
margin: 5px;
}
/* Visually hide (but don't display: none) screen reader elements */
.moz-reader-content .visually-hidden,
.moz-reader-content .visuallyhidden,
.moz-reader-content .sr-only {
display: inline-block;
width: 1px;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
border-width: 0;
}
/* Hide elements with common "hidden" class names */
.moz-reader-content .hidden,
.moz-reader-content .invisible {
display: none;
}
/* Enforce wordpress and similar emoji/smileys aren't sized to be full-width,
* see bug 1399616 for context. */
.moz-reader-content img.wp-smiley,
.moz-reader-content img.emoji {
display: inline-block;
border-width: 0;
/* height: auto is implied from `.moz-reader-content *` rule. */
width: 1em;
margin: 0 .07em;
padding: 0;
}
.reader-show-element {
display: initial;
}