I am currently utilizing a React component library called
vertical-timeline-component-react
.
<Fragment>
<Timeline>
<Content>
<ContentYear
startMonth="12"
monthType="text"
startDay="24"
startYear="2016"
/>
<ContentBody style={{color: 'red'}} title="Amazing Title">
</ContentBody>
</Content>
<Content>
<ContentYear
startMonth="12"
monthType="text"
startDay="24"
startYear="2016"
/>
<ContentBody title="Amazing Title">
</ContentBody>
</Content>
</Timeline>
</Fragment>
The code snippet above demonstrates the use of two instances of the Content
component within the library's example.
My goal is to customize the text color inside each ContentBody
differently.
Initial attempts with inline styling like
<ContentBody style={{color: 'red'}} title="Amazing Title">
proved ineffective in achieving the desired result.
Subsequent investigation revealed the className of the text body as .jertxS
.
To address this, I created a separate styles.css
file to modify the font color for this class. However, this change applied universally across all ContentBody
s instead of individually.
Given the absence of specific customization templates within the library, I am seeking guidance on alternate techniques to achieve unique text colors for each ContentBody
.