Skip to content

Commit

Permalink
feat: add color prop
Browse files Browse the repository at this point in the history
  • Loading branch information
gokh4nozturk committed Aug 22, 2023
1 parent 5426280 commit e0f442a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/components/TabItem/RTabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ export interface IProps {
* <TabItem block />
*/
block?: boolean;
/**
* Color of the tab item
* @type string
* @default ''
* @example
* <TabItem color="" />
*/
color?: string;
}
const props = withDefaults(defineProps<IProps>(), {
label: '',
Expand All @@ -107,6 +116,12 @@ const classes = computed(() => {
};
});
const style = computed(() => {
return {
color: props.color,
};
});
/**
* @description Fires when the tab is clicked
* @param {id} id - The id of the tab
Expand All @@ -129,6 +144,7 @@ function handleIconClick(): void {
:aria-disabled="props.disabled"
:aria-selected="props.modelValue === props.id"
:class="classes"
:style="style"
:disabled="props.disabled"
@click.stop="handleTab(props.id)"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabItem/tab-item.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../index.css';

.tab-item {
@apply transition-all gap-2 min-w-fit py-3 px-6 bg-transparent flex justify-center items-center text-gray-500 text-sm font-medium cursor-pointer;
@apply transition-all gap-2 min-w-fit py-3 px-6 bg-transparent flex justify-center items-center text-[var(--neutral-500)] text-sm font-medium cursor-pointer;

&:disabled {
@apply cursor-not-allowed bg-inherit opacity-50;
Expand Down

0 comments on commit e0f442a

Please # to comment.