gecko-dev/devtools/client/themes/fonts.css
Razvan Caliman 4bc089e80f Bug 1483575 - (Part 2) Add LineHeight component to font editor. r=gl
MozReview-Commit-ID: JiMBI3QMKML

Depends on D3498

Differential Revision: https://phabricator.services.mozilla.com/D3499

--HG--
extra : moz-landing-system : lando
2018-08-16 14:48:51 +00:00

447 lines
9.5 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/. */
/* CSS Variables specific to the font editor that aren't defined by the themes */
:root {
--slider-thumb-color: var(--grey-50);
--slider-track-color: var(--grey-30);
--toggle-thumb-color: white;
--toggle-track-color: var(--grey-30);
--input-background-color: white;
--input-border-color: var(--grey-30);
--input-text-color: var(--grey-90);
}
:root.theme-dark {
--slider-thumb-color: var(--grey-40);
--slider-track-color: var(--grey-50);
--toggle-thumb-color: var(--grey-40);
--toggle-track-color: var(--grey-50);
--input-background-color: var(--grey-70);
--input-border-color: var(--grey-70);
--input-text-color: var(--grey-40);
}
#sidebar-panel-fontinspector {
margin: 0;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: auto;
}
#font-container {
flex: auto;
}
#font-editor {
padding-bottom: .5em;
}
#font-editor summary {
-moz-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 {
display: inline-block;
}
#font-editor details:not([open]) .label-open {
display: inline-block;
}
.fonts-list {
padding: 0;
margin: 0;
list-style: none;
}
.font {
border: 1px solid var(--theme-splitter-color);
border-width: 0 0 1px 0;
display: grid;
grid-template-columns: 1fr auto;
grid-column-gap: 10px;
padding: 10px 20px;
overflow: auto;
}
#font-container .theme-twisty {
display: inline-block;
cursor: pointer;
vertical-align: bottom;
}
.font-preview-container {
grid-column: 2;
grid-row: 1 / span 2;
overflow: hidden;
display: grid;
place-items: center end;
position: relative;
}
.font-preview {
height: 50px;
display: block;
}
.font-preview:hover {
cursor: text;
background-image: linear-gradient(to right,
var(--grey-40) 3px, transparent 3px, transparent);
background-size: 6px 1px;
background-repeat: repeat-x;
background-position-y: 45px;
}
#font-container .font-preview-input {
position: absolute;
top: 5px;
left: 0;
width: calc(100% - 5px);
height: calc(100% - 10px);
background: transparent;
color: transparent;
border-radius: 0;
padding: 0;
}
.font-preview-input::-moz-selection {
background: transparent;
color: transparent;
}
.font-name,
.font-family-name {
font-weight: normal;
white-space: nowrap;
}
.font-name {
margin-bottom: 0.6em;
font-size: 1em;
color: var(--grey-50);
}
.font-family-name {
margin-bottom: 0.2em;
font-size: 1.2em;
}
.font-css-code {
direction: ltr;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
color: var(--theme-toolbar-color);
grid-column: span 2;
position: relative;
inset-inline-start: -4px;
}
.font-css-code-expander::before {
content: "\2026";
display: inline-block;
width: 12px;
height: 8px;
margin: 0 2px;
line-height: 3px;
color: var(--theme-body-color-inactive);
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 18px;
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-family {
align-items: flex-start;
border-bottom: 1px solid var(--theme-splitter-color);
margin-top: 0;
margin-bottom: 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-label {
display: inline-block;
flex: 1;
font-size: 12px;
max-width: 70px;
margin-right: 10px;
-moz-user-select: none;
}
.font-family-unused {
margin-bottom: .3em;
margin-left: 1.15em;
color: var(--grey-50);
}
.font-value-input {
margin-left: 10px;
text-align: right;
width: 60px;
padding: 2px 3px;
}
.font-value-input,
.font-value-select {
color: var(--input-text-color);
border: 1px solid var(--input-border-color);
background-color: var(--input-background-color);
}
/* 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;
}
/* Add space between input text from number stepper */
.font-value-input[type=number]::-moz-number-spin-box {
margin-left: 3px;
}
/* Make native number steppers darker to fit the dark theme */
.theme-dark .font-value-input[type=number]::-moz-number-spin-box {
filter: invert(25%);
}
/* Do not show number stepper for line height and font-size */
.font-value-input[name=line-height],
.font-value-input[name=font-size] {
-moz-appearance: textfield;
padding-right: 5px;
border-right: none;
}
/* Mock separator because inputs don't have distinguishable borders in dark theme */
.theme-dark .font-value-input + .font-value-select {
margin-left: 2px;
}
/* Custom styles for <select> elements within the font editor. */
.font-value-select {
background-image: var(--select-arrow-image);
background-repeat: no-repeat;
background-position: right 4px center;
fill: var(--theme-toolbar-photon-icon-color);
-moz-context-properties: fill;
-moz-appearance: none;
box-shadow: none;
padding: 1px 10px 1px 2px;
min-width: 3.8em;
}
.font-value-select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 var(--input-text-color);
}
.font-value-input:focus,
.font-value-select:focus {
outline: 1px solid var(--blue-55);
outline-offset: -1px;
}
.font-value-slider {
flex: 1;
margin: 0;
min-width: 50px;
}
/*
The value of font-weight goes from 100 to 900 in increments of 100.
Decorate the slider for font-weight to have 9 vertical notches using a linear gradient.
*/
.font-value-slider[name=font-weight] {
--notch-size: 3px;
/* Draw a vertical line to get one notch per background-image instance */
background-image: linear-gradient(90deg, var(--slider-track-color) var(--notch-size),
transparent 0);
/* Offset the background so the notch aligns with the center of the slider thumb */
background-position: 5px center;
/* Repeat the background-image horizontally */
background-repeat: repeat-x;
/* Size the background to get nine visible notch instances. */
background-size: calc(12.5% - var(--notch-size) / 2) 7px;
}
.font-value-slider:-moz-focusring {
outline: none;
}
.font-value-slider::-moz-focus-outer {
border: 0;
}
.font-value-slider::-moz-range-thumb {
background-color: var(--slider-thumb-color);
border: 0;
}
.font-value-slider:focus::-moz-range-thumb {
background-color: var(--blue-55);
}
.font-value-slider::-moz-range-track {
background-color: var(--slider-track-color);
height: 3px;
}
/*
Restyle a native checkbox input to look like a toggle with a "thumb".
Build the decoration using solid shapes created with radial- and linear-gradient
background images. Animate the position of the "thumb" using background-position.
*/
.font-value-toggle {
--x-pos: .15em;
/* Reset native checkbox styling. */
-moz-appearance: none;
background-color: var(--toggle-track-color);
cursor: pointer;
/* Change font-size to scale. */
font-size: 16px;
width: 2em;
height: 1em;
border-radius: 1em;
/* Animate the thumb position between states of the checkbox. */
transition: background-color .1s ease-out;
/* border: 1px solid transparent; */
/* box-sizing: content-box; */
}
.font-value-toggle:focus {
box-shadow: 0 0 0 1px var(--blue-55);
}
.font-value-toggle:checked:focus {
background-color: var(--blue-40);
box-shadow: none;
}
.font-value-toggle:checked {
--x-pos: 1.15em;
background-color: var(--blue-55);
}
.font-value-toggle::before {
position: relative;
width: calc(1em - .3em);
height: calc(1em - .3em);
transform: translateY(.15em) translateX(var(--x-pos));
border-radius: 100%;
display: block;
content: "";
background-color: var(--toggle-thumb-color);
transition: transform .1s ease-out;
}
.font-value-toggle:checked::before {
background-color: white;
}
.font-origin {
margin-top: -.25em;
color: var(--theme-comment);
justify-self: start;
}
.font-origin.system {
text-transform: capitalize;
}
.font-origin.remote {
display: grid;
grid-template-columns: 1fr 20px;
}
.font-origin.remote .url {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.font-origin .copy-icon {
border: 0;
padding: 0;
position: relative;
cursor: pointer;
width: 12px;
height: 12px;
place-self: center;
background: url(chrome://devtools/skin/images/copy.svg) no-repeat;
background-size: 12px;
background-position-x: -1px;
-moz-context-properties: fill;
fill: var(--grey-50);
}
#font-container .accordion {
border-top: 1px solid var(--theme-splitter-color);
}
#font-container .accordion ._content {
padding: 0;
}
#font-container .accordion + .accordion {
border-top: none;
}