Styling Guide
This guide explains how to use the modern styling features in the Nostria documentation.
๐จ Overview
The documentation now features a beautiful, modern design with:
- Modern color palette with CSS variables for easy theming
- Enhanced typography with improved readability
- Syntax-highlighted code blocks with a dark theme
- Alert boxes for notes, warnings, and tips
- Responsive design that works on all devices
- Smooth animations and transitions
- Custom scrollbars for a polished look
- Dark mode support (automatic based on system preference)
๐ Using Alert Boxes
You can create beautiful alert boxes using custom classes:
Info/Note
<div class="note">
๐ This is an informational note. Use it for helpful information.
</div>
Warning
<div class="warning">
โ ๏ธ This is a warning. Use it to highlight potential issues.
</div>
Danger
<div class="danger">
โ This is a danger alert. Use it for critical warnings.
</div>
Tip/Success
<div class="tip">
๐ก This is a helpful tip. Use it for best practices and recommendations.
</div>
๐ฆ Card Components
Create beautiful card-style content blocks:
<div class="card">
<div class="card-title">Card Title</div>
This is content inside a card. Cards are great for highlighting important information or grouping related content.
</div>
This is content inside a card. Cards are great for highlighting important information or grouping related content. </div>
๐ป Code Blocks
Code blocks are automatically styled with syntax highlighting:
JavaScript Example
function greet(name) {
console.log(`Hello, ${name}!`);
return `Welcome to Nostria`;
}
const message = greet('User');
Python Example
def calculate_total(items):
"""Calculate the total price of items."""
total = sum(item.price for item in items)
return total
# Usage
result = calculate_total(shopping_cart)
JSON Example
{
"name": "Nostria",
"version": "1.0.0",
"features": [
"Decentralized",
"Private",
"Fast"
]
}
๐ท๏ธ Badges
Use badges to highlight versions, status, or categories:
<span class="badge badge-primary">Primary</span>
<span class="badge badge-success">Success</span>
<span class="badge badge-warning">Warning</span>
<span class="badge badge-danger">Danger</span>
Primary Success Warning Danger
โจ๏ธ Keyboard Shortcuts
Display keyboard shortcuts nicely:
Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
Press Ctrl + C to copy.
Use โ + V to paste on macOS.
๐ Tables
Tables are automatically styled:
| Feature | Description | Status |
|---|---|---|
| Decentralized | No central authority | โ Active |
| Private | End-to-end encryption | โ Active |
| Fast | Optimized performance | โ Active |
| Cross-platform | Web, Desktop, Mobile | โ Active |
๐ฏ Blockquotes
Blockquotes have a modern, card-like appearance:
๐ก Pro Tip
You can combine multiple styling elements to create rich, engaging documentation. Don't be afraid to experiment!
๐ Color Variables
The theme uses CSS variables that can be customized:
--primary-color: #6366f1 (Indigo)--accent-color: #ec4899 (Pink)--success-color: #10b981 (Green)--warning-color: #f59e0b (Amber)--danger-color: #ef4444 (Red)
๐ Links
Links are styled with the primary color and include hover effects:
- Internal Link
- External Link - External links show an arrow โ
๐ฑ Responsive Design
The documentation is fully responsive and looks great on:
- ๐ฑ Mobile devices (phones)
- ๐ฑ Tablets
- ๐ป Laptops
- ๐ฅ๏ธ Desktop monitors
- ๐บ Large displays
โจ Best Practices
- Use semantic HTML - Use proper heading hierarchy (h1, h2, h3, etc.)
- Add visual breaks - Use horizontal rules (
---) to separate sections - Highlight important info - Use alert boxes for warnings and tips
- Keep it clean - Don't overuse styling elements
- Be consistent - Use the same patterns throughout your documentation
- Use emojis sparingly - They add personality but too many can be distracting
- Test responsiveness - Check how your content looks on different screen sizes
๐จ Customization
To customize the theme:
- Edit
styles/website.cssto change CSS variables - Add custom styles in the same file
- Rebuild the documentation with
npm run build - Preview changes with
npm run serve
๐ Advanced Features
Collapsible Sections
The documentation supports expandable chapters in the sidebar for better organization.
Back to Top Button
A "back to top" button appears when scrolling down for easy navigation.
Enhanced Search
The search functionality is powered by the search-plus plugin with improved accuracy.
Splitter
You can resize the sidebar to your preferred width.
GitHub Integration
Links to the GitHub repository are integrated in the sidebar.