A modifier config should be able to be written like:
success: () => css`
background-color: green;
`
When attempting to install this in a new project though, this appeared to not function correctly. This new project uses fresh versions of all applicable packages, including styled components, styled components modifiers, and lodash packages.
ACTUAL BEHAVIOR
The modifier is being completely ignored and it's styles are not applied to the component.
STEPS TO REPRODUCE
Please provide some simple steps to reproduce the issue.
Update to the latest versions of all packages.
Create a modifier configuration that returns the css utility.
Observe that you are unable to apply those styles.
SUGGESTED SOLUTION
Do you have any feedback on how this problem should be solved?
This line checks if the config is an object using the lodash isObject util. In this scenario, the config is an array containing the result of the css util. isObject returns true for arrays, but that gives undefined instead of the styles. We need better validation that the config is actually an object with a styles property.
EXPECTED BEHAVIOR
A modifier config should be able to be written like:
When attempting to install this in a new project though, this appeared to not function correctly. This new project uses fresh versions of all applicable packages, including styled components, styled components modifiers, and lodash packages.
ACTUAL BEHAVIOR
The modifier is being completely ignored and it's styles are not applied to the component.
STEPS TO REPRODUCE
Please provide some simple steps to reproduce the issue.
css
utility.SUGGESTED SOLUTION
Do you have any feedback on how this problem should be solved?
This line checks if the
config
is an object using the lodashisObject
util. In this scenario, theconfig
is an array containing the result of thecss
util.isObject
returns true for arrays, but that givesundefined
instead of the styles. We need better validation that the config is actually an object with a styles property.