Email or username:

Password:

Forgot your password?
Foone🏳️‍⚧️

remember kids: the point of the html "class" attribute is to list out the explicit formatting of every element on your webpage.

CSS was supposed to split formatting from HTML! and it did.

now instead of horrible HTML like <font size="7" color="red">, we have CSS!
So our HTML can instead look like:
<div class="size-7 color-red">

note: you'll need to include a few hundred KB of CSS libraries to make this work properly, but that's the price we have to pay for elegance

69 comments
Alexis Deveria

@foone This is why I still use <font> tags, cuts out the middle man

F4GRX Sébastien

@foone maybe html was right to mix contents and formatting?

Studio 8502 :verified:

@f4grx @foone Allowing too much customization is how we got a shitty broken Web in the first place.


@mos_8502 @f4grx @foone boooooo 🍅🍅🍅🍅🍅🍅🍅​

Dieu

@f4grx @foone the bad thing about good ideas often is that they need to be applied with taste and judgement.

maya 🎃

@foone adamwathan.me/css-utility-clas
but what if we need to apply the same set of styles to different classes, and also our keyboards don't have commas on them?

Arthur wyatt

@foone oh I’ll just have a class name like b54c-332d-cca1-7a6d and serve up some CSS for that on the fly.

Chris Armstrong

@arthurwyatt @foone
Never mind the classes, the overengineered hell my employer used to host its brand hub seems to do that for the goddamn *URL*.

Foone🏳️‍⚧️

No one hates the modern web more than web scrapers, and unfortunately I have been coding those for like a decade and a half

DELETED

@foone That was the only thing I was ever good at coding in Python.

Eaton

@foone why make divs when we can make new custom shadow-divs

Robert Wire

@unlofl @foone Don't worry, you can add CSS animations and JavaScript event handlers to make it look/behave more and more like a real button! It's called "progressive enhancement"!!1
-- statements made by the utterly deranged^W^W^W StackOverflow

sirlan

@unlofl@mstdn.social not accurate enough, would be more like

<!-- button -->
<div class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">

Ian Rudderbutt

@unlofl this is the biggest “thanks, I hate it”

Craig Rangoon

@unlofl Just gonna hang onto this for when my IT Department says the semantic HTML documentation I wrote for the so-called "shadow IT" projects they refused to do for me is too confusing and should be templated Word doc.

DELETED

@foone
I was wondering what new challenges you are seeing?

I'm maybe not noticing them.

User-Agent sniffing is fairly easy to automate my way out of, by faking user-agent strings, special sentinel headers or cookies can take a bit more thought; but if it's designed to be on the public internet; I feel like scraping has never been easier.

React et-al mangling classes is a bit more awful for me.

Rho

@foone mitm app scrapers are the only thing worse, I hated writing those 😬

Blake Leonard

@foone@digipres.club Most "modern web" developers (or rather, their bosses) consider this a feature.

Studio 8502 :verified:

@foone Christ that's fugly, misused HTML and CSS.

We need to implement licensing for devs like we do for electricians, so we can revoke and bankrupt people who do this shit while taking people's money.

Jenny :bf_trans:

@foone Me before reading this post: "I could never hire myself out for webdesign, I haven't seriously tried to do it for like a decade, my skills are surely too out of date to be useful."

Me after reading this post: "How much should I charge to rescue someone's website it am the designers whose skills aren't a decade out of date?"

Jenny :bf_trans:

Seriously considered adding the "GetFediHired" hashtag to that shitpost.

Just saying, I don't fuck around with "CSS libraries," I write a damn CSS file. I'm not too bad at it, and I've been learning some of the non-awful new hotness lately. And I don't know the value of my work so you can totally pay me a pittance; I'll probably think you're paying me too much.

...that last part is definitely not going on my next resume revision. :blobcatgiggle:​

Mike McCaffrey

@foone I mean, that is one way that many people do it, but those people should be ridiculed and shunned.

Max Lee :pizzablobcat:

@foone well at least Google supposedly downranks sites that are too heavy... feels like a deal with the devil though.

silver

@foone christ. i can never feel bad about my own site's coding while knowing professional websites are all built like this...

TobyBartels

@foone : The best part is that you can redefine the class so that it has this name but the font size is 16 and the color is green (plus it's all underlined for some reason), and you'd have no idea unless you opened up the separate CSS file located in a different folder (or even a different server if you're ambitious).

OpenDNA⚙️

@TobyBartels @foone pfff! Amateur hour.

Professionals use a Javascript library to modify CSS. 🗡☠️

Cocoa

@foone@digipres.club Honestly I love CSS and this style of writing CSS makes me want to set things on fire. I blame Tailwind tbh.

Kevin Boyd

@foone I do admit that I like tailwind ... but I also like real CSS.

Recently, I used CSS variables and a single '<body class="dark">' to add dark mode to an entire site. Smoove.

Kevin Boyd

@foone (and yes, i know that there are other ways to approach dark mode - including automatically inferring device settings - but in this case it needed to be user controlled)

Neo
@foone you're also not supposed to use div anymore if it can be helped
DELETED

@foone
that is not how you are supposed to author HTML or CSS

Sure some authors choose to overload classes with utility oriented CSS, like you showed, but there have been better ways formalised for over a decade.

Robert Wire

@foone Oh hey, isn't that this "Tailwind" thing?

DELETED

@foone I Shouldn't tag them, but I remember @tantek.com being particularly passionate about the use of HTML class attributes and their actual use-case.

Steve

@foone I actually hate it. It used to be that you could see the HTML source and actually read it and envision the output. Now, there's libraries and shit everywhere. It might have added to the aesthetics of the web, but it has also made participation in the web exclusive to those who can write the stuff. There was a brief period in the 90s when writing your own code was far more accessible to more people.

Bartimaeus

@spearmintwarlock @foone I do remember in the 00 years me and my classmates made own styles for MySpace and later for Tumblr. Sparkling gif background, goth music by opening the site, we constantly switched the curser of the users around.

I miss the ugly 00 web🥲

Steve

@Bartimaeus @foone Yes, the Myspace era was the last gasp for the user- created web. I miss it too.

OpenDNA⚙️

@spearmintwarlock @Bartimaeus @foone For a mood boost, teach a Gen Z vanilla html the MySpace Way.

r҉ustic cy͠be̸rpu̵nk🤠🤖

@foone We were so busy fighting the attribute war, we forgot it was all a class war after all

Digital Mark λ 📚 🕹 💾 🥃

@foone What's great is, now when the company rebrands in 6-18 months, they can just change .color-red { color: green; } and it's done everywhere!

holothuroid

@foone I believe that code in one file vs code distributed over several files is discussed too little in general.

OpenDNA⚙️

@holothuroid @foone
<head>
<?php include 'stylesheet.css'; ?>
</head>

holothuroid

@opendna

That doesn't solve the problem.

Rather you'd need autocomplete by feature. Like you want red text, your editor should show you a list of css classes that make the text red.

Or give you suggestions like "You are using color-red size-7 together 6 times. Would you like to introduce a semantic class?"

If such is not possible, people will use Tailwind etc.

@foone

jomo

@foone am I doing this right?

<div class="qwertyuiop zxcvbn asdf">
<div class="fjrjfkjs kyktkdba fktkdbs">
<div class="jfneks rggkd whrnfkf">
<div></div>
</div>
<div class="hwjdbd fmgjd ejgkgk">
<div class="hrfjr fktmrj lhlrkr>hello world</div>
</div>
</div>
</div>

Cybarbie

@jomo @foone xml is a garbage format and was a huge mistake.

Louis Couture :quebec: 🇵🇸🕊️🇮🇱

@jomo @foone <div class="hrfjr fktmrj lhlrkr>hello world</div>
There's a missing " after the class name so no

thomas (they/them) 🌺

@foone Ugh I miss the good old days of

<FONT size="7" color="red">

Foone🏳️‍⚧️

@thomasreggi well the good news is that backwards compatibility is great so that still works!

Cyberspice

@foone @philpem I’ve always felt most people just don’t get it and do it wrong. It should be <div class=“comment-title”> or something.

andwhyisit

@foone There is a special circle of hell for people who pull that sort of shit with class names.

Meowski's Catgirl Grooming Service
@foone that's the best part about it- when you hate your shitty web dev job, and your boss wants to change the color-red to blue, you just leave the color-red class everywhere and change it to blue in your stylesheet. problem solved.
gunstick

@foone
and then we get webpages which look like this
<div class="class363737 class47593">

Adriano

@foone some poor bastard who came up with tabindex or with the submit event on pressing enter cries softly in his beer.

Go Up