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

Laying the groundwork for good handling of unused CSS #1850

Open
sungik-choi opened this issue Dec 20, 2023 · 0 comments
Open

Laying the groundwork for good handling of unused CSS #1850

sungik-choi opened this issue Dec 20, 2023 · 0 comments
Labels
enhancement Issues or PR related to making existing features better

Comments

@sungik-choi
Copy link
Contributor

sungik-choi commented Dec 20, 2023

Description

애플리케이션에서 라이브러리의 Unused CSS를 잘 처리할 수 있는 환경을 마련해두자.

Reasons for suggestion

https://tailwindcss.com/docs/content-configuration#dynamic-class-names

The most important implication of how Tailwind extracts class names is that it will only find classes that exist as complete unbroken strings in your source files.

If you use string interpolation or concatenate partial class names together, Tailwind will not find them and therefore will not generate the corresponding CSS:

  • TailwindCSS와 같은 케이스처럼, PurgeCSS와 같은 unused CSS 처리 툴들을 잘 지원하려면 classname을 display && styles[display-${display}] 와 같이 사용하지 말아야 할 거 같습니다.
  • CSS Modules와 결합되었을 때 유의미한 일인지 체크해봐야합니다.

Proposed solution

컴포넌트가 Tree shaking 되었을 때, 애플리케이션의 최종 CSS에 포함되지 않은 컴포넌트의 CSS도 포함되는지 테스트가 필요함.

References

@sungik-choi sungik-choi added the enhancement Issues or PR related to making existing features better label Dec 20, 2023
@github-project-automation github-project-automation bot moved this to 📌 Backlog in Bezier React Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues or PR related to making existing features better
Projects
No open projects
Status: 📌 Backlog
Development

No branches or pull requests

1 participant