-
Notifications
You must be signed in to change notification settings - Fork 137
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, that sounds useful !
I'll merge, but all of the new attributes need to be documented first in https://github.com/lovasoa/SQLpage/blob/main/examples/official-site/sqlpage/migrations/01_documentation.sql (and other doc files in https://github.com/lovasoa/SQLpage/tree/main/examples/official-site/sqlpage/migrations )
sqlpage/templates/card.handlebars
Outdated
@@ -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"> |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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
sqlpage/templates/hero.handlebars
Outdated
@@ -1,3 +1,4 @@ | |||
{{#if id}}<a id="{{id}}" />{{/if}} |
There was a problem hiding this comment.
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 ?
f2a56a1
to
d577d0b
Compare
d577d0b
to
90d3a4a
Compare
Hi @lovasoa - I have added the docs and updated as per above comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎊
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.