I am implementing a custom color theme module. Simply the user selects two separate colors (a primary and secondary that are ANY hex value) and save the value in state. I use these colors to set custom dynamic styles to components in my application such as:
<Link style={{backgroundColor: this.props.myprofile.primaryColor}} to={href} />
This was working fine except for 2 issues.
It takes forever adding the logic to each component. I would rather be able to set a
className
and call the logic on every element with thatclassName
.Psuedo Classes. Psuedo Classes such as
:hover
and:focus
do not mix well with inline styling. I know about and have used Radium, but I would prefer to find a different solution.