529
Average CSS (lemm.ee)
submitted 1 week ago by [email protected] to c/[email protected]

I am not allowed to credit the site that has this disaster. Its owner said "Nobody should see that"

top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 107 points 1 week ago

The author should be killed for indentation alone.

[-] [email protected] 20 points 1 week ago* (last edited 1 week ago)

I know, right? Needs more tab.

load more comments (1 replies)
[-] [email protected] 94 points 1 week ago

Client: "Can you switch these two colours, you have 1 minute to fix it or you're fired!"

Result:

[-] [email protected] 71 points 1 week ago
color: lime !important;
z-index: 1000000;

[-] xmunk 53 points 1 week ago

I love the superstitious z-index just in case it does something to help.

[-] [email protected] 1 points 6 days ago

It's a good indicator that someone is desperate and/or doesn't know what they're doing.

[-] independantiste 23 points 1 week ago

At least that's actually easy and quick to do and is the only way of doing it. Centering a div however has 81639393 ways and it seems the one that works is different every time

[-] [email protected] 45 points 1 week ago

Bro its so easy bro, just use flexboxgridcolumns its been a standard since 2010 just flex it bro you haven't learned to flex yet just check w3c schools and add a flex you can polyfill it but don't use that hacked one use the good flexpolyfill then { content-align-middle-child-elements: center-middle-true-neutral } so easy with flex bro

[-] [email protected] 17 points 1 week ago

I know you meant this sarcastically, but yes, flex is a good option for centering something. Either that or setting the left and right margins of the element to auto, which is generally even easier.

Basically, if you're in a flex container use flex, if you're in a grid use grid, and if neither of those apply set the left and right margins to auto.

[-] [email protected] 6 points 1 week ago

Also seriously, anybody having problems with flexbox should try this:

https://flexboxfroggy.com/

I'm not sure there's any version of it for grids, but IMO grids are inherently more intuitive, so it may not be needed. Flexbox is the one that is hard to learn.

load more comments (3 replies)
[-] [email protected] 10 points 1 week ago

Dude, stop flexing on him. You're gonna make him cry.

[-] independantiste 10 points 1 week ago

You've perfectly captured twitter tech bro energy it's kind of incredible actually

load more comments (10 replies)
[-] [email protected] 31 points 1 week ago

Not allowed to credit the site in your text editor?

Is the owner in the room with you now?

[-] [email protected] 14 points 1 week ago

This screenshot is not mine, it was sent to me via Matrix

[-] [email protected] 19 points 1 week ago

You get used to it. I don't even see the code

[-] [email protected] 10 points 1 week ago

Do you have a built-in browser in your brain that renders it?

[-] [email protected] 14 points 1 week ago

All I see is blonde, brunette, redhead. Hey uh, you want a drink?

load more comments (5 replies)
load more comments (1 replies)
[-] [email protected] 25 points 1 week ago

Well, that's what you get for using classes like "white" and "lime".

[-] dajoho 8 points 1 week ago

Exactly this. Bootstrap killed the css star.

[-] [email protected] 24 points 1 week ago

People learning CSS through shitty frameworks:

[-] independantiste 22 points 1 week ago

At first I only noticed the indent. Wtf

[-] [email protected] 19 points 1 week ago

I'm appalled that classes representing visual styles are still a thing. I thought everyone already figured that it was a bad idea back in bootstrap days. But then I recently had an opportunity to work on project that uses Vuetify and saw quite long poems about flexboxes in class names...

[-] [email protected] 7 points 1 week ago
load more comments (2 replies)
[-] [email protected] 6 points 1 week ago

Aren't classes in CSS supposed to represent visual styles? What else could they be for?

[-] [email protected] 21 points 1 week ago

Pretty sure they're referring to class names describing the visual style being applied, rather than what that class represents semantically.

E.g. .red-bold vs. .error-text

[-] [email protected] 7 points 1 week ago

Oh, that makes sense.

load more comments (6 replies)
[-] [email protected] 16 points 1 week ago

"Some coders just want to watch the word ~~burn~~ get colored white and/or lime."

And if you delete one or the other, or condense the code into a single command, the whole site breaks.

[-] [email protected] 9 points 1 week ago* (last edited 1 week ago)
[-] [email protected] 34 points 1 week ago

Isn't cascading styles the whole point of Cascading Style Sheets?

[-] [email protected] 25 points 1 week ago* (last edited 1 week ago)

You absolute fool. You must never utter its full name, lest you summon its wrath!

[-] [email protected] 14 points 1 week ago

I don't get it, isn't this a pretty normal way of using media queries. Granted you're more likely to see the widths defined in px.

[-] [email protected] 11 points 1 week ago

Shhh... The poster doesn't understand CSS and we shouldn't embarrass them in a community with memes

load more comments (1 replies)
[-] dajoho 8 points 1 week ago

I am very, very surprised about the competence of the commenters here. I have had many discussions on reddit about the advantages of meaningful instead of presentational class-naming and you're normally met with great resistance, especially with users of frameworks like Bootstrap and Tailwind.

Here, everyone seems to either 'get it' or is willing to hear why classes like .lime are bad. Very cool.

[-] [email protected] 3 points 6 days ago

Frameworks like bootstrap are a cancer.

[-] [email protected] 1 points 6 days ago

good for quick and dirty small projects tho...

[-] [email protected] 2 points 6 days ago

Ikr, like I don't need a full feature full stack framework... I just want my tech demo to not look like it was made in the 80s without spending hours. (I'm mostly a backend dev)

[-] [email protected] 2 points 6 days ago

It is like fentanyl don't do it

[-] [email protected] 2 points 6 days ago
[-] [email protected] 2 points 6 days ago

It's not too surprising. Consider the sort of person who would have abandoned reddit for Lemmy during the APIcolypse last year.

[-] [email protected] 6 points 1 week ago

People that advocate for presentation naming haven't endured a major company rebrand.

load more comments (1 replies)
[-] [email protected] 7 points 1 week ago
load more comments (2 replies)
load more comments
view more: next ›
this post was submitted on 07 Jul 2024
529 points (96.8% liked)

Programmer Humor

18388 readers
791 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS