I'm using Microsoft's Fluent UI library to build a React application. For styling of my own components I switched to using their merge-styles library, mainly because it integrates nicely with Fluent UI theming and all of their components. (I'm still not a big fan of CSS-in-JS, mainly because hot reloading in plain CSS / SCSS is smoother, but that's another story).
I still have a lot of components using SCSS, that I want to refactor over time to also use merge-styles. This is no problem for my own components, but it is for third-party components, that are solely stylable via specific CSS classes (plain JavaScript components, wrapped by a thin React component). So in order to style these using merge-styles I would have to use something like mergeStyles
, but with the possbility to force completely fixed CSS class names. I know it's possible to somehow define the shape of the class name, but not providing a completely fixed name, where no number for uniqueness is appended. Did someone ever try this and found a way to achieve this using merge-styles alone or writing a small helper for this case?