Skip to content

Support id/class in built-in components #182

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

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

lorefnon
Copy link
Contributor

Hello, currently some of the components support id/class like the form components.

I'd like to propose that these be supported in all the built in components where it makes sense.

I am primarily interested in id which is useful for anchor targeting (<a href="#id">Some panel</a>). It makes it possible to have links that scroll to a particular card or chart. For components that have a top level container, the id can be added to the container, and for those that don't have it can be added as a separate anchor.

class is nice to have for styling convenience.

Hope this feature is acceptable. Happy to revise if you have any suggestions.

Copy link
Collaborator

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -20,10 +21,10 @@
row-cols-xl-5
{{/if}}
gx-2 gy-2
mt-1 mb-3">
mt-1 mb-3 {{class}}">
{{#each_row}}
<div class="col">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't you like to allow giving individual cards an id ? This would allow linking to one card in particular.

{{#if action}}action="{{action}}"{{/if}}
{{#if action}}action="{{action}}"
{{else}}
{{#if id}}action="#{{id}}"{{/if}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior needs to be documented

@@ -1,3 +1,4 @@
{{#if id}}<a id="{{id}}" />{{/if}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not directly on the header element ?

@lorefnon lorefnon force-pushed the uniform-id-support branch 2 times, most recently from f2a56a1 to d577d0b Compare January 12, 2024 06:09
@lorefnon
Copy link
Contributor Author

Hi @lovasoa - I have added the docs and updated as per above comments.

Copy link
Collaborator

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎊

@lovasoa lovasoa merged commit 1fa4f93 into sqlpage:main Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants