Closed anthonyalayo closed 1 year ago
Hi @anthonyalayo, thanks for kind words, it is planned to add documentation for data- attributes. It is on hold right now though, as it is planned to include Mantine components styling with data- attributes in these docs, but not all components are fully ready for this.
Thank you @rtivital !
it would be great if for cases like NavLink, the StylesAPI included an active
key for managing the styles in the theme layer.
This issue is closed for one of these reasons:
If you think that this issue was closed by mistake and it is still an issue in version 7.0, please reopen it.
Link to the page where something nasty is located
https://mantine.dev/styles/create-styles/
Exact quote of what is wrong
Hey all,
First of all, a big thank you to everyone who contributes to this project. I'm an amateur/hobbyist for frontend, but I have seen a lot of libraries. I'm pretty confident when I say Mantine is the best component library I've seen thus far.
I spent some time this weekend reading the docs and playing with the example navbar here: https://ui.mantine.dev/component/navbar-simple
I noticed that compared to the docs, the example was a bit messy. So I took it as an opportunity to learn the library by trying to match the example with a cleaner way of doing it. I eventually ended up with a match:
With that being said, this is where the issue comes in.
The docs only have the following example on how to set active classes: https://mantine.dev/styles/create-styles/#classes-merging-cx-function
Passing both
className
andclassNames
to a single component for this feature felt a bit awkward to me, and I assumed there was a cleaner way to do it.After a lot of digging, I realized that under the hood there are
data-*
attributes on a lot of components. These are not documented anywhere besides being mentioned in change logs.Could we add
data-*
attributes to the documentation?Here is the much simpler implementation using the latest from Mantine (along with Next.js):
Are you willing to create pull request with the fix?
No response