Open Props – Supercharged CSS Variables

63 pointsposted 3 days ago
by homarp

13 Comments

notpushkin

3 days ago

I can’t point my finger at it, but something really feels off about the layout of this page. A bunch of different spacing sizes mashed together, maybe? Doesn’t look good for a design token library website. Love the idea though!

positus

3 days ago

I think it is that the elements alternate in height between the left and the right columns, creating a weird kind of feeling of instability as you move down the page. The vertical rhythm of the layout creates a feeling of unsettledness and disease.

Ardon

3 days ago

I thought so too, tried putting a max width on the body and centering it. Ended up looking substantially better to my eye.

gedy

3 days ago

Tailwind is fine for some use cases, but this and https://pollen.style are probably better baselines for apps and following a design system. They let you define classes and components with some global consistency, without forcing the micro class names into every HTML element.

(Yes I know you could make UI components that use Tailwind classes, but if you have a diverse stack or legacy code, it's not easy to bolt in the TW build system or assume one technology like React, etc)

afavour

3 days ago

Curious to know if anyone has compared this to Pollen:

https://www.pollen.style/

I’ve used Pollen as an alternative to the bulk of Tailwind and have been very happy with it.

Brajeshwar

3 days ago

If you like Pollen, you will like the idea of Fluid Responsive Typography and modular spacing. Check out https://utopia.fyi

If pollen spells out each and every variable, the idea behind utopia will set you with something that you can use a few and it works across various screen sizes.

For colors, start looking at CSS's support OKLCH. It is a tad new but the support is pretty rock solid now. https://oklch.com/

Here is what I think. You can have color variables like `--grey-500` which has the value `light-dark(oklch(mid-value), oklch(another-value))`. Now, you just play with a common color token and your light-dark theme should be taken care of. The tint and shade can be either automated or manually tweak by tinkering with the OKLCH either high/low.

Finally with @container, one might not need to define media-queries at all or at just specific high-level wrappers/containers.

9dev

3 days ago

Doesn’t that take the main advantage of Tailwind away, in that I have to name hundreds of arbitrary things again, and inevitably build a crude cascade framework..? I mean I get the idea and it’s sure smart, but not having to come up with a class name hierarchy with Tailwind has been such a boon to my productivity, I wouldn’t want to trade that in.

afavour

2 days ago

The primary benefit of either is a unified design system. The implementation method differs. I strongly dislike the way Tailwind does it (especially when dealing with stuff like media queries) and vastly prefer the way Pollen does. Matter of preference. The fact that I don’t have to add anything to my build tools is an extra bonus.

user

2 days ago

[deleted]

moralestapia

2 days ago

This is the right solution to whatever problem Tailwind solves.

user

3 days ago

[deleted]