Spoko Design System Theme

SDS is the easiest way to start with some my websites. Since Astro is compatible with many frameworks, we can import components and document them right in the markdown files.

The project was inspired by the Astroship starter and Astro Design System Theme (the latter is currently not developed, nor is it responsive, but the nice organization in the configuration files appealed to me a lot).

It’s still in the development phase, use at your own risk ;-)

Getting started

Adding new sections

Although it’s not required, you can create folders for new sections.

To show the section on the left side navigation, add it to the navigation config file at src/config.ts.

Example:

export const SIDEBAR = [
    { text: "Core", header: true },
    { text: "Introduction", link: "/core/introduction" },
    ...,
    { text: "Components", header: true },
    { text: "Buttons", link: "/components/buttons" },
    ...,
    { text: "New section", header: true },
    { text: "New component", link: "/new-section/new-component.md" },
];

Adding new pages

To add new pages just create an .astro or markdown file in src/pages/[section]/my-page.mdx. Remember to add it to the navigation config in src/config.ts so it shows up in the left side navigation.

You’re free to organize the pages however you want.

Customizing Core section (colors, typography, shadows…)

If you want to customize the default colors, typography or shadows you can find the configuration file at src/design.config.ts. I think I have prepared enough shades of blue ;-)

Feel free to add new pages to the Core section

Customizing the page layout

You can find the css for the pages in src/styles/content.css.

Adding mew components

Astro is great for design systems because it allows you to import components from different frameworks like react, vue or svelte.

To get started check how the Button component is used in the src/pages/buttons.mdx file.

You can import your component library or create your own and document it easily.

.component-preview utility

There’s a class called .component-preview that you can use to wrap your component in a grid, and it will look like this:

Have fun!

Spoko Design System template was made by @spokospace for personal and commercial use.