News for hackers. Stuff that matters.
Re:Grid Garden – A game for learning CSS grid by pidg on Wednesday April 05, 2017 @09:19AM (#14041852)
Nice game!

This made me uncomfortable though (about CSS grid, not about the game):

grid-area: row start / column start / row end / column end;

So you have to put the rows (Y axis coordinates) first and columns (X axis coordinates) second, i.e. the opposite of how it's done in every other situation - i.e. draw_rect(start_x, start_y, end_x, end_y)

(1, 1, 3, 4) in every other language would draw a box 2 wide and 3 high, but in css grid it selects an area 3 wide and 2 high.

Also the fact it uses 'row' and 'column' to describe the gridlines rather than the actual rows and columns irked me.

I'm sure I'll get over it!

Re:Grid Garden – A game for learning CSS grid by kenbellows on Wednesday April 05, 2017 @04:41PM (#14045432)
Indexing into 2D containers is often an exception to the "x, then y" rule; indexes are very often specified with "row, then column"[1]. It's true that this is different to Cartesian coordinates, but grid cells aren't points or locations on a Cartesian plane, they're members of a 2D container: the grid.

1: https://en.wikipedia.org/wiki/Index_notation#Two-dimensional...

Re:Grid Garden – A game for learning CSS grid by yellowapple on Thursday April 06, 2017 @01:16PM (#14052525)
This is also consistent with how tables are typically laid out in HTML (cells/columns inside rows). Considering that grids are supposed to be the modern/responsive/semantic/etc. equivalent of table-based layout, the conventions here are not terribly surprising.

That said, I don't tend to use the shorthands.

Re:Grid Garden – A game for learning CSS grid by chme on Wednesday April 05, 2017 @10:17AM (#14042226)
I am not a web developer and this kind of grid addressing bewildered me too.

Why isn't 0 the left most line as column and the top most line as row. That would make so much more sense, IMO.

What could be the reason they haven't done it this way? Or are 1 based arrays normal here?

Re:Grid Garden – A game for learning CSS grid by irishsultan on Wednesday April 05, 2017 @10:30AM (#14042310)
Unfortunately it's somewhat consistent with the rest of css (e.g. padding is top left bottom right)
Re:Grid Garden – A game for learning CSS grid by judah on Wednesday April 05, 2017 @10:55AM (#14042504)
Small correction: padding is top right bottom left. In other words, clockwise.
Re:Grid Garden – A game for learning CSS grid by cr0sh on Wednesday April 05, 2017 @12:48PM (#14043446)
I always used the mnemonic "TRouBLe" to remeber the order.

There was another one for a different CSS thing (that I'm blanking on) that was based on the word "love" or something like that...

Re:Grid Garden – A game for learning CSS grid by danadam on Wednesday April 05, 2017 @02:03PM (#14044139)
LoVe HAte, the order of pseudo classes: :link :visited :hover :active
Re:Grid Garden – A game for learning CSS grid by yellowapple on Thursday April 06, 2017 @01:18PM (#14052539)
I'm starting to suspect that CSS was invented by Taylor Swift.
Re:Grid Garden – A game for learning CSS grid by cr0sh on Wednesday April 05, 2017 @08:00PM (#14046817)
That's it! Thank you!
Re:Grid Garden – A game for learning CSS grid by irishsultan on Wednesday April 05, 2017 @10:56AM (#14042515)
Makes more sense, I always forget, which is why I looked it up, but apparently I either misread something or I can't remember it for longer than 2 or 3 seconds.