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

Transform Figma components to React styled components template #3

Open
3 tasks
LimeBeck opened this issue Jan 19, 2021 · 1 comment
Open
3 tasks

Transform Figma components to React styled components template #3

LimeBeck opened this issue Jan 19, 2021 · 1 comment

Comments

@LimeBeck
Copy link
Collaborator

  • Create component template
  • Connect parsed styles and design tokens to components
  • Implement different component states
@LimeBeck
Copy link
Collaborator Author

LimeBeck commented Jan 21, 2021

Можно реализовать через https://styled-components.com/ - там есть возможность оборачивать любой компонент в стили. Сделать отдельно заготовку компонента с логикой и внутренними состояниями, которую больше не трогать, а её уже обернуть в styled component со стилями, который будет каждый раз генерироваться из стилей Figma. Пример оборачивания:

const Link = ({ className, children }) => (
  <a className={className}>
    {children}
  </a>
);

const StyledLink = styled(Link)`
  color: palevioletred;
  font-weight: bold;
`;

render(
  <div>
    <Link>Unstyled, boring Link</Link>
    <br />
    <StyledLink>Styled, exciting Link</StyledLink>
  </div>
);

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