77 */
88
99import React , { FunctionComponent , HTMLAttributes , CSSProperties } from 'react' ;
10- import classNames from 'classnames' ;
1110import { CommonProps } from '../common' ;
1211
1312import { useEuiTheme } from '../../services' ;
@@ -43,11 +42,11 @@ export type EuiTextColorProps = CommonProps &
4342export const EuiTextColor : FunctionComponent < EuiTextColorProps > = ( {
4443 children,
4544 color = 'default' ,
46- className,
4745 component = 'span' ,
4846 style,
4947 ...rest
5048} ) => {
49+ const Component = component ;
5150 const isNamedColor = COLORS . includes ( color as TextColor ) ;
5251
5352 const euiTheme = useEuiTheme ( ) ;
@@ -57,16 +56,6 @@ export const EuiTextColor: FunctionComponent<EuiTextColorProps> = ({
5756 isNamedColor ? styles [ color as TextColor ] : undefined ,
5857 ] ;
5958
60- const classes = classNames (
61- 'euiTextColor' ,
62- {
63- [ `euiTextColor--${ color } ` ] : isNamedColor ,
64- 'euiTextColor--custom' : ! isNamedColor ,
65- } ,
66- className
67- ) ;
68- const Component = component ;
69-
7059 // We're checking if is a custom color.
7160 // If it is a custom color we set the `color` of the `.euiTextColor` div to that custom color.
7261 // This way the children text elements can `inherit` that color and border and backgrounds can get that `currentColor`.
@@ -78,12 +67,7 @@ export const EuiTextColor: FunctionComponent<EuiTextColorProps> = ({
7867 : { ...style } ;
7968
8069 return (
81- < Component
82- css = { cssStyles }
83- className = { classes }
84- style = { euiTextStyle }
85- { ...rest }
86- >
70+ < Component css = { cssStyles } style = { euiTextStyle } { ...rest } >
8771 { children }
8872 </ Component >
8973 ) ;
0 commit comments