Financial-Times / o-grid

Responsive grid system
http://registry.origami.ft.com/components/o-grid
94 stars 17 forks source link

Implement colum widths using data attribute #24

Closed wheresrhys closed 10 years ago

wheresrhys commented 10 years ago

As discussed here column widths should be specified using a data attribute

<div data-o-grid-sizing="5 S12 XL3">
wheresrhys commented 10 years ago

Implementation details to decide

These will need deciding before release (though not necessarily before development begins)

  1. Name of the attribute - data-o-grid-col would be more consistent with o-grid@1. data-o-grid-width or data-o-grid-span would be (respectively) more descriptive and more in line with other grid frameworks' terminology
  2. Casing - uppercase was suggested to avoid confusion between L and pipe. Maybe still worth keeping to differentiate L and 1, but my preference would be lowercase
triblondon commented 10 years ago

col doesn't work for me, it's not descriptive of what it does. sizing is perfect, in my view, but I'd live with span if everyone else dislikes sizing.

On case, I think the l vs 1 vs | problem is important enough to use uppercase, I'm afraid.

kavanagh commented 10 years ago

col doesn't work for me either.

If we added a few other common grid features like push, pull and center what would that look like?

<div data-o-grid-sizing="6 S12" data-o-grid-pull="6"></div>

or

<div data-o-grid-sizing="6 S12" data-o-grid-pull="1" data-o-grid-center="center"></div>

Having something like data-o-grid-col-sizing and data-o-grid-col-pull would be long.

Also if we needed data attributes on the rows (as well as columns) then we'd want descriptive names there too.

I prefer span as the terminology is more familiar and descriptive IMO. Maybe colspan as a compromise? That would leave room for rowspan.

kavanagh commented 10 years ago

On case, I think the l vs 1 vs | problem is important enough to use uppercase, I'm afraid.

+1

wheresrhys commented 10 years ago

Implemented in branch v2 with colspan, which I think is a good choice as the terminology is familiar from tables and it won't get confusing if in future other things on the grid need to be sized.

Can change it before releasing the 2.0.0 tag if required

triblondon commented 10 years ago

Crikey it's gone all 1999 in here.

wheresrhys commented 10 years ago

Final call for what we should name the attribute responsible for column widths as v2 is ready for release. If you have an opinion please +1 your preference out of the following:

@triblondon @kavanagh @dansearle-ft @matthew-andrews @richard-still-ft @markstephens

markstephens commented 10 years ago

+1 for colspan I feel the other two could be taken with different meaning out of context...

kavanagh commented 10 years ago

Not overly fussed. All of the options work for me.

triblondon commented 10 years ago

I like sizing because colspan gives me flashbacks to 1998, but I'll be happy with colspan or span if there's a majority in favour.

dan-searle commented 10 years ago

spacer gifs? :-)

+1 for colspan. It's unambiguous.

triblondon commented 10 years ago

I'm glad someone else around here is old enough to remember spacer gifs.

Fine, go with colspan.

kavanagh commented 10 years ago

When all the cool kids use our grid library they'll be blissfully unaware of their forebears' toil with colspan. And the veterans will be happy we overwrote the meaning of a dirtied word.

wheresrhys commented 10 years ago

colspan it is then. I'll hopefully get cell-spacing in for 2.1