:root { --default-top-padding: 1.5em; --default-body-bottom-margin: 2vmin; --default-min-font-size-px: 12px; --default-min-font-size: 12; --default-max-font-size-px: 18px; --default-max-font-size: 18; } /* ***************************************************************************** personal header styling ***************************************************************************** */ html { /* see: https://css-tricks.com/linearly-scale-font-size-with-css-clamp-based-on-the-viewport/#comment-1769978 - comment by MaxDesign */ font-size:calc(var(--default-min-font-size-px) + (var(--default-max-font-size) - var(--default-min-font-size)) * ((100vw - 360px) / 1560)); font-size: clamp(var(--default-min-font-size-px), calc(var(--default-min-font-size-px) + (var(--default-max-font-size) - var(--default-min-font-size)) * ((100vw - 360px) / 1560)), var(--default-max-font-size-px)); } body { height: calc(100vh - 3vmin); /* minus margin-top - margin bottom is 0 */ font-size: inherit; font-family: helvetica, Arial, sans-serif; background-color: #555; color: white; /* margin-bottom is calculated here to 0 this margin must be set by the lowest elements, because they should go to the very bottom */ margin: 3vmin 4vmin calc(var(--default-body-bottom-margin) - var(--default-body-bottom-margin)) 4vmin; } *:focus { outline: 2px solid white; outline-offset: 2px; } a { color: #ffffff; } header a { text-decoration: none; } /* kind of disabled link - text-decoration will be none automatically */ a:not([href]) { color: #AAAAAA; } header { margin-bottom: 1.5em; } nav { display: flex; align-items: center; column-gap: 0.7em; } h1 { font-size: 1.5em; margin: 0; } #github { margin-left: auto; } #github-cat { height: 1.5em; } /* ***************************************************************************** reset user agent styles see: https://andy-bell.co.uk/a-modern-css-reset ***************************************************************************** */ /* Box sizing rules */ *, *::before, *::after { box-sizing: border-box; } /* Remove default margin */ body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin-block-end: 0; } /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */ ul[role='list'], ol[role='list'] { list-style: none; } /* Set core root defaults */ html:focus-within { scroll-behavior: smooth; } /* Set core body defaults */ body { /* disable because of my personal header */ /* min-height: 100vh; */ text-rendering: optimizeSpeed; line-height: 1.5; } /* A elements that don't have a class get default styles */ a:not([class]) { text-decoration-skip-ink: auto; } /* Make images easier to work with */ img, picture { max-width: 100%; display: block; } /* Inherit fonts for inputs and buttons */ input, button, textarea, select { font: inherit; } /* Remove all animations, transitions and smooth scroll for people that prefer not to see them */ @media (prefers-reduced-motion: reduce) { html:focus-within { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } } /* ***************************************************************************** style dialog for error or busy messages ***************************************************************************** */ dialog { color: white; } dialog:focus { outline: none; } dialog::backdrop { background: rgba(85, 85, 85, 0.80); } dialog.busy-dialog::backdrop { background: inherit; } .error-dialog { color: white; background-color: #AE0000; } .busy-dialog { color: white; background-color: #006900; } dialog p { margin-top: 0; } dialog.busy-dialog p { margin-bottom: 0; } dialog button { float: right; } dialog.busy-dialog button { display: none; } /* ***************************************************************************** colors ***************************************************************************** */ button, input { color: white; background-color: #333; } select { color: black; background-color: white; } input[type="file"] { background-color: inherit; } input::file-selector-button { color: black; } input:disabled::file-selector-button { color: #AAAAAA; } button:disabled, input:disabled, textarea:disabled, div.disabled, p.disabled, label.disabled, #input.disabled, #output.disabled, label:has(> input:disabled) { color: #AAAAAA; background-color: inherit; } /* ***************************************************************************** borders and outlines ***************************************************************************** */ details[open] > #details { outline: 2px solid white; /* margin above needed this outline offset */ outline-offset: calc(1.5vmin - 1px); } input[type=checkbox]:focus { /* reduce default offset as it seems a very big gap */ outline-offset: 1px; } button, input, select { border: 2px solid white; } button, input { -webkit-border-radius: 5px; border-radius: 5px; } select { -webkit-border-radius: 3px; border-radius: 3px; } input[type="file"] { border: 0; } /* iOS */ input::file-selector-button { -webkit-border-radius: 3px; border-radius: 3px; } #input, #output { border: 1px solid white; outline: 1px solid white; } #input:focus { outline: 2px solid white; } button:disabled, input:disabled, textarea:disabled, div.disabled, p.disabled, label.disabled, #input.disabled, #output.disabled { border-color: #AAAAAA; outline-color: #AAAAAA; } /* ***************************************************************************** specials ***************************************************************************** */ button, input, select, details summary { cursor: pointer; } summary { /* just to avoid a big white border on focus */ width: 8ch; } p.label { font-size: 1.2em; display: inline; pointer-events: none; } button:disabled, input:disabled, textarea:disabled, div.disabled, p.disabled, label.disabled, #input.disabled, #output.disabled { pointer-events: none; } /* ***************************************************************************** styles below are necessary for *not* styling the preview in the #output ***************************************************************************** */ pre { text-wrap: pretty; word-break: break-word; margin: 0; font-family: inherit; } th { text-align: left; } /* ***************************************************************************** all margins and paddings to have them together ***************************************************************************** */ main .first-in-main { padding-top: calc(var(--default-top-padding) - 0.8em); } .two-column { padding-top: var(--default-top-padding); } details { padding-top: var(--default-top-padding); } details summary { padding-bottom: 0; } details[open] summary { margin-bottom: 2vmin; margin-left: 3px; padding-bottom: 1vmin; } #details { margin: 1.5vmin; } button, input[type=button] { padding: 5px 10px; } select { padding-right: 0px; } input[type=checkbox] { margin: 0; margin-right: 1vmin; } input[type="file"] { padding: 0; } #selects { padding-top: var(--default-top-padding); } #example { margin-top: var(--default-top-padding); } form.file { padding-top: calc(var(--default-top-padding) / 2); } div.download { /* + 5px to align with the button in the left segment */ padding-top: calc(var(--default-top-padding) / 2 + 2px); } p.label { margin:0; } #input, #output { margin-top: var(--default-top-padding); /* replaces the margin-bottom of the body as these elements should go till the end */ margin-bottom: var(--default-body-bottom-margin); padding: 0.5rem; } /* ***************************************************************************** positioning of elements ***************************************************************************** */ .two-column { display: grid; /* columns with exactly the same size instead of "grid-template-columns: 1fr 1fr;" <-- buggy */ grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3vmin; /* that is only working if #input and #output are among each other */ row-gap: var(--default-top-padding); } #checkboxes, #selects { display: flex; column-gap: 3vmin; row-gap: 2vmin; } #selects > label { display: flex; column-gap: 1vmin; } /* used to set both buttons on the right side of both columns */ .flex-space-between { display: flex; justify-content: space-between; align-items: baseline; } /* select shall fill the rest of the column right from label */ .left.label-w-select, .right.label-w-select { display: flex; justify-content: start; flex-direction: row; column-gap: 1vmin; } .label-w-select select { flex-grow: 1; } /* ***************************************************************************** positioning of elements - special following styles keep track, that at least both last divs #input and #output side by side will always fill up to the end of the page ***************************************************************************** */ body { display: flex; flex-direction: column; /* disabled here because my personal default body seen on top */ /* height: 100%; */ } main { display: flex; flex-direction: column; height: 100% } .max-height { display: flex; flex-direction: column; height: 100% } .max-height > .two-column { flex-grow: 1; flex-basis: auto; height: 100% } .left, .right { display: flex; flex-direction: column; height: 100%; } #input, #output { flex-grow: 1; } /* ***************************************************************************** media queries here ***************************************************************************** */ /* from here two columns side by side are not working */ @media (max-width: 850px) { .two-column { grid-template-columns: minmax(0, 1fr); } div.download { /* padding is only needed if it must align to file input when side by side */ padding-top: 0; } } @media (max-width: 600px) { #checkboxes > label, #selects > label { display: grid; } } /* iPhone 13 mini portrait */ @media (max-width: 375px) { .left.label-w-select, .right.label-w-select { flex-direction: column; } }