fubhy is going to kill me for continuing to harp on this, but I believe that adding extra classes to the first and last columns in a grid would allow more flexibility in theming and choice of grid systems. I've implemented this and will submit a patch.

CommentFileSizeAuthor
#1 add-first-last-classes-1545796-0.patch2.75 KBrlhawk

Comments

rlhawk’s picture

Status: Active » Needs review
StatusFileSize
new2.75 KB

Here's the patch.

rlhawk’s picture

I ran tests using Apache Bench before and after patching and found no significant performance hit. Even so, it could be a good idea to add a setting for including the extra classes, so they wouldn't be added if not needed. This is assuming that the feature actually works. It does in my tests, but I look forward to feedback from the community and especially from the maintainers.

bdevore’s picture

Not sure if this related enough, but would it be possible to build in some kind of support for custom $zebra values so that .alpha and .omega can be added to views queries depending on the result#? I'm not finding much documentation on how views builds the css variables out, but maybe I don't know where to look?

PCateNumbersUSA’s picture

fLove this idea! Is there a chance the patch will be included future versions of the theme without the need for a patch? Also, I haven't tested it myself, but does this patch add classes to all grid columns (included nested ones inside content), or does it just work on the theme layout grid columns?

rlhawk’s picture

It only adds first and last classes to the regions within a zone, based on their positions in the grid. It doesn't do anything with the content, including views, inside the region.

rlhawk’s picture

I'm going to create code for subthemes that will do this for now, so patching won't be necessary. I'll post it in the Omega group when it's ready, along with a pointer here.

rlhawk’s picture

Here's the code I'm using in my Omega subthemes to add first and last classes to regions: http://pastebin.com/z1CJtWfW

ApacheBench results (using ab -n 100 -c 10 http://MYURL/):

BEFORE ADDITIONAL CODE:
Requests per second: 19.49 [#/sec] (mean)
Time per request: 513.125 [ms] (mean)
Time per request: 51.312 [ms] (mean, across all concurrent requests)

AFTER ADDITIONAL CODE:
Requests per second: 19.41 [#/sec] (mean)
Time per request: 515.243 [ms] (mean)
Time per request: 51.524 [ms] (mean, across all concurrent requests)