simplycodesmart / stellar-ui-workspace

4 stars 1 forks source link

[Question] - How to copy component styles when build occurs #3

Open jneves92 opened 1 month ago

jneves92 commented 1 month ago

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.

Could you help or could you tell me you opinion and I google it?

image

simplycodesmart commented 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.

simplycodesmart commented 1 month ago

@jneves92 have you tried adding

// src/components/Button/index.scss
@import '../theme/global';
@import './buttonStyles';