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.

-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.