GitHub-Style Alerts
Alternative styling for asides using GitHub's visual design
GitHub-Style Alerts
In addition to Starlight-style asides, you can use GitHub-styled alerts with the same simple syntax. Just prefix the type with gh- to get GitHub's visual design.
Syntax
:::gh-note
Your content here
:::
MarkdownAvailable Types
Note (Blue)
Syntax:
:::gh-note
Highlights information that users should take into account, even when skimming content.
:::
MarkdownTip (Green)
Syntax:
:::gh-tip
Helpful advice for doing things better or more easily.
:::
MarkdownImportant (Purple)
Syntax:
:::gh-important
Key information users need to know to achieve their goal.
:::
MarkdownWarning (Yellow/Orange)
Syntax:
:::gh-warning
Urgent info that needs immediate user attention to avoid problems.
:::
MarkdownCaution (Red)
Syntax:
:::gh-caution
Advises about risks or negative outcomes of certain actions.
:::
MarkdownCustom Titles
Just like Starlight asides, you can add custom titles:
Syntax:
:::gh-tip[Pro Developer Tip]
Use meaningful variable names to make your code self-documenting!
:::
MarkdownFull Markdown Support
GitHub alerts support all markdown formatting:
Comparison: Starlight vs GitHub
Starlight Style
GitHub Style
When to Use Each Style
Use Starlight Style When:
- ✅ You want a clean, modern documentation look
- ✅ You prefer subtle, elegant design
- ✅ Building technical documentation
Use GitHub Style When:
- ✅ Your content is hosted on GitHub
- ✅ You want familiar GitHub aesthetics
- ✅ You prefer bold, high-contrast alerts
- ✅ Migrating content from GitHub README files
Real-World Examples
Installation Warning
Security Notice
Feature Announcement
Prerequisites
Helpful Hint
Combining Styles
You can mix Starlight and GitHub styles in the same document:
Color Reference
GitHub Light Mode
- Note: Blue (
#ddf4ffbackground,#0969datext) - Tip: Green (
#dcffe4background,#116329text) - Important: Purple (
#f6e7ffbackground,#6e1a52text) - Warning: Yellow/Orange (
#fff8c5background,#7d4e00text) - Caution: Red (
#ffebe9background,#d1242ftext)
GitHub Dark Mode
All colors automatically adjust for dark mode with proper contrast.
Best Practices
✅ Do
:::gh-note
Clear, concise information that adds value.
:::
:::gh-warning
Specific warning about a real potential issue.
:::
Markdown❌ Don't
:::gh-note
This is a note. This is some text. Here's more text.
Random information that goes on and on without clear purpose...
:::
:::gh-caution
Minor suggestion that isn't actually dangerous.
:::
MarkdownTips for Educators
- Match your platform - Use GitHub styles if your course materials are on GitHub
- Be consistent - Pick one style (Starlight or GitHub) and stick with it
- Use appropriately - Don't overuse alerts; they lose impact
- Choose the right type - Use
importantfor must-know info,tipfor helpful hints
Example: Complete Tutorial Section
Creating Arrays
JavaScript arrays can hold multiple values:
const numbers = [1, 2, 3, 4, 5];
const fruits = ['apple', 'banana', 'orange'];
JAVASCRIPTBoth Starlight and GitHub styles give you powerful ways to highlight information. Choose the style that best fits your content and audience! 🎨