My Design System

Why I Created a Design System

I was using Material UI for a project, and the bundle size, combined with the css-in-js approach to styling, resulted in an application that was difficult to render on the server and that had a pretty poor initial load time. I wanted to create a design system that was similar to Material UI / Flutter but that emphasized semantic HTML and a small bundle size.

Also, when creating a Rich Text Editor with Lexical, I found that it was best to not use highly abstracted components, so I tried to create a library of simple components that can be easily rendered on the server and that doesn't use too much CSS and JavaScript.

In summary, the goal of the design system is to create a look that is comparable to other popular design libraries used today while minimizing load time, bundle size, and complexity.

Assumptions

The design system assumes that:

  • you want to use HTMX to create a SPA (Single Page Application),
  • you want to use semantic html, but that you want to style components primarily with CSS classes and inline styling,
  • your Content Security Policy allows for inline styling,
  • you want to use Floating UI for tooltips, menus, dropdowns, and the like,
  • you want to have slightly different layouts for desktop and mobile,
  • you want to prioritize mobile devices (you want the application that you show the user to always be similar to the mobile device view),
  • you do not want to listen to resize events on mobile

Explore the Design System

If you are looking for information about specific components or utility classes, use the links in the list below to find more information about those aspects of the system. Each aspect of the design system should describe the styling, accessability, and JavaScript concerns that go along with it.

If you are looking to learn more about the design system and the decisions made, continue reading below or navigate to the 'General' page for the design system.

If you want the code, navigate to the resources section.

Surfaces

About Surfaces

Cards

Cards .el1

Div .el-1 Card Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor possimus delectus, cupiditate tempora sunt corrupti totam. Alias, ex sapiente. Eveniet fugiat odio unde tenetur qui rem, quia dolores consectetur nesciunt!

Here is a card footer

Cards .el2

Div .el-2 Card Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor possimus delectus, cupiditate tempora sunt corrupti totam. Alias, ex sapiente. Eveniet fugiat odio unde tenetur qui rem, quia dolores consectetur nesciunt!

Here is a card footer

Cards .el3

Div .el-3 Card Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor possimus delectus, cupiditate tempora sunt corrupti totam. Alias, ex sapiente. Eveniet fugiat odio unde tenetur qui rem, quia dolores consectetur nesciunt!

Here is a card footer

Colored Backgrounds

Enforced Transparent Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Primary Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Secondary Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Error Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Warning Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Info Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Success Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Secondary Text Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Disabled Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Card Background:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem accusantium consectetur totam est similique, quasi, voluptates mollitia ullam dignissimos omnis enim eum ipsum inventore tempore voluptate pariatur cum. Fugit, labore.

Quotes

Quote-Like Surface:

Here is a quopte like surface that I saw somewhere - I included it because I thought it looked cool.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ratione consectetur ea sit similique earum repellendus fuga ullam doloremque consequatur. Vitae itaque facilis nihil magni ipsa ad ea nostrum mollitia architecto.

Inline Quote:

Walt Disney once said that the way to get started is to quit talking and begin doing

Block Quote:

Do you wish to rise? Begin by descending. You plan a tower that will pierce the clouds? Lay first the foundation of humility.
St Augustine

Asides

Left Aside:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint nulla eius similique, error facilis et deserunt inventore architecto quae sunt, nam,

exercitationem fugiat fuga autem iusto facere tenetur ad quidem! Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae, ducimus quidem nihil consectetur hic tenetur dicta eveniet, maxime sint minima assumenda deserunt aliquid ea, quos veritatis eligendi iste tempore molestias!

Right Aside:

Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint nulla eius similique, error facilis et deserunt inventore architecto quae sunt, nam,

exercitationem fugiat fuga autem iusto facere tenetur ad quidem! Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestiae, ducimus quidem nihil consectetur hic tenetur dicta eveniet, maxime sint minima assumenda deserunt aliquid ea, quos veritatis eligendi iste tempore molestias!

Resources

Click on the individual buttons to download separate files, or click on the All Files button to download a ZIP file of all the code. The code is sent pre-transpiled for readability.
Click on the VSCode Snippet button to download a copy of the html.json file that will make implementing this design system simpler.