Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack responsive direction doesn't respect responsive gap props #49

Open
ankibalyan opened this issue Apr 25, 2020 · 3 comments
Open

Stack responsive direction doesn't respect responsive gap props #49

ankibalyan opened this issue Apr 25, 2020 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@ankibalyan
Copy link
Contributor

if I give a responsive stack like below. It doesn't give the horizontal gap in tab & desktop views

<Stack direction={['vertical', 'horizontal', 'horizontal']} gap={[3, 5, 7]}>
  <Text>Item 1 A</Text>
  <Stack direction="vertical" gap="4">
    <Text>Item 2 A</Text>
    <Text>Item 2 B</Text>
    <Text>Item 2 C</Text>
  </Stack>
  <Stack direction={['vertical', 'horizontal', 'horizontal']} gap={[3, 8, 10]}>
    <Text>Item 3 A</Text>
    <Text>Item 3 B</Text>
    <Text>Item 3 C</Text>
    <Text>Item 3 D</Text>
  </Stack>
</Stack>;
@ankibalyan
Copy link
Contributor Author

Or may be this shouldn't be allowed to have both the props as responsive array.

@siddharthkp siddharthkp added the bug Something isn't working label May 5, 2020
@siddharthkp siddharthkp self-assigned this May 5, 2020
@siddharthkp siddharthkp added this to the 1.0.0 milestone May 5, 2020
@ankibalyan
Copy link
Contributor Author

I tried to add following over [here] (

const responsiveValues = values.map(v => get(key, v, theme, label))
)

  const responsiveValues = values.map(v => {
    if (typeof v === 'object') {
      return interpolate(v, theme);
    }

    return get(key, v, theme, label);
  });
  const responsiveStyles = mq({ [key]: responsiveValues })[0];

But this seems to work only if we give all the values breakpoint, it breaks if I give value only for 2 (mobile & tablet).

@siddharthkp
Copy link
Owner

Hey! This part is tricky, I'm going to revisit it after finishing a few other tasks. There is some hacky code that is going to come back to bite me like this one

@siddharthkp siddharthkp removed their assignment Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants