/* 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/. */
/* CSS Variables specific to the font editor that aren't defined by the themes */
:root {
--highlight-color: var(--blue-55);
--input-background-color: white;
--input-border-color: var(--grey-30);
--preview-input-background: var(--theme-toolbar-background);
--slider-thumb-color: var(--grey-50);
--slider-track-color: var(--grey-30);
}
:root.theme-dark {
--input-background-color: var(--grey-70);
--input-border-color: var(--grey-70);
--preview-input-background: #222225;
--slider-thumb-color: var(--grey-40);
--slider-track-color: var(--grey-60);
}
#sidebar-panel-fontinspector {
margin: 0;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: auto;
}
#font-container, #font-editor {
min-width: var(--min-container-width);
}
#font-container {
flex: auto;
}
#font-editor {
padding-bottom: .5em;
}
#font-editor summary {
user-select: none;
cursor: pointer;
margin-bottom: .4em;
width: -moz-fit-content;
}
#font-editor details {
padding-bottom: .5em;
}
#font-editor details .label-open,
#font-editor details .label-close {
display: none;
}
#font-editor details[open] .label-close,
#font-editor details:not([open]) .label-open {
display: inline-block;
}
#font-editor .devtools-sidepanel-no-result {
padding-bottom: 0;
}
.fonts-list {
padding: 0;
margin: 0;
list-style: none;
/* This is the main grid on the
that the
will use as subgrid */
display: grid;
grid-template-columns: 1fr max-content;
grid-column-gap: 10px;
}
.font {
display: grid;
grid-template-columns: subgrid;
grid-column: 1 / -1;
padding: 10px 20px;
word-break: break-all;
& + .font {
border-block-start: 1px solid var(--theme-splitter-color);
}
.font-name {
white-space: normal;
}
}
#font-container .theme-twisty {
display: inline-block;
cursor: pointer;
vertical-align: bottom;
background-color: transparent;
border: none;
}
#font-preview-input-container {
background: var(--preview-input-background);
border-bottom: 1px solid var(--theme-splitter-color);
display: flex;
height: 25px;
}
#font-preview-input-container input {
background-image: none;
flex: 1;
padding-inline: 19px;
}
.font-preview {
grid-column: 2;
grid-row: 1 / span 2;
object-fit: contain;
height: 50px;
width: 100%;
}
.font-name,
.font-family-name {
font-weight: normal;
white-space: nowrap;
}
.font-name {
display: inline-block;
margin-bottom: 0.6em;
font-size: 1em;
color: var(--theme-text-color-alt);
}
.font-family-name {
margin-bottom: 0.2em;
font-size: 1.2em;
}
.font-group {
margin-bottom: .5em;
}
.font-group .font-name {
white-space: unset;
/* Some font-name can be very long, holding some kind of serial numbers and configuration.
Make sure the string wraps properly to prevent horizontal scrollbars. */
word-break: break-all;
}
.font-group .font-name::after {
content: ",";
}
.font-group .font-name:nth-last-child(1)::after {
content: "";
}
/* Make font-name hoverable as doing so highlights text runs in the page.
The hit target is 3px around the font name, which is why we offset them with a -3px
horizontal margin so they appear at the same place as they normall would. */
.font-name {
padding: 3px;
margin-inline-start: -3px;
border-radius: 3px;
}
.font-name:hover {
background-color: var(--theme-selection-background-hover);
}
.font-css-code {
/* Force text direction in LTR and RTL */
direction: ltr;
text-align: left;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
color: var(--theme-text-color-strong);
grid-column: span 2;
}
.font-css-code .theme-twisty {
margin-inline-start: -3px;
}
/* Force arrow direction in LTR and RTL */
.font-css-code .theme-twisty[aria-expanded="false"] {
transform: rotate(-90deg) !important;
}
.font-truncated-string-expander {
background-color: transparent;
border: none;
padding: 0;
&::before {
content: "\2026";
display: inline-block;
width: 12px;
height: 8px;
margin: 0 2px;
line-height: 3px;
color: var(--theme-icon-dimmed-color);
border-radius: 3px;
border-style: solid;
border-width: 1px;
text-align: center;
vertical-align: middle;
}
}
.font-control {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
padding: 0 20px;
margin: .6em 0;
}
/* Style *all* axis controls with a top separator. See reset below. */
.font-control-axis {
border-top: 1px solid var(--theme-splitter-color);
padding-top: 1.1em;
}
/* Remove styles form all axis controls aside from the first one.
Workaround for :first-of-type which doesn't work with class names. */
.font-control-axis ~ .font-control-axis {
border-top: unset;
padding-top: unset;
}
.font-control-used-fonts {
align-items: flex-start;
border-bottom: 1px solid var(--theme-splitter-color);
margin-block: 0 1em;
padding-top: 1em;
}
.font-control-box,
.font-control-input {
flex: 4;
min-width: 100px;
}
.font-control-input {
display: flex;
flex-wrap: nowrap;
align-items: center;
}
.font-control-input .devtools-checkbox-toggle {
margin: 2px 0;
}
.font-control-label {
display: inline-block;
flex: 1;
font-size: 12px;
min-width: 70px;
margin-inline-end: 10px;
user-select: none;
}
.font-control-label-text {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.font-control-label-detail {
color: var(--theme-text-color-alt);
font-size: smaller;
}
.font-value-input {
text-align: right;
width: 60px;
padding: 2px 3px;
padding-inline-end: 5px;
}
.font-value-input,
.font-value-select {
color: var(--theme-text-color-strong);
border: 1px solid var(--input-border-color);
background-color: var(--input-background-color);
}
/* Styles for disabled input fields */
.font-value-input[disabled],
.font-value-select[disabled],
.font-value-slider[disabled] {
opacity: 0.5;
}
/* Do not use browser "invalid" state */
.font-value-slider:-moz-ui-invalid,
.font-value-input:-moz-ui-invalid {
box-shadow: none;
}
/* Do not show dotted line focus outline */
.font-value-input:-moz-focusring {
outline: none;
}
/* Make native number steppers disappear by treating it as text field*/
.font-value-input[type=number] {
appearance: textfield;
}
/* Swap around order of value input and unit dropdown for RTL */
.font-value-input:dir(rtl) {
order: 3;
}
.font-value-label {
/* Combined width of .font-value-input and .font-value-select */
width: calc(60px + 3.8em);
padding-block: 2px 4px;
}
/* Mock separator because inputs don't have distinguishable borders in dark theme */
.theme-dark .font-value-input + .font-value-select:dir(ltr) {
margin-inline-start: 2px;
}
.theme-dark .font-value-input + .font-value-select:dir(rtl) {
margin-inline-end: 2px;
}
/* Custom styles for