98.css icon indicating copy to clipboard operation
98.css copied to clipboard

đź§ đź’­ 98.css thoughts

Open jdan opened this issue 9 months ago • 5 comments

Posting this for further discussion!

If I were to redo 98.css today here's what I'd do:

  • Write as a series of utility classes a la tailwind (i.e. class="border-raised-left ... instead of <button />)
    • Potentially this can even be a shadcn config or something
    • LLMs do a great job of generating this type of markup as they are trained on many tailwind examples
  • React components (maybe separate repo)
    • I originally stood firm that the designs were framework agnostic. A valiant goal, but some react examples to actually use these things enables more developers to make more things
  • Extensibility
    • We can't cover everything, and people have wild ideas. It should be very easy for these styles to be portable/extendable. Maybe through more CSS variables

jdan avatar Apr 11 '25 15:04 jdan

I think CSS variables + utility classes would be quite useful for extensibility.

I wrote a small virtual desktop application using this library as the base, but there were a few cases where I wanted access to the underlying colors or border styles for creating elements like a task bar and clock. I noticed that the source CSS actually defines variables, but they end up being stripped out in the distributed CSS by the build process, which is quite a bummer. I ended up vendorizing the distributed CSS file and adding the source CSS variables back in so I could reference them in my project.

brandongregoryscott avatar Aug 22 '25 22:08 brandongregoryscott

Some custom elements would be great here, that way you can keep it framework agnostic.

icidasset avatar Oct 26 '25 16:10 icidasset

@icidasset, that could be a good idea; the downside, perhaps, could be how to wire different components together. For instance, connecting the "maximize button" with the "window component".

Or maybe this is not a concern, is it?

lordrip avatar Oct 27 '25 07:10 lordrip

Yeah good question @lordrip. Shouldn’t be a problem, there’s enough pieces in the standard web platform nowadays to build what you need. Except maybe a few utilities, eg. for rendering; hence why https://lit.dev exists (also a good place to learn about custom elements).

I guess it also depends on what you mean exactly with “wire together”, to me this means the following standard browser features:

Don’t think anything fancy is needed for a project like this though. People can extend the custom elements and add their own reactivity layer from there.

icidasset avatar Oct 27 '25 09:10 icidasset

Ah, right, I forgot about the events. I guess that would be enough to let's say, clicking on the maximize button will increase the <div> element to fill the available size.

lordrip avatar Oct 27 '25 21:10 lordrip