Skip to content

Commit

Permalink
feat(theme): add sidebar.item.collapsed.noIcon to theme
Browse files Browse the repository at this point in the history
Classes placed here are applied when you create `Sidebar.Item` with an `icon` and collapse the
`Sidebar`.
  • Loading branch information
tulup-conner committed Aug 20, 2022
1 parent 8f0d24c commit 5908e0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/Flowbite/FlowbiteTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type { TabStyleItem, TabStyles } from '../Tab';

export type CustomFlowbiteTheme = DeepPartial<FlowbiteTheme>;

export interface FlowbiteTheme {
export interface FlowbiteTheme extends Record<string, unknown> {
accordion: {
base: string;
content: {
Expand Down Expand Up @@ -411,6 +411,7 @@ export interface FlowbiteTheme {
base: string;
collapsed: {
insideCollapse: string;
noIcon: string;
};
content: {
base: string;
Expand Down
9 changes: 7 additions & 2 deletions src/lib/theme/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default {
import type { FlowbiteTheme } from '../components';

const theme: FlowbiteTheme = {
accordion: {
base: 'divide-y divide-gray-200 border-gray-200 dark:divide-gray-700 dark:border-gray-700',
content: {
Expand Down Expand Up @@ -697,10 +699,11 @@ export default {
},
},
item: {
base: 'flex items-center rounded-lg p-2 text-base font-normal text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700',
base: 'flex items-center justify-center rounded-lg p-2 text-base font-normal text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700',
active: 'bg-gray-100 dark:bg-gray-700',
collapsed: {
insideCollapse: 'group w-full pl-8 transition duration-75',
noIcon: 'font-bold',
},
content: {
base: 'px-3 flex-1 whitespace-nowrap',
Expand Down Expand Up @@ -866,3 +869,5 @@ export default {
},
},
};

export default theme;

0 comments on commit 5908e0b

Please sign in to comment.