Open jneves92 opened 1 month ago
It often depends on your project's needs. A hybrid approach can be effective: use owned styles for highly specific components but utilize a theme library for shared styles and global theming.
Owned Styles: Pros: Components with owned styles are self-contained, making them easy to use without external dependencies. This approach is great for creating reusable components that maintain their look regardless of the broader design context. Cons: It can lead to redundancy in styles if multiple components have similar styling needs, and managing consistency across your design system can become challenging.
Theme Library: Pros: A theme library promotes consistency across components, allowing for easier updates and maintenance. It centralizes styling, making it easier to implement design changes across your entire application. Cons: It may require more setup initially and could lead to issues if components aren’t well-integrated with the theme.
@jneves92 have you tried adding
// src/components/Button/index.scss
@import '../theme/global';
@import './buttonStyles';
I have a sdk library for my design system. I followed your tutorial to create a sdk library with multiple entry points. Now I am creating some components but I have some questions.
My first question is between creating component with owned styles or creating a theme lib. Is create component with owned styles a good practice or the most preferred way is create overall styles in a lib called theme?
My second question is how to copy each styles into each entry point.
Could you help or could you tell me you opinion and I google it?