Add collapsible section component.

Can now collapse server categories.
Client remembers collapse state, incl. advanced appearance settings.
This commit is contained in:
Paul
2021-07-04 15:53:06 +01:00
parent 476c521b92
commit 08c338ea1c
13 changed files with 157 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ import { Text } from 'preact-i18n';
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
error?: string;
block?: boolean;
spaced?: boolean;
children?: Children;
type?: "default" | "subtle" | "error";
}
@@ -12,7 +13,10 @@ type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
const OverlineBase = styled.div<Omit<Props, "children" | "error">>`
display: inline;
margin: 0.4em 0;
margin-top: 0.8em;
${ props => props.spaced && css`
margin-top: 0.8em;
` }
font-size: 14px;
font-weight: 600;