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

Improve callouts #72

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Improve callouts #72

merged 2 commits into from
Oct 27, 2023

Conversation

salim-b
Copy link
Contributor

@salim-b salim-b commented Oct 26, 2023

Summary

Tweak Callouts to

  • yield optimal result with all possible input combinations.
  • support Markdown formatting in title.
  • generate predictable markup (text always wrapped in <p></p> etc.).
  • not attempt to set stroke-width on the SVG (cannot work).
  • consistently use Bootstrap's utility classes for margins and padding.

Before, for a callout with icon, the layout differed depending on whether a title was supplied or not. Margins also weren't optimal.

I thoroughly tested the overhauled callouts!

Example screenshots

Screenshots are based on (a subset of) the following shortcode invocation:

{{< callout context="tip" icon="viewfinder" title="Attention is `all` u need" >}}
  Caution and danger callouts are helpful for drawing a user’s attention to details that may trip them up. If you find yourself using these a lot, it may also be a sign that the thing you are documenting could benefit from being redesigned.

  Caution and danger callouts are helpful for drawing a user’s attention to details that may trip them up. If you find yourself using these a lot, it may also be a sign that the thing you are documenting could benefit from being redesigned.
  
  Caution and danger callouts are helpful for drawing a user’s attention to details that may trip them up. If you find yourself using these a lot, it may also be a sign that the thing you are documenting could benefit from being redesigned.
{{< /callout >}}

Screenshot 2023-10-26 at 07-49-47 Privacy policy

Screenshot 2023-10-26 at 07-50-00 Privacy policy

Screenshot 2023-10-26 at 07-51-43 Privacy policy

Screenshot 2023-10-26 at 07-50-14 Privacy policy

Screenshot 2023-10-26 at 07-50-27 Privacy policy

Screenshot 2023-10-26 at 07-51-57 Privacy policy

Screenshot 2023-10-26 at 07-51-15 Privacy policy

Screenshot 2023-10-26 at 09-02-08 Privacy policy

Screenshot 2023-10-26 at 07-50-59 Privacy policy

(The last one ist just an empty callout, i.e. {{< callout context="tip" >}}{{< /callout >}}.)

Checks

  • Read Create a Pull Request
  • Supports all screen sizes (if relevant)
  • Supports both light and dark mode (if relevant)
  • Passes npm run test

@salim-b salim-b mentioned this pull request Oct 26, 2023
4 tasks
Copy link
Member

@h-enk h-enk left a comment

Choose a reason for hiding this comment

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

🤩 Thanks!

@h-enk h-enk merged commit 80583ca into thuliteio:main Oct 27, 2023
@salim-b salim-b deleted the tweak-callouts branch October 27, 2023 12:08
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.

None yet

2 participants