diff --git a/README.md b/README.md index bec63821..b8cd1a16 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ npm start | | | - **backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. | | | | - **progressColor**: String. Specifies the taskbar progress fill color locally. | | | | - **progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. | +| | | - **textColor**: String. Specifies the taskbar text fill color locally. | | isDisabled | bool | Disables all action for current task. | | fontSize | string | Specifies the taskbar font size locally. | | project | string | Task project name | diff --git a/src/components/task-item/task-item.tsx b/src/components/task-item/task-item.tsx index cf062849..b7c89a0e 100644 --- a/src/components/task-item/task-item.tsx +++ b/src/components/task-item/task-item.tsx @@ -80,6 +80,11 @@ export const TaskItem: React.FC = props => { } }; + const getTextColor = (): string => { + if (task.styles.textColor) return task.styles.textColor; + else return isTextInside ? "#FFF" : "#555"; + }; + return ( { @@ -116,6 +121,7 @@ export const TaskItem: React.FC = props => { ? style.barLabel : style.barLabel && style.barLabelOutside } + fill={getTextColor()} ref={textRef} > {task.name} diff --git a/src/components/task-item/task-list.module.css b/src/components/task-item/task-list.module.css index 2eec4204..2fdcbbbd 100644 --- a/src/components/task-item/task-list.module.css +++ b/src/components/task-item/task-list.module.css @@ -1,5 +1,4 @@ .barLabel { - fill: #fff; text-anchor: middle; font-weight: lighter; dominant-baseline: central; @@ -12,12 +11,5 @@ } .barLabelOutside { - fill: #555; text-anchor: start; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - pointer-events: none; } diff --git a/src/types/bar-task.ts b/src/types/bar-task.ts index 1be75e84..85bf3302 100644 --- a/src/types/bar-task.ts +++ b/src/types/bar-task.ts @@ -17,6 +17,7 @@ export interface BarTask extends Task { backgroundSelectedColor: string; progressColor: string; progressSelectedColor: string; + textColor?: string; }; } diff --git a/src/types/public-types.ts b/src/types/public-types.ts index f4c641a6..d1353cc2 100644 --- a/src/types/public-types.ts +++ b/src/types/public-types.ts @@ -24,6 +24,7 @@ export interface Task { backgroundSelectedColor?: string; progressColor?: string; progressSelectedColor?: string; + textColor?: string; }; isDisabled?: boolean; project?: string;