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

RFC: next-yak #626

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

RFC: next-yak #626

wants to merge 2 commits into from

Conversation

SebiVPS
Copy link
Contributor

@SebiVPS SebiVPS commented Dec 19, 2024

Description

Replaced styled-components with next-yak.

To Be Discussed:

  • I used contants instead of full theme context. next-yak would provide theming, but its solved with local cookies. When we use CSS variables for theming, we do not need full theme context support.

Solutions for missing features:

  • currently .withConfig and the as prop are not supported. -> Solution to replace as usage?
  • no replacement for createGlobalStyle found (how to solve DisableBodyScroll gobal style?

ToDos:

  • improve global.css (how to use yak constants?)

To test:

  • Usage with Real Server Components
  • Performance
  • Full test of all components

Recap

Good

  • Easy to use (DevXP), same syntax as styled-components.

Not so good

  • missing features (as and createGlobalStyle - we will find solutions for that)
  • Compatibility (we are behind with next and react, so we are forced to use v2 for now)
next-yak Next.js react swc_core
4.x >= 15.0.4 19.x 5.0.1
3.x 15.x 18.x / 19.x 3.0.2
2.x 14.x 18.x / 19.x 0.279.0

@@ -0,0 +1,49 @@
export const colors = {
Copy link
Contributor Author

@SebiVPS SebiVPS Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the migration from the old solution even simpler, we could export here one "theme" object with the same structure like before with all constants, instead of multiple separated objects. Noticed that a bit too late.

@SebiVPS SebiVPS marked this pull request as draft December 19, 2024 13:23
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

Successfully merging this pull request may close these issues.

1 participant