feat: add components for list item, unordered, and ordered lists

This commit is contained in:
Stefan Imhoff
2023-04-05 15:33:12 +02:00
parent 58336ccd73
commit d8bb473ffe
5 changed files with 85 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
import cx from 'classnames';
import type { ComponentChild, FunctionalComponent } from 'preact';
interface Props {
class?: string;
children: ComponentChild;
}
export const OrderedList: FunctionalComponent<Props> = ({
class: className,
children,
...props
}) => {
const classes = cx(
'list-decimal text-3 mbe-12 pis-[1.5rem] md:pis-0 [li>&]:mbe-0 [li>&]:pis-[1.5rem]',
className
);
return (
<ol class={classes} {...props}>
{children}
</ol>
);
};