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

Asides (Admonitions) restyle #36

Merged
merged 8 commits into from
May 31, 2024

Conversation

mikimih
Copy link
Contributor

@mikimih mikimih commented May 31, 2024

Restyle Starlight Admonitions Based on Design

This PR adds a new Aside component to match the design for admonitions.

How to Use in MDX Files

There are two ways to create admonitions:

  1. Using a pair of triple colons:
:::note
Starlight is a documentation website toolkit built with [Astro](https://astro.build/).
:::

:::tip[Did you know?]
Astro helps you build faster websites with [Islands Architecture](https://docs.astro.build/en/concepts/islands/).
:::

:::caution
Think twice before using [Starlight](/) if you're unsure.
:::
  1. Using the Custom Aside Component:
import Aside from "@components/Aside.astro";

<Aside type='tip' title="Did you know?">
  Astro helps you build faster websites with [Islands Architecture](https://docs.astro.build/en/concepts/islands/).
</Aside>

Notes

  • The default Starlight Aside component cannot be overridden. Therefore, we created a similar custom Aside component.
  • The design requires a custom icon for "tip" admonitions. Notice the difference in the icon between:
<Aside type='tip' title="Did you know?">
  Astro helps you build faster websites with [“Islands Architecture”](https://docs.astro.build/en/concepts/islands/).
</Aside>

and

:::tip[Did you know?]
Astro helps you build faster websites with [“Islands Architecture”](https://docs.astro.build/en/concepts/islands/).
:::
  • Styling is the same for both methods.

We recommend using the second option with the Aside component, as it uses the icons from our design.

Screenshot 2024-05-31 at 11 07 48

Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>

# Conflicts:
#	astro.config.mjs
Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
Copy link
Contributor

@osslate osslate left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@osslate osslate linked an issue May 31, 2024 that may be closed by this pull request
@osslate osslate requested a review from nkkko May 31, 2024 10:25
Copy link
Member

@ivan-burazin ivan-burazin left a comment

Choose a reason for hiding this comment

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

@mikimih tip has the wrong icon. Please double check this things before submitting

Signed-off-by: Mihael Vitlov <mihael.vitlov@arasdigital.co>
@mikimih
Copy link
Contributor Author

mikimih commented May 31, 2024

As I explained in my initial PR comment:

The default Starlight Aside component cannot be overridden, which results in the default Starlight icon on "tip" admonitions with triple colons (:::) syntax.

To address this, I created a custom Aside component to use the correct icons per our design. This custom component should be used in MDX files for accurate "tip" annotations.

I've now pushed updates to the MDX files, replacing the triple colon syntax with a custom Aside component.

@osslate
Copy link
Contributor

osslate commented May 31, 2024

Thanks @mikimih! Just to note that there are admonitions left to change to <Aside>, but I opened issue #37 to track this earlier. I'll send a PR to change them docs-wide.

@osslate osslate merged commit 6de1f6d into daytonaio:main May 31, 2024
1 check passed
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.

Restyle Starlight admonitions based on design
3 participants