Live data from Hacker News

HTML-first, framework-agnostic implementation of shadcn/UI – franken/UI

franken-ui.dev

191–193 of 193 posts

Re: HTML-first, framework-agnostic implementation of shadcn/UI – franken/UI

#191
post #187
post #184

Earlier quoted context omitted.

Of course I know CSS shorthand by memory (and most of Tailwind too), and yeah definitely googled "tailwind box shadow" more often (which one is which). Back in my day we used Bootstrap classes but those guys put -15px margins everywhere so nobody uses their library anymore LOL

Knowing the shorthand and actually writing it are different things. If I get a visual spec from a designer, I'm not going to try out various numbers until it fits the image. I'll either ask them for the specific attribute if their tool allows for that or replicate it with a generator. And if I'm fully in control myself, I'm going to use a generator too as I'll want it to look a specific way, which is easier to achiev…

> Knowing the shorthand and actually writing it are different things

CSS shorthand meaning:

  margin: 0 0 1rem;
which is the same as:

  margin-top: 0;
  margin-right: 0;  
  margin-bottom: 1rem;
  margin-left: 0;
etc.

I can't imagine how you would know the shorthand without first knowing the longer form. CSS shorthand requires that you know the original form + the order of values in shorthand, and when values can be omitted along with special formatting as in:

  font: normal normal 1em/1.6em sans-serif;
CSS shorthand is - I would say - more advanced than long form.

> I'm going to ask the designer what units to use

I would never get in the habit of letting a designer tell the front-end developers how to write CSS, mainly because they work in pixels, when the developer is often using viewport units, rem for sizing, em for fonts and icons relative to an initial size and current user zoom factor, and flex gaps and alignment for spacing. That level of collaboration and specification on spacing, sizes, etc. between the developer and designer (redlining) might be part of an initial design system discussion, but the resulting component library is probably translated into a style system that works well for the engineering team.

I think it's good you're using CSS generators, I learned most of CSS that way via Dreamweaver, and have copy/pasted from CSS Tricks countless times for edge case stuff - it's a great way to learn.

Re: HTML-first, framework-agnostic implementation of shadcn/UI – franken/UI

#192
post #181

Earlier quoted context omitted.

That's a very extreme example, and yes, I would just use the bracket syntax in Tailwind because I can see clearly that's not what I want for box-shadow. If I didn't know how box shadow worked, Tailwind made it easier for me to decide by having defaults in the docs that map to the actual CSS.

> a very extreme example It's not very extreme, it's literally any time you deviate from their prefab - so any truly custom UI. The size of shadow (corner radius, font-size, etc.) at different steps are hard-coded in Tailwind, if you want something else that's up to you. In terms of colors (text, background, etc.) they have a default palette, colors like "slate", etc. but anything else is up to you. So - most brands.…

I meant that it's an extreme example of a tailwind utility doing a lot of settings for you. Versus, say, `italic`, which just does `font-style: italic;`. I can hardly compare that to an ORM where people can make full apps without learning SQL.

> if you want something else that's up to you

Right, just like CSS. It's a very light helper library that isn't dissimilar from CSS. That's my point.

Re: HTML-first, framework-agnostic implementation of shadcn/UI – franken/UI

#193
post #179

Earlier quoted context omitted.

Tailwind is just a convenience compiler for CSS, it's hardly a framework.

by that logic nothing is a framework, everything "compiles" to js and css

I didn't say it wasn't a framework because it compiles. I would expect framework to be a large shift in how you write or structure code. But there's no agreed definition.
Post reply on HN