[wp-trac] [WordPress Trac] #21082: The Gallery shortcode relies on #gallery-instance to hook the CSS, but the id sometimes isn't specific enough

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 26 18:43:28 UTC 2012


#21082: The Gallery shortcode relies on #gallery-instance to hook the CSS, but the
id sometimes isn't specific enough
--------------------------+-----------------------------
 Reporter:  matveb        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Gallery       |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 The Gallery CSS selector uses the id attribute, which is of the form
 #gallery-{instance}. On some scenarios (like infinite scroll) a follow up
 gallery on a another post can have the same #gallery-x selector, thus
 over-writing the previous gallery style.

 Proposed solution: make the #id more unique by including the postid
 number. (Attached patch.)

 (It could potentially impact some themes that used #gallery-1 to style
 galleries, but theme's shouldn't be using that in the first place, I
 believe.)

 Furthermore, it may be good to change the whole style block to use classes
 instead of the id so that it's easier for themes to deal with CSS
 specificity—and helps them not fall back to the #id.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21082>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list