UI: typography init flag to omit color class
This commit is contained in:
@@ -85,6 +85,9 @@ interface _TypographyProps<H extends Hierarchy> {
|
|||||||
tag?: Tag;
|
tag?: Tag;
|
||||||
class?: string;
|
class?: string;
|
||||||
classList?: Record<string, boolean>;
|
classList?: Record<string, boolean>;
|
||||||
|
// Disable using the color prop
|
||||||
|
// A font color is provided via class / classList or inherited
|
||||||
|
useExternColor?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Typography = <H extends Hierarchy>(props: _TypographyProps<H>) => {
|
export const Typography = <H extends Hierarchy>(props: _TypographyProps<H>) => {
|
||||||
@@ -92,7 +95,7 @@ export const Typography = <H extends Hierarchy>(props: _TypographyProps<H>) => {
|
|||||||
<Dynamic
|
<Dynamic
|
||||||
component={props.tag || "span"}
|
component={props.tag || "span"}
|
||||||
class={cx(
|
class={cx(
|
||||||
colorMap[props.color || "primary"],
|
!props.useExternColor && colorMap[props.color || "primary"],
|
||||||
props.inverted && "fnt-clr--inverted",
|
props.inverted && "fnt-clr--inverted",
|
||||||
sizeHierarchyMap[props.hierarchy][props.size] as string,
|
sizeHierarchyMap[props.hierarchy][props.size] as string,
|
||||||
weightMap[props.weight || "normal"],
|
weightMap[props.weight || "normal"],
|
||||||
|
|||||||
Reference in New Issue
Block a user