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.

Math

About Math Markdown

Math Examples

KaTeXKaTeX Input and Output
Input Block Inline
TeX
TeXTeX
TeXTeX
KaTeX
KaTeXKaTeX
KaTeXKaTeX
LaTeX
LaTeXLaTeX
LaTeXLaTeX
a^2+b^2=c^2
a2+b2=c2a^2+b^2=c^2
a2+b2=c2a^2+b^2=c^2
a^{23}+b^{225}=c^{56}
a23+b225=c56a^{23}+b^{225}=c^{56}
a23+b225=c56a^{23}+b^{225}=c^{56}
3x^{4x^{2y}+5}
3x4x2y+53x^{4x^{2y}+5}
3x4x2y+53x^{4x^{2y}+5}
\pi\ \Pi
π Π\pi\ \Pi
π Π\pi\ \Pi
\begin{align}
y=\log x \\
y = \log_5 x \\
y = \ln x
\end{align}
y=logxy=log5xy=lnx\begin{align} y=\log x \\ y = \log_5 x \\ y = \ln x \end{align}
\align can only be used in display mode.
\frac{2}{3}
23\frac{2}{3}
23\frac{2}{3}
\dfrac{5}{6}
56\dfrac{5}{6}
56\dfrac{5}{6}
\frac{\sqrt{x+1}}{\sqrt{x+2}}
x+1x+2\frac{\sqrt{x+1}}{\sqrt{x+2}}
x+1x+2\frac{\sqrt{x+1}}{\sqrt{x+2}}
2\left(\frac{1}{x^2-1}\right)
2(1x21)2\left(\frac{1}{x^2-1}\right)
2(1x21)2\left(\frac{1}{x^2-1}\right)
2\left[\frac{1}{x^2-1}\right]
2[1x21]2\left[\frac{1}{x^2-1}\right]
2[1x21]2\left[\frac{1}{x^2-1}\right]
2\left\{\frac{1}{x^2-1}\right\}
2{1x21}2\left\{\frac{1}{x^2-1}\right\}
2{1x21}2\left\{\frac{1}{x^2-1}\right\}
2\left\langle \frac{1}{x^2-1}\right\rangle
21x212\left\langle \frac{1}{x^2-1}\right\rangle
21x212\left\langle \frac{1}{x^2-1}\right\rangle
\left(\frac{1}{1+ \left(\frac{1}{1+x}\right)}\right)
(11+(11+x))\left(\frac{1}{1+ \left(\frac{1}{1+x}\right)}\right)
(11+(11+x))\left(\frac{1}{1+ \left(\frac{1}{1+x}\right)}\right)
Ldots = a_0,a_1,a_2,\ldots, a_{100}
Ldots=a0,a1,a2,,a100Ldots = a_0,a_1,a_2,\ldots, a_{100}
Ldots=a0,a1,a2,,a100Ldots = a_0,a_1,a_2,\ldots, a_{100}
Cdots = a_0,a_1,a_2,\cdots, a_{100}
Cdots=a0,a1,a2,,a100Cdots = a_0,a_1,a_2,\cdots, a_{100}
Cdots=a0,a1,a2,,a100Cdots = a_0,a_1,a_2,\cdots, a_{100}
y=\csc \theta
y=cscθy=\csc \theta
y=cscθy=\csc \theta
y=\arcsin x
y=arcsinxy=\arcsin x
y=arcsinxy=\arcsin x
a(b+c)=ab+ac for all for all a, b, x, \in \mathbb{R}.
a(b+c)=ab+acforallforalla,b,x,R.a(b+c)=ab+ac for all for all a, b, x, \in \mathbb{R}.
a(b+c)=ab+acforallforalla,b,x,R.a(b+c)=ab+ac for all for all a, b, x, \in \mathbb{R}.
\begin{tabular}{|c||c|c|c|c|c|} \hline $x$ & 1 & 2 & 3 & 4 & 5 \\ \hline $f(x)$ & 10 & 11 & 12 & 13 & 14 \\ \hline \end{tabular} No such environment: tabular No such environment: tabular
\begin{align} 5x^2-9&=x+3\\ 5x^2-x-12&=0\\ \end{align}
5x29=x+35x2x12=0\begin{align} 5x^2-9&=x+3\\ 5x^2-x-12&=0\\ \end{align}
{align} can be used only in display mode.
\begin{enumerate} \item Hot Dog \item Mustard \item Buns \item Relish \end{enumerate} No such environment: enumerate No such environment: enumerate
\textbf{bold}\ text
bold text \textbf{bold}\ text
bold text \textbf{bold}\ text
Please\ excuse\ my\ \begin{large}dear\ aunt\ Sally\end{large}. \\
Please\ excuse\ my\ \begin{Large}dear\ aunt\ Sally\end{Large}. \\
Please\ excuse\ my\ \begin{huge}dear\ aunt\ Sally\end{huge}.
No such environment: large No such environment: large

Conclusions:
I had a hard time figuring out how to properly use KaTeX based on the documentation alone. Granted, I have only taken a course on LaTeX that lasted a few hours, but I felt like that should have given me the information I needed to be able to properly parse the docs and use LaTeX.
I wasn't able to really figure out how KaTeX works based on the docs alone, so I created this table to try to see what works and what doesn't. KaTeX seems to work fine to represent equations without the need to escape equations on the client or server, and I planned on using this just to render equations and maybe groups of equations, so the system I am using now seems to work fine for me.
NOTE: If you want to include spaces, make sure to include "\ ".

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.