-
Notifications
You must be signed in to change notification settings - Fork 99
Feature Request - Add CSS classes for styling #189
Description
Right now I'm finding it very difficult to style the portal. Styled Components are great and I love to use them for all of my own projects, but at the same this is a portal that is meant to be customized, often according to corporate design rules. The generated class names make it impossible to target specific elements of a page.
Example:
I need to add a simple left-hand border to the right-hand TOC menu. That's impossible right now because in the entire hierarchy there is no class to target it. I can't use aside.sc-bRubDb because obviously this can change. I could try to add a nested child selector (starting from body) to target it, but this can easily break if anything in the main structure happens to change in an update. It's also not possible to override the TOC component via the _overrides directory because it's not a UserComponent, and even if it were, the portal components are not open source (at least I can't find the original source anywhere apart from a few PR examples), and I would be stuck to reading the compiled and minified React.createElement code in node_modules/@redocly/developer-portal/dist/engines/src and painstakingly reinterpreting that as JSX to make sure it retains the identical behavior, just to add a few styles to it. I already had to do this this with the NavBar component because I had to add dropdown menus. It took a while to understand that your PRs are code examples because it's far from obvious and I haven't seen them mentioned anywhere in your documentation, and they of course don't match the original components 1:1.
It would be really helpful if you could add CSS classes to all of your components as hooks for styling. I would save myself hours of work if I could just add a global style such as .toc { border-left: 1px solid grey; } instead of going through the process above.
