by jwarren on 4/5/17, 11:50 AM with 131 comments
by ajross on 4/5/17, 2:31 PM
1. Grid columns and rows are 1 indexed instead of 0, ensuring a coming decade of mistakes due to the mismatch with Javascript (and, y'know, everything else) conventions for arrays.
2. Grid extents use the "one more than end" convention instead of "length", which is sorta confusing. But then they call it "end", which is even more so.
(edit) more:
3. grid-area's four arguments are, in order (using normal cartesian conventions to show how insane this is): y0 / x0 / y1 / x1. Has any API anywhere ever tried to specify a rectangle like this?
by pidg on 4/5/17, 1:19 PM
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!
by ysavir on 4/5/17, 1:33 PM
Is Chrome 56 so outdates that this grid box doesn't work with it?
Or, perhaps, does the game only check if I'm running the "latest" version, regardless of which browsers do or do not actually work with Grid Garden?
Edit: Oh, wow, 56 is that outdated. Talk about cutting edge technology?
by jwarren on 4/5/17, 11:51 AM
by cr0sh on 4/5/17, 5:00 PM
But (and nothing against the author of the game)...
I'm going to jump on the bandwagon here of others wondering just what the person or committee who thought up the API was smoking when they came up with it?
At first, it made kinda sense. Nothing too troubling.
But the deeper it went, the less it made sense. I don't have a problem with 1 vs 0 indexing (because I started coding in old-school BASIC back in the dinosaur days of microcomputing - so that doesn't bother me much).
It's just that the rest of the API seems arbitrary, or random, or maybe ad-hoc. Like there were 10 developers working on the task of implementing this, but with no overall design document to guide them on how the thing worked.
I'm really not sure why there's two (or three? or four?) different ways to express the same idea of a "span" of row or column cells, based on left or right indexing, or a span argument, or...???
Seriously - the whole thing feels so arbitrary, so inconsistent. This API has to be among the worst we have seen in the CSS world (not sure - I am not a CSS expert by any means). I can easily see this API leading to mistakes in the future by developers and designers.
We'll also probably see a bazillion different shims, libraries, pre-compilers, template systems, whatever - all working on the same goal of trying to fix or normalize it in some manner to make it consistent. Unfortunately, all of these will be at odds with one another.
I'm sure JQuery will have something to fix it (if not already). Bootstrap too.
The dumb thing is that had this been designed in a more sane fashion, such hacks wouldn't be needed.
by clishem on 4/5/17, 2:03 PM
by stigi on 4/5/17, 1:48 PM
by legulere on 4/5/17, 1:23 PM
by Kezako on 4/5/17, 2:03 PM
by jonahx on 4/5/17, 12:55 PM
by ArlenBales on 4/5/17, 4:59 PM
I would never use CSS grid to do what this game is asking me to, so even though it helps me learn the syntax and properties, it's not helping me learn how it's going to be applied to an actual website.
by philh on 4/5/17, 2:59 PM
by codyb on 4/6/17, 1:17 AM
grid-column-start: 0 - doesn't exist grid-column-start: 1 - leftmost square grid-column-start: 2 - 2nd square left to right grid-column-start: -1 - also doesn't exist? grid-column-start: -2 - rightmost square
Very strange. Although the concepts are neat so far.
The / notation in grid-column: 2 / 4;
is interesting. I'm surprised it's not similar to say margin: 20 30 20 20;
where there's no slash, just an ordering to remember (clockwise from top).
Default span is 1 which is sensible so grid-column: 3 === grid-column: 3/4 === grid-column: 3/span 1;
Wow the fr unit is pretty neat!
You can see where the slash is very useful in grid-template which makes a lot sense for dynamic numbers of rows and columns.
Very fun. I still have some questions about the numbering, but a great way to learn about CSS grid and have a bit of fun.
by enugu on 4/5/17, 2:07 PM
by welpwelp on 4/5/17, 1:07 PM
by pc2g4d on 4/5/17, 8:46 PM
Anybody have an explanation for this surprising behavior?
by gondo on 4/5/17, 12:44 PM
by smpetrey on 4/5/17, 2:13 PM
by EamonnMR on 4/5/17, 2:22 PM
by nvdk on 4/5/17, 2:57 PM
edit: scratch that I was confusing css grid for flexbox, my browser does not support css grid yet.
by Honzo on 4/5/17, 1:18 PM
by Pigo on 4/5/17, 1:41 PM
by weavie on 4/5/17, 2:47 PM
by friendzis on 4/5/17, 12:42 PM
One more excuse not to use HTML tables in our toolbox
by julie1 on 4/5/17, 8:58 PM
Rule#1 of GUI every geometry manager will reinvent Tk/Tcl poorly saying it is crap.
by sultanofsaltin on 4/5/17, 4:39 PM
by Twisol on 4/5/17, 12:58 PM
by selbekk on 4/5/17, 1:43 PM
by danadam on 4/5/17, 6:09 PM
Ever heard of this thing called "contrast"? Could use some.
by kiflay on 4/5/17, 3:40 PM
by darth_mastah on 4/5/17, 10:45 PM
As a side note, I find the grid API confusing as well.
by chasing on 4/5/17, 2:31 PM
by suyash on 4/5/17, 4:39 PM
by PericlesTheo on 4/5/17, 12:40 PM
by trippo on 4/7/17, 8:20 AM
by redsummer on 4/5/17, 3:59 PM
by macphisto178 on 4/5/17, 12:26 PM
by pjmlp on 4/5/17, 1:46 PM
Oh well, maybe in 5 years time I can make use of this.