Files
AFFiNE-Mirror/libs/components/ui/src/typography/Typo.tsx
T
2022-07-22 15:49:21 +08:00

18 lines
464 B
TypeScript

import { styled } from '../styled';
import type { ThemeOptions } from '../theme/theme';
type TypographyType = keyof ThemeOptions['typography'];
interface TypographyProps {
/**
* Binding with typography in theme.
* Default: sm
*/
type?: TypographyType;
}
export const Typography = styled('span')<TypographyProps>(({ theme, type }) => {
const config = theme.affine.typography[type] || theme.affine.typography.sm;
return config;
});