[buddypress-trac] [BuddyPress] #4869: BP Theme Compat & BuddyPress Widgets styles

buddypress-trac noreply at wordpress.org
Mon Mar 25 19:51:26 UTC 2013


#4869: BP Theme Compat & BuddyPress Widgets styles
----------------------------------------+------------------
 Reporter:  imath                       |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  1.7
Component:  Theme                       |     Version:  1.7
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+------------------

Comment (by boonebgorges):

 I've done some thinking about this, and I think that r6865 is a good
 enough solution for now.

 For one thing, it's not trivial to add some styles to a widgets-only
 stylesheet, and then to load only that on child blogs. That's because the
 widget inherits at least some of its styles from the main buddypress.css.
 And duplicating those inherited styles in a widgets-only stylesheet will
 make it more complicated for themers to make consistent changes across
 sites. In any case, since buddypress.css is fairly stripped down (it only
 applies to the `#buddypress` div, unlike the heftier stylesheet of bp-
 default), it's not likely to clash with other stylesheets, so there
 shouldn't be any compatibility issues if we load buddypress.css even when
 it's not used. And CSS files are so aggressively cached by browsers that
 it shouldn't matter in terms of performance.

 More generally, I don't think there's a huge performance issue with
 running the theme compat process on blogs other than the root blog. For
 templates, theme compat only kicks in when `bp_locate_template()` (or a
 related function) is called, which it won't be on these child blogs. For
 CSS, loading the stylesheet is fairly harmless; see the paragraph above.
 The only real worry is our JS, where there could, in theory, be conflicts
 with markup in a child theme. In a perfect world, we'd do some rudimentary
 checks before attaching any of our jquery stuff (like, we'd check for the
 presence of `#buddypress` or something), but IMO it's only in a fairly
 extreme edge case that there'd be a problem, so it's not pressing to fix
 for 1.7.

 Finally, while I think it's fine to run theme compat on non-root blogs, I
 do like some of r-a-y's other suggestions: namely, (a) moving the bp-
 default, etc checks into a `start()` method of the parent class, and (b)
 introducing the locate_templace( 'members/members-loop' ) brute-force BP
 compatibility check. Moreover, I think that they are very good things to
 introduce before 1.7, because it'll set the stage for the best practices
 in child theming/template-pack development (for instance, we'd have a hard
 time moving the `setup_globals()` calls later on, if template packs had
 already implemented it the old way). So I'm going to go ahead and commit
 those changes, and close this ticket.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4869#comment:9>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list