8

Why does the css border-spacing have to be different in how it takes 2 values.

If you look at margin and padding properties when passing in 2 values, you pass in:

margin: (top/bottom)px (left/right)px;

However, when using border spacing:

border-spacing: (left/right)px (top/bottom)px;

I know I’m simplifying here, but it’s goddamn irritating how it’s takes in vertical and horizontal spacing the other way around. Who the hell thought that was a good idea

Comments
  • 2
    One of the curses of backwards compatibility. In fact, that reminds me, look up curses. The c library. It takes coordinates in (y, x) format and hasn't changed it because of backwards compatibility.
  • 1
    @AlgoRythm hahah, reminds me of OpenCV which uses BGR for colours instead of RGB. For compatibility reasons, of course
  • 0
    @AlgoRythm honestly when it comes to drawing on screens y,x really is the more logical way to think about it.

    But it still fucks with me everytime I get back in to ncurses.
  • 1
    @deadPix3l Cartesian coordinates don't make much sense in a fixed (and flipped) 2D plane without actual negative values anyways. That's one thing I love about HTML/ CSS: They use the top/ left system, which makes so much more sense.

    Remember that in Cartesian graphs, y = 0 is at the bottom but in screens y = 0 is the top.

    In short, fuck x and y!
Add Comment