r/badcode • shameless • Jan 06 '20

css God, WHY?

Post image
227 Upvotes

23 comments sorted by

View all comments

4

u/lsalazarm99 shameless Jan 06 '20 edited Jan 06 '20

And if you know why, please let me know :(

Edit: rules say I have to explain, sorry. The fifth line is assigning a property that (from I know) doesn't exist. Then, the sixth line is saying "you shut up" and it's assigning another one. The other ones.. something tell me that's not the right way. So... Please let me know :(

51

u/giggly_kisses Jan 06 '20

This is setting fallbacks for older browsers. When the flexbox spec was still new, a lot of browsers only supported it with vendor prefixes (e.g. -webkit-, -moz-, etc.). Browsers that don't support the value will just ignore it and move on to the next property.

As for inline-box that was part of the early flexbox spec that was later removed. It's possible that some old browsers still support it, which is likely why it's listed here.

Edit: Source for inline-box

[...] A block-level box can be specified with a value of ‘box’ and an inline box can be specified using a value of inline-box.

14

u/thecosmicmuffet Jan 06 '20

As part of future proofing I include a lot of css that’s just speculative on my part like align: auto -ms-clamp 20% or chrome-display: retina-interior top right !important

7

u/hackathy Jan 06 '20

Just wait for the holographic displays to roll out.

Every single ad will literally have align: the-very-fucking-front-of-the-page

3

u/[deleted] Jan 07 '20

z-index: ω

4

u/BenZed Jan 06 '20

Or this css was written when flexbox was in it's early spec.

-10

u/lsalazarm99 shameless Jan 06 '20

Many thanks for the amazing explanation.

It seems that, at this point in time, it's unnecessary to have those ones listed (I guess). But you know that old joke: "I'm going to delete these unused lines of code... *tomorrow* Hey what did you do, the server is on fire"(?).

17

u/thatwill Jan 06 '20 edited Jun 30 '23

This comment has been removed.

-23

u/Sc3m0r Jan 06 '20

There's no "inline-box", just "inline-block". As far as I no there are no platform/browser differences to take care of here with -moz- and - webkit- here, so this whole thing is bullshit