-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
What:
The library analyzes given props to all of exported components (Box, Composition) and performs two things:
- Generates respective CSS string to pass to
styled-components; - Generates areas component to render (in case of Composition).
When given a set of props in a random order (not logical order), the outcome of this analyzis is wrong:
<Composition
areasLg="left right"
areas="left"
areasMd="left right"
/>Atomic Layout won't be able to properly construct the areas components taking the scenario above.
areasprops would need to be listed in logical order: areas -> areasMd -> areasLg.
Why:
The issue is that prop analyzis takes the props in the order they were declared. There is also no reliable way to determine in which sequence the props must be sorted.
Expected behavior:
It would be more resilient to changes if the library could understand the logical flow of props on its own. This would support arbitrary props order and allow some corner-case dynamic props composition.