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

Style code, hr and blockquote within asides #2119

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tender-fishes-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': minor
---

Improve styling of hr, blockquote, and code within asides
delucis marked this conversation as resolved.
Show resolved Hide resolved
97 changes: 97 additions & 0 deletions docs/src/content/docs/guides/asides-test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: ⚠️ Asides Code Test ⚠️
---

## Delete me before merge!

:::tip
Here's our nice new table:

| Astrological Sign | Dates |
| ----------------- | ----------------- |
| Aries | March 21–April 19 |
| Taurus | April 20–May 20 |
| Gemini | May 21–June 21 |

Here's some `code`

Here's an `hr`:

---

And here's a `blockquote`:

> This is a blockquote, which is commonly used when quoting another person or document.
>
> Blockquotes are indicated by a > at the start of each line.

:::

:::note
Here's our nice new table:

| Astrological Sign | Dates |
| ----------------- | ----------------- |
| Aries | March 21–April 19 |
| Taurus | April 20–May 20 |
| Gemini | May 21–June 21 |

Here's some `code`

Here's an `hr`:

---

And here's a `blockquote`:

> This is a blockquote, which is commonly used when quoting another person or document.
>
> Blockquotes are indicated by a > at the start of each line.

:::

:::caution
Here's our nice new table:

| Astrological Sign | Dates |
| ----------------- | ----------------- |
| Aries | March 21–April 19 |
| Taurus | April 20–May 20 |
| Gemini | May 21–June 21 |

Here's some `code`

Here's an `hr`:

---

And here's a `blockquote`:

> This is a blockquote, which is commonly used when quoting another person or document.
>
> Blockquotes are indicated by a > at the start of each line.

:::

:::danger
Here's our nice new table:

| Astrological Sign | Dates |
| ----------------- | ----------------- |
| Aries | March 21–April 19 |
| Taurus | April 20–May 20 |
| Gemini | May 21–June 21 |

Here's some `code`

Here's an `hr`:

---

And here's a `blockquote`:

> This is a blockquote, which is commonly used when quoting another person or document.
>
> Blockquotes are indicated by a > at the start of each line.

:::
13 changes: 10 additions & 3 deletions packages/starlight/style/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,23 @@
.sl-markdown-content th:not([align]):not(:where(.not-content *)) {
text-align: start;
}
/* Table styles inside asides */
.sl-markdown-content .starlight-aside :is(th, td):not(:where(.not-content *)) {
/* <table>s, <hr>s, and <blockquote>s inside asides */
.sl-markdown-content .starlight-aside :is(th, td, hr, blockquote):not(:where(.not-content *)) {
border-color: var(--sl-color-gray-4);
}
@supports (border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 30%, transparent)) {
.sl-markdown-content .starlight-aside :is(th, td):not(:where(.not-content *)) {
.sl-markdown-content .starlight-aside :is(th, td, hr, blockquote):not(:where(.not-content *)) {
border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 30%, transparent);
}
}

/* <code> inside asides */
@supports (border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 12%, transparent)) {
.sl-markdown-content .starlight-aside code:not(:where(.not-content *)) {
background-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 12%, transparent);
}
}

.sl-markdown-content hr:not(:where(.not-content *)) {
border: 0;
border-bottom: 1px solid var(--sl-color-hairline);
Expand Down
Loading