feat(docs): add why page

This commit is contained in:
Ayo Ayco 2025-03-26 21:40:38 +01:00
parent 519573916c
commit 379addc4be
3 changed files with 26 additions and 14 deletions

View file

@ -17,6 +17,7 @@ export default defineConfig({
items: [ items: [
// Each item here is one entry in the navigation menu. // Each item here is one entry in the navigation menu.
{ label: 'Getting Started', slug: 'guides' }, { label: 'Getting Started', slug: 'guides' },
{ label: 'Why?', slug: 'why' },
], ],
}, },
{ {

View file

@ -0,0 +1,12 @@
---
title: Why use this base class?
slug: 'why'
---
Often times, when simple websites need a quick custom element, the best way is still to create one extending from `HTMLElement`. However, it can quickly reach a point where writing the code from scratch can seem confusing and hard to maintain especially when compared to other projects with more advanced setups.
Also, when coming from frameworks with an easy declarative coding experience (using templates), the default imperative way (e.g., creating instances of elements, manually attaching event handlers, and other DOM manipulations) is a frequent pain point we see.
This project aims to address these with virtually zero tooling required and thin abstractions from vanilla custom element APIs giving you only the bare minimum code to be productive.
It works on current-day browsers without needing compilers, transpilers, or polyfills.

View file

@ -7,30 +7,29 @@ hero:
# image: # image:
# file: ../../assets/houston.webp # file: ../../assets/houston.webp
actions: actions:
- text: Example Guide - text: Get Started
link: /guides/example/ link: /guides/
icon: right-arrow icon: right-arrow
- text: Read the Starlight docs - text: Play on CodePen
link: https://starlight.astro.build link: https://codepen.io/ayoayco-the-styleful/pen/PoVegBK?editors=1010
icon: external icon: external
variant: minimal variant: minimal
--- ---
import { Card, CardGrid } from '@astrojs/starlight/components'; import { Card, CardGrid } from '@astrojs/starlight/components';
## Next steps
<CardGrid stagger> <CardGrid stagger>
<Card title="Update content" icon="pencil"> <Card title="Reactive." icon="rocket">
Edit `src/content/docs/index.mdx` to see this page change. A robust API for synchronizing your component's UI and properties
</Card> </Card>
<Card title="Add new content" icon="add-document"> <Card title="Tiny." icon="add-document">
Add Markdown or MDX files to `src/content/docs` to create new pages. ~1 kB base class (minified, compressed) with versatile utilities
</Card> </Card>
<Card title="Configure your site" icon="setting"> <Card title="Easy" icon="heart">
Edit your `sidebar` and other config in `astro.config.mjs`. Sensible life-cycle hooks that you understand and remember
</Card> </Card>
<Card title="Read the docs" icon="open-book"> <Card title="Familiar" icon="open-book">
Learn more in [the Starlight Docs](https://starlight.astro.build/). Use the built-in JSX-like syntax or bring your own custom templating
</Card> </Card>
</CardGrid> </CardGrid>