diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c26b233..97ceb44 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -18,10 +18,14 @@ /* Strive for simplicity: * * style elements/tags only - if possible, * * replace element/tag name with class name - if element has to be styled - * differently depending on context (e.g. form) + * differently depending on context (e.g.
; as link/button), + * * styles with multiple selectors should have all selectors with same + * specificity, to allow proper rule specificity vs order management. * - * NOTE: Style in a modular way, similar to how CSS @scope would be used, - * to make transition easier once @scope is widely available */ + * NOTE: style in a modular way, similar to how CSS @scope would be used, + * to make transition easier once @scope is widely available. */ +/* TODO: review styles with multiple selectors and try to convert them to the same + * specificity. */ :root { --color-focus-gray: #f3f3f3; --color-border-gray: #dddddd; @@ -58,7 +62,7 @@ border-color: var(--color-border-gray) !important; color: var(--color-border-gray) !important; /* NOTE: cannot set cursor with `pointer-events: none`; can be fixed by setting - * cursor on wrapping element. + * `cursor` on wrapping element. cursor: not-allowed; */ fill: var(--color-border-gray) !important; pointer-events: none !important; @@ -70,9 +74,9 @@ /* Color coding of input controls' background: - * blue - target for interaction with pointer - * gray - target for interaction with keyboard - * red - destructive, non-undoable action + * blue - target for interaction with pointer, + * gray - target for interaction with keyboard, + * red - destructive, non-undoable action. */ button, details, @@ -87,49 +91,17 @@ input, select { text-align: inherit; } -a, -button, -input[type=submit] { - cursor: pointer; - text-decoration: none; - white-space: nowrap; -} -.button, -button, -input[type=submit], -.tab { - align-items: center; - color: var(--color-gray); - display: flex; - fill: var(--color-gray); - font-weight: bold; -} -.button, -button, -input[type=submit] { - font-size: 0.8rem; - padding: 0.6em 0.5em; - width: fit-content; -} -input:not([type=submit]):not([type=checkbox]), -select, -summary, -textarea { - padding: 0.2em 0.4em; -} -.button, -button, input, select, summary, textarea { - border: solid 1px var(--color-gray); + border: 1px solid var(--color-gray); border-radius: 0.25em; + padding: 0.2em 0.4em; } -input[type=checkbox], svg, textarea { - margin: 0 + margin: 0; } input[type=checkbox] { accent-color: var(--color-blue); @@ -137,13 +109,16 @@ input[type=checkbox] { -webkit-appearance: none; display: flex; height: 1.1em; + margin: 0; + padding: 0; width: 1.1em; } input[type=checkbox]:checked { appearance: checkbox; -webkit-appearance: checkbox; } -/* Hide spin buttons in input number fields */ +/* Hide spin buttons of . */ +/* TODO: add spin buttons inside : before (-) and after (+) input. */ input[type=number] { appearance: textfield; -moz-appearance: textfield; @@ -155,52 +130,21 @@ input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } -.button > svg, -.tab > svg, -button > svg { - height: 1.4em; - width: 1.4em; -} -.button > svg:not(:last-child), -.tab > svg:not(:last-child), -button > svg:not(:last-child) { - margin-right: 0.2em; -} -/* TODO: move normal non-button links (:hover/:focus) styling here (i.e. - * page-wide, top-level) and remove from table.items - as the style should be - * same everywhere */ -.button:focus-visible, -button:focus-visible, -input[type=submit]:focus-visible { - background-color: var(--color-focus-gray); -} input:focus-visible, select:focus-visible, select:focus-within, -/* TODO: how to achieve summary:focus-within for ::details-content? */ +/* TODO: how to achieve `summary:focus-within` for `::details-content`? */ summary:focus-visible, textarea:focus-visible { accent-color: var(--color-dark-blue); background-color: var(--color-focus-gray); } -.button:hover, -button:hover, -input[type=submit]:hover { - background-color: var(--color-blue); - border-color: var(--color-blue); - color: white; - fill: white; -} -.dangerous:hover { - background-color: var(--color-red); - border-color: var(--color-red); -} input:hover, select:hover, summary:hover, textarea:hover { border-color: var(--color-blue); - outline: solid 1px var(--color-blue); + outline: 1px solid var(--color-blue); } select:hover, summary:hover { @@ -210,8 +154,68 @@ input:invalid, select:invalid, textarea:invalid { border-color: var(--color-red); - outline: solid 1px var(--color-red); + outline-color: var(--color-red); } + +/* `.button`: button-styled ,