Skip to content
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

Optional class/id attribute #9

Open
jamestrenda opened this issue Jun 29, 2023 · 1 comment
Open

Optional class/id attribute #9

jamestrenda opened this issue Jun 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jamestrenda
Copy link

First off, great little plugin!

One small issue. It's purely aesthetic. The way Sanity spaces the fields in the form makes it feel like these notes aren't directly related to the field they're above. I'd like to bring the bottom margin down on these notes, so they look more like they're a part of the field for which they're noting, but there's currently no reliable identifier on the markup to hook into.

Can you please give the outer Card element a specific class name like sanity-plugin-note-field or let us add our own classes to the rendered Card element?

And before you say open a pull request, I probably will not. This seems simple enough to get around to whenever you can get around to it. Correct me if I'm wrong though. Maybe it's not trivial. ¯_(ツ)_/¯

It's a subtle change, but I think it makes a big difference.

Thanks!

@ndimatteo ndimatteo added the enhancement New feature or request label Jul 5, 2023
@ndimatteo
Copy link
Owner

Hey there @jamestrenda!

I totally understand your request, however note fields were never intended to be "related" to adjacent fields. They are stand-alone fields, much like any other field you'd add to your schema.

Additionally, the spacing between fields is not controlled by this plugin, but rather by the core Sanity Studio, through the use of a <Stack /> component.

There's no elegant way to provide a negative margin to negate the stack spacing, as that's not a valid value per the Sanity UI specs.

However, I think what I'd be willing to do is add a data-note attribute so that you could more easily target the field via custom CSS.

I can add this in on the next release 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants