This is a really cool idea. The use of custom attributes without `data-` before it makes me a little nervous. Is that a concern here? I saw `project` being used on elements and if that's officially used for something eventually can it muddy things up?
HN user
criswell
Mediocre Web Developer
https://bsky.app/profile/crswll.dev
This takes away so many of the criticisms I see in this thread. The issue with Tailwind, and my only minor criticism, is just long, unreadable, not easy to deliminate lists of classes. This very easily takes care of that (and I use it for more complex class lists daily)
If I didn't sit at a desk way too much I'd give it a shot. There seems to be some solid advantages.
I really like Arc. Takes some getting used to but worth the adjustment I think.
"it's trivial to edit and add stuff, and requires basically no maintenance whatsoever."
What an absolute dream.
If every instinct you have is wrong, then the opposite would have to be right.
I don't recall that, just to not rely on the order of an object's keys, which appears to be outdated advice (at least for Javascript).
https://2ality.com/2015/10/property-traversal-order-es6.html
give me apache directory listing styled websites or give me death
I want to say this but too lazy to defend it.
This is why I'm so bummed by it.
Intellisense would help a lot with this task: https://gist.github.com/crswll/db0d276bbf0884b003f3715d48e68...
Looking forward to the takes on your 91st account.
I know it's going to be abused to hell like everything popular but definitely a useful power tool.
It'll be really nice for container queries when they're ready. Something like: `wider-than-[500px]:hover:text-red-500` and so on.
Also super nice for `:has` (although ordering is a concern at the moment): `[:has(:invalid)]:bg-red-500`.
You can't get punched in the mouth on the internet.
There's `space-y-N` which does exactly this, `space-x-N` for horizontal.
If you want to change the padding in a project that's using Tailwind you only need to look for classes that begin with `p` followed by a letter for a side or x and y for an axis (same is true for margins). Those are by far the most cryptic classnames and by the time you finish reading this sentence you got it.
In a project where you have to name everything semantically you don't know where the hell the padding is going to be.
It's amazing for long term maintainability and quick prototyping. There is a lot of value in classes that does one thing well.
Been wrinting CSS for 15 years, switched to Tailwind 2 years ago, just for reference.
Yeah, but humans.
I'm sorry I'm just not seeing the value in it. I'm just seeing more complexity JS and CSS wise without solving any problems.
I'm just saying if you want to target something on an element it needs to be set in an attribute and classList takes care of this.
I use classes strictly for styling. I change these styles by adding and removing class names and classList handles it very well without me needing to read the data attribute, make it an array, manipulate it, join it and update the attribute.
I wasn’t aware of the tilde attribute selector. Still a lot more characters, though.
The classList api is still a lot more suited for this than dataset. None of the modifications done through the dataset api would reflect in the DOM and be readable by CSS unless you were to convert the list to a space separated string and explicitly set the attribute. classList handles all of this for you.
Totally talking without thinking about it too much here:
The classList API makes modifications to the class property very easily.
You'd be essentially limited to one identifier in attribute selectors. You can't really select from multiple identifiers with a data attribute without doing like:
[data-hover*="foo"]
which would search for "foo" anywhere in the attribute, which could mean incorrect substring matches.Chaining attribute selectors would be rough too:
[data-hover*="foo"][data-hover*="bar"] {}
vs .foo.bar {}You're changing the source order doing this which can get messy plus generating a lot of long selectors. Example:
.m4, .profile-card, .other-card,
.header, .foo, blah {
margin: 4em;
}This is how you can do all of that:
class="hover:red" -> .hover\:red:hover { color: red }
class="before:red" -> .before\:red::before { color: red }
class="medium:red" -> @media (min-width: 500px) { .medium\:red { color: red }
The important thing though is it doesn't need to be used for everything. I think it makes a lot of sense for structural stuff. When you dig into like, children of a hovered element I can see it getting a little messy.I'm a frontend developer of about 15 years as well and I think functional css makes a lot of sense. My biggest argument for it is not having to name every thing. You know how many times I've had to think of a name for a random container that exists simply to align some crap? Then if you need another wrapper or something for that for some reason? It eliminates the name game (whenever you want it to).
You can use `text-primary` or `text-secondary`. Sure it's less obvious looking at the markup what something looks like but it allows for theming.
Hopefully most are updating the property and not the attribute.
It would only give you the last character of the password though. You can use CSS selectors to check the start [value^=a] and anything in the middle [value*=a] as well though which can be revealing I imagine.
I love the logo. Making something as scary as a { look friendly.
Why was it hard to read for you? I'm having no trouble. I'm wondering if a lot of the CSS is more tailored towards macOS/Chrome? Also, the site being responsive makes `Command +`ing work beautifully (if the issue is font-size, but it's 18px which is larger than most sites I come across).
If you like this, you'll lOoOoOoOve this: http://cssreference.io/