diff --git a/publish/editor.css b/publish/editor.css index 8928495..f2443b2 100644 --- a/publish/editor.css +++ b/publish/editor.css @@ -290,3 +290,101 @@ 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; + } +} diff --git a/publish/style.css b/publish/style.css index ffca117..733ca3d 100644 --- a/publish/style.css +++ b/publish/style.css @@ -1,6 +1,9 @@ input { font-family: "Noto Sans", "Verdana", sans-serif; } +input[type=checkbox] { + accent-color: #006633; +} #main .grid { display: grid; grid-template-columns: minmax(75px, 125px) auto; @@ -178,3 +181,148 @@ ul.error-box li { position:relative; top:0.6em; } + +/* + * Phones: one column, with each label above its input. The inputs, the + * editor and the image box take the full width, the controls are at + * least 44px high for fingers, and the text is at least 16px, so that + * iOS does not zoom in when an input gets the focus. + */ +@media (max-width: 600px) { + #main .grid { + grid-template-columns: minmax(0, 1fr); + } + #main .grid > * { + min-width: 0; + } + #main .grid > .leftcolumn { + display: none; + } + #main .grid > label { + width: auto; + margin-top: 14px; + padding-right: 0; + text-align: left; + font-weight: bold; + } + #main .grid > .rightcolumn { + margin-top: 4px; + align-self: stretch; + } + /* The star of a required field goes inside the right end of the input, + so that all the inputs have the same width */ + #main .grid > .rightcolumn:has(.required) { + position: relative; + } + #main .grid .rightcolumn > input:has(+ .required) { + padding-right: 30px; + } + #main .grid .rightcolumn > .required { + position: absolute; + top: 50%; + right: 12px; + transform: translateY(-50%); + } + #main .grid .rightcolumn > input { + flex: 1; + min-width: 0; + width: auto; + min-height: 44px; + padding: 8px 12px; + font-size: 16px; + } + #main .grid .rightcolumn input#remember, + #main .grid #hidden { + flex: none; + width: 24px; + min-height: 24px; + height: 24px; + margin: 8px 0; + } + #main .grid > div.note { + margin-top: 4px; + text-align: left; + } + + /* The Text and Image tabs sit in a row on the top border of the story + box, as they touch its left border on a wide screen. They start after + its round corner. */ + #main .tabs { + flex-direction: row; + align-items: flex-end; + gap: 6px; + padding-top: 18px; + padding-left: 10px; + } + #main .tab { + min-height: 44px; + box-sizing: border-box; + margin: 0; + padding: 10px 18px; + border-radius: 8px 8px 0 0; + text-align: center; + } + #main .counter { + margin: 0 0 6px auto; + padding-right: 0; + } + #main .grid > .textarea { + width: 100%; + margin-top: 0; + } + #main .grid .textarea .note { + margin-top: 6px; + text-align: left; + } + #main .grid #textparent { + min-height: 0; + } + #uploadparent { + height: auto; + min-height: 200px; + } + #main .grid #uploadparent { + min-height: 200px; + } + #uploadparent input[type=file] { + box-sizing: border-box; + width: 100%; + min-height: 44px; + font-size: 16px; + } + #uploadparent input[type=file]::file-selector-button { + min-height: 44px; + margin-right: 10px; + padding: 8px 16px; + border: 1px solid #006633; + border-radius: 6px; + background-color: #ffffff; + color: #006633; + font: bold 16px "Noto Sans", "Verdana", sans-serif; + } + + #main .grid div.g-recaptcha { + grid-column: auto; + margin: 18px 0 0; + } + + #main .submission { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-top: 18px; + } + #main .submission button { + min-height: 44px; + margin: 0; + padding: 8px 20px; + font-size: 16px; + } + + ul.error-box { + padding: 10px 16px 10px 20px; + } + ul.error-box li { + margin: 4px 0 4px 10px; + } +}