-
Notifications
You must be signed in to change notification settings - Fork 229
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
What's the naming convention for local components? #172
Comments
In this case we have 1-1 of SUIT Component to React Component even private ones. You could say I'm depending on implementation details and should only use |
Another edge case is that a local component returned a |
Now that I've configured everything, it looks like I either have to add comments to each CSS class or use one component per CSS file, so for the example above, I'd need So, I'm going with mashing the local component names into descendant names: .MyComponent {...}
.MyComponent-localComponent {..}
.MyComponent-localComponentForm {..}
.MyComponent-localComponentAnotherLocalComponentInfo {..}
.MyComponent-localComponentAnotherLocalComponentInfoLogo {..} But the preferred solution would be that the Another workaround would be to create separate CSS files for local components and import all the CSS files into the |
Another issue that is possibly a bug: if I define multiple components within one file via comments, the file name is still validated. I think as soon as I use comments, file name should not matter, e.g. I got Workaround - rename file to |
What if I have a
LocalComponent
that's not intended for use outside ofMyComponent
- how do I name CSS classes? Would that be ok?I'm using the underscored name for the descendant but I have to overwrite the Stylelint regexp:
to
^[A-Z][a-zA-Z0-9]+(_[A-Z][a-zA-Z0-9]+)*$
It feels a little off but I think it's ok. I didn't find any docs on that use case, just wanted to confirm.
The text was updated successfully, but these errors were encountered: