product-ride / styled-wind

A magical implementation of tailwind-like classnames into styled-components.

Home Page:https://styled-wind.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

opened this issue · comments

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

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

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

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?