mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
feat: add components for list item, unordered, and ordered lists
This commit is contained in:
25
src/components/OrderedList.tsx
Normal file
25
src/components/OrderedList.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user