Skip to content

Commit

Permalink
feature(type): Create CustomFlowbiteTheme type
Browse files Browse the repository at this point in the history
This is a more natural API to read than
`DeepPartial<FlowbiteTheme>`.
  • Loading branch information
tulup-conner committed May 24, 2022
1 parent 7732f70 commit 0b897b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/docs/pages/ThemePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { HiInformationCircle } from 'react-icons/hi';
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import { dracula } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { Alert, Card, DarkThemeToggle } from '../../lib';
import { DeepPartial, Flowbite, FlowbiteTheme } from '../../lib/components';
import { Flowbite } from '../../lib/components';
import { CustomFlowbiteTheme } from '../../lib/components/Flowbite/FlowbiteTheme';

const ThemePage: FC = () => {
const theme: DeepPartial<FlowbiteTheme> = { alert: { color: { primary: 'bg-primary' } } };
const theme: CustomFlowbiteTheme = { alert: { color: { primary: 'bg-primary' } } };

return (
<div className="mx-auto flex max-w-4xl flex-col gap-8 dark:text-white">
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/Flowbite/FlowbiteTheme.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type CustomFlowbiteTheme = DeepPartial<FlowbiteTheme>;

export interface FlowbiteTheme {
accordion: {
base: string;
Expand Down

0 comments on commit 0b897b5

Please sign in to comment.