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

x-axis and y-axis based padding, margins not working #28

Open
ghost opened this issue Dec 7, 2020 · 3 comments
Open

x-axis and y-axis based padding, margins not working #28

ghost opened this issue Dec 7, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 7, 2020

Describe the bug
.px-{n}, .py-{n}, .mx-{n}, .my-{n} classes are not working as expected. Although .p-{n} .m-{n} classes work perfectly fine.

To Reproduce
Code SandBox Link

Actual

Actual

Expected :

Expected

  • Version 0.0.0-beta.13
@ameerthehacker
Copy link
Member

Thanks for raising this @ArjithN if you are interested please feel free to shoot a PR. This will help you get started https://github.com/product-ride/styled-wind/blob/master/src/services/css-gen/css-gen.ts#L339

@ghost
Copy link
Author

ghost commented Dec 8, 2020

Sure @ameerthehacker I'd love to take it up!

@ghost
Copy link
Author

ghost commented Dec 19, 2020

I tried to work on this, and it works when added an extra trailing semi-colon ";". Not sure why the existing one would get disregarded.

  if (Array.isArray(directionStringorArray)) {
          return directionStringorArray.reduce((prev, direction) => {
            return `${prev}
                padding${direction}: ${themeValue};;
                `;
          }, '');
        }

The above code generates correct CSS. Otherwise, the semi-colons are missing in-between two rules. Any idea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant