Decisiv / styled-components-modifiers

A library to enable BEM flavored modifiers (and responsive modifiers) in styled components.
MIT License
298 stars 11 forks source link

[BUG] default responsive modifier value is not applied correctly. #40

Closed andrewtpoe closed 4 years ago

andrewtpoe commented 4 years ago

EXPECTED BEHAVIOR

When using a modifier using applyStyleModifier in a responsive component, the default modifier should be applied if size is provided but does not match.

This simple example should apply the default modifier value (modifier1):

<Component modifiers={{_: 'modifier1', LG: 'modifier2'}} size="SM" />

ACTUAL BEHAVIOR

Given the scenario above, no modifiers will be applied.

STEPS TO REPRODUCE

SUGGESTED SOLUTION

The logic behind selecting responsive modifiers needs to be improved to handle this scenario. This same logic is repeated in a few other locations as well.

andrewtpoe commented 4 years ago

closed by #49