Below 600px: labels above full-width inputs, 44px touch targets, 16px text, and the tabs on the top border of the story box.
391 lines
7.5 KiB
CSS
391 lines
7.5 KiB
CSS
/*
|
|
* The story editor (publish/editor.js). The size follows the TinyMCE 5
|
|
* settings of the live site: at most 450px wide, at least 300px high,
|
|
* resizable, with the toolbar on top.
|
|
*
|
|
* Colors: borders #b8c9be (lines inside the editor #dfe7e2), toolbar
|
|
* #f4f7f5, hover #e3ebe6, pressed #d2e2d8, and the site green #006633
|
|
* for focus and the main button.
|
|
*/
|
|
.xed {
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
max-width: 450px;
|
|
min-width: 200px;
|
|
min-height: 300px;
|
|
overflow: hidden;
|
|
resize: both;
|
|
border: 1px solid #b8c9be;
|
|
border-radius: 8px;
|
|
background-color: #f4f7f5;
|
|
}
|
|
.xed:focus-within {
|
|
border-color: #006633;
|
|
}
|
|
|
|
.xed-area {
|
|
box-sizing: border-box;
|
|
flex: 1 1 300px;
|
|
min-height: 0;
|
|
overflow: auto;
|
|
padding: 0 8px;
|
|
background-color: #ffffff;
|
|
color: #000000;
|
|
font-size: 12pt;
|
|
outline: none;
|
|
overflow-wrap: break-word;
|
|
}
|
|
/* The first and last paragraph keep their space, as in the old iframe */
|
|
.xed-area > :first-child {
|
|
margin-top: 1em;
|
|
}
|
|
.xed-area blockquote {
|
|
margin: 1em 40px;
|
|
}
|
|
|
|
/* The story textarea, shown in place of the editor by the source button */
|
|
.xed .xed-source {
|
|
box-sizing: border-box;
|
|
display: block;
|
|
flex: 1 1 300px;
|
|
width: 100%;
|
|
min-height: 0;
|
|
margin: 0;
|
|
padding: 8px;
|
|
border: 0;
|
|
border-radius: 0;
|
|
background-color: #ffffff;
|
|
color: #000000;
|
|
font: 10.5pt/1.5 "DejaVu Sans Mono", Menlo, Consolas, monospace;
|
|
resize: none;
|
|
outline: none;
|
|
}
|
|
|
|
.xed-toolbar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex: none;
|
|
padding: 3px 2px;
|
|
border-bottom: 1px solid #dfe7e2;
|
|
}
|
|
.xed-group {
|
|
display: flex;
|
|
gap: 1px;
|
|
margin: 1px 0;
|
|
}
|
|
.xed-group + .xed-group {
|
|
margin-left: 4px;
|
|
padding-left: 4px;
|
|
border-left: 1px solid #dfe7e2;
|
|
}
|
|
|
|
.xed-btn {
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 28px;
|
|
height: 26px;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: #333333;
|
|
cursor: pointer;
|
|
}
|
|
.xed-btn:hover {
|
|
background-color: #e3ebe6;
|
|
}
|
|
.xed-btn:focus-visible {
|
|
outline: 2px solid #006633;
|
|
outline-offset: -2px;
|
|
}
|
|
.xed-btn.xed-active {
|
|
background-color: #d2e2d8;
|
|
color: #004d26;
|
|
}
|
|
.xed-btn:disabled {
|
|
background: transparent;
|
|
color: #333333;
|
|
opacity: 0.35;
|
|
cursor: default;
|
|
}
|
|
.xed-btn svg {
|
|
display: block;
|
|
}
|
|
|
|
/* Dialogs */
|
|
.xed-modal-block {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1000;
|
|
background-color: rgba(0, 0, 0, 0.25);
|
|
}
|
|
/* A window that closes on a click outside it has a lighter backdrop */
|
|
.xed-modal-block.xed-modal-light {
|
|
background-color: rgba(0, 0, 0, 0.08);
|
|
}
|
|
.xed-window {
|
|
position: fixed;
|
|
top: 50%;
|
|
left: 50%;
|
|
z-index: 1001;
|
|
transform: translate(-50%, -50%);
|
|
box-sizing: border-box;
|
|
max-width: calc(100vw - 20px);
|
|
max-height: calc(100vh - 20px);
|
|
overflow: auto;
|
|
border: 1px solid #b8c9be;
|
|
border-radius: 8px;
|
|
background-color: #ffffff;
|
|
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
|
|
color: #333333;
|
|
font-family: "Noto Sans", "Verdana", sans-serif;
|
|
font-size: 11pt;
|
|
text-align: left;
|
|
}
|
|
.xed-window-head {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px 15px;
|
|
border-bottom: 1px solid #dfe7e2;
|
|
}
|
|
.xed-title {
|
|
flex: 1;
|
|
padding-right: 10px;
|
|
color: #006633;
|
|
font-size: 14pt;
|
|
font-weight: bold;
|
|
line-height: 1.3;
|
|
}
|
|
.xed-close {
|
|
width: 28px;
|
|
height: 28px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 4px;
|
|
background: none;
|
|
color: #6d6d6d;
|
|
font: bold 20px/28px "Noto Sans", "Verdana", sans-serif;
|
|
cursor: pointer;
|
|
}
|
|
.xed-close:hover {
|
|
background-color: #e3ebe6;
|
|
color: #333333;
|
|
}
|
|
.xed-window-body {
|
|
padding: 20px;
|
|
}
|
|
.xed-foot {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 6px;
|
|
padding: 10px 15px;
|
|
border-top: 1px solid #dfe7e2;
|
|
}
|
|
.xed-button {
|
|
box-sizing: border-box;
|
|
min-width: 64px;
|
|
height: 32px;
|
|
padding: 4px 12px;
|
|
border: 1px solid #b8c9be;
|
|
border-radius: 6px;
|
|
background-color: #ffffff;
|
|
color: #333333;
|
|
font: 11pt/1.4 "Noto Sans", "Verdana", sans-serif;
|
|
cursor: pointer;
|
|
}
|
|
.xed-button:hover {
|
|
background-color: #f0f5f2;
|
|
}
|
|
.xed-button:focus-visible {
|
|
outline: 2px solid #006633;
|
|
outline-offset: 1px;
|
|
}
|
|
.xed-button.xed-primary {
|
|
border-color: #006633;
|
|
background-color: #006633;
|
|
color: #ffffff;
|
|
font-weight: bold;
|
|
}
|
|
.xed-button.xed-primary:hover {
|
|
background-color: #00522a;
|
|
}
|
|
|
|
/* Link dialog */
|
|
.xed-form {
|
|
width: 409px;
|
|
max-width: 100%;
|
|
}
|
|
.xed-row {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 10px;
|
|
}
|
|
.xed-row:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
.xed-row label {
|
|
flex: 0 0 120px;
|
|
line-height: 16px;
|
|
}
|
|
.xed-textbox {
|
|
box-sizing: border-box;
|
|
flex: 1;
|
|
min-width: 0;
|
|
height: 32px;
|
|
padding: 0 8px;
|
|
border: 1px solid #b8c9be;
|
|
border-radius: 6px;
|
|
background-color: #ffffff;
|
|
color: #333333;
|
|
font: 11pt "Noto Sans", "Verdana", sans-serif;
|
|
}
|
|
.xed-textbox:focus {
|
|
border-color: #006633;
|
|
outline: none;
|
|
box-shadow: 0 0 0 2px rgba(0, 102, 51, 0.15);
|
|
}
|
|
|
|
/* Special character dialog */
|
|
.xed-window-body:has(.xed-charmap-body) {
|
|
padding: 10px;
|
|
}
|
|
.xed-charmap-body {
|
|
display: flex;
|
|
gap: 20px;
|
|
align-items: flex-start;
|
|
}
|
|
.xed-charmap {
|
|
border-collapse: collapse;
|
|
}
|
|
.xed-charmap td {
|
|
min-width: 12px;
|
|
height: 20px;
|
|
padding: 2px;
|
|
border: 1px solid #e3ebe6;
|
|
line-height: 20px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
cursor: pointer;
|
|
}
|
|
.xed-charmap td:hover,
|
|
.xed-charmap td:focus-visible {
|
|
background-color: #d2e2d8;
|
|
outline: none;
|
|
}
|
|
.xed-charmap-preview {
|
|
width: 120px;
|
|
text-align: center;
|
|
}
|
|
.xed-charmap-char {
|
|
height: 80px;
|
|
font-size: 40px;
|
|
line-height: 80px;
|
|
}
|
|
.xed-charmap-name {
|
|
margin-top: 10px;
|
|
font-size: 10.5pt;
|
|
}
|
|
|
|
/*
|
|
* Phones: the editor takes the full width and grows only downwards, the
|
|
* toolbar buttons are big enough for fingers (the toolbar wraps onto a
|
|
* second line), and the text is at least 16px so that iOS does not zoom.
|
|
*/
|
|
@media (max-width: 600px) {
|
|
.xed {
|
|
max-width: none;
|
|
min-width: 0;
|
|
resize: vertical;
|
|
}
|
|
/* A wrapped line would start with a separator, so the groups have
|
|
space between them instead */
|
|
.xed-toolbar {
|
|
column-gap: 8px;
|
|
}
|
|
.xed-group + .xed-group {
|
|
margin-left: 0;
|
|
padding-left: 0;
|
|
border-left: 0;
|
|
}
|
|
.xed-btn {
|
|
width: 40px;
|
|
height: 40px;
|
|
}
|
|
.xed-btn svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
.xed .xed-source {
|
|
font-size: 16px;
|
|
}
|
|
|
|
/* Dialogs: labels above the inputs, and bigger buttons */
|
|
/* Only the body scrolls, so the title and the buttons stay in view */
|
|
.xed-window {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: calc(100vw - 20px);
|
|
overflow: hidden;
|
|
}
|
|
.xed-window-body {
|
|
min-height: 0;
|
|
overflow: auto;
|
|
padding: 14px;
|
|
}
|
|
.xed-form {
|
|
width: auto;
|
|
}
|
|
.xed-row {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 4px;
|
|
}
|
|
.xed-row label {
|
|
flex: none;
|
|
}
|
|
.xed-textbox {
|
|
flex: none;
|
|
height: 44px;
|
|
font-size: 16px;
|
|
}
|
|
.xed-button {
|
|
min-height: 44px;
|
|
font-size: 16px;
|
|
}
|
|
.xed-close {
|
|
width: 44px;
|
|
height: 44px;
|
|
}
|
|
|
|
/* The special characters wrap in a grid of cells big enough to tap;
|
|
a touch screen has no hover, so the preview is left out */
|
|
.xed-charmap-body {
|
|
display: block;
|
|
}
|
|
.xed-charmap {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
|
|
width: 100%;
|
|
}
|
|
.xed-charmap tbody,
|
|
.xed-charmap tr {
|
|
display: contents;
|
|
}
|
|
.xed-charmap td {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 40px;
|
|
min-width: 0;
|
|
font-size: 20px;
|
|
}
|
|
.xed-charmap-preview {
|
|
display: none;
|
|
}
|
|
}
|