This PR enhances the applyStyleModifiers and styleModifierPropTypes utilities to enable responsive behavior that was previously only enabled in applyResponsiveStyleModifiers and responsiveStyleModifierPropTypes.
With this PR, any modifiers prop will be able to accept one of three types of values:
a string that is the key in the modifier config.
an array of strings that are each a key in the modifier config.
an object where the values are all strings or arrays of strings that are each a key in the modifier config.
If the object pattern is used, the value selected will be based on the value of a size prop that the developer must supply. If size is not provided or does not match a key in the object, modifiers['_'] will be selected and applied as the defaults. If no '_' key is available, no modifiers will be applied.
WHERE SHOULD THE REVIEWER START?
View the README
HOW CAN THIS BE MANUALLY TESTED?
Run the test suite. Coverage is at 100% across all metrics.
ANY NEW DEPENDENCIES ADDED?
no
CHECKLIST
Be sure all items are ✅ before submitting a PR for review.
[x] Verify the linter and tests pass: npm run review
[x] Verify this branch is rebased with the latest master
fixes #21
OVERVIEW
This PR enhances the
applyStyleModifiers
andstyleModifierPropTypes
utilities to enable responsive behavior that was previously only enabled inapplyResponsiveStyleModifiers
andresponsiveStyleModifierPropTypes
.With this PR, any
modifiers
prop will be able to accept one of three types of values:If the object pattern is used, the value selected will be based on the value of a
size
prop that the developer must supply. Ifsize
is not provided or does not match a key in the object,modifiers['_']
will be selected and applied as the defaults. If no'_'
key is available, no modifiers will be applied.WHERE SHOULD THE REVIEWER START?
View the README
HOW CAN THIS BE MANUALLY TESTED?
Run the test suite. Coverage is at 100% across all metrics.
ANY NEW DEPENDENCIES ADDED?
no
CHECKLIST
Be sure all items are ✅ before submitting a PR for review.
npm run review
GIF
Share a fun GIF to say thanks to your reviewer: https://giphy.com