Skip to:
Content

BuddyPress.org

Changeset 11263


Ignore:
Timestamp:
12/02/2016 09:42:18 AM (4 years ago)
Author:
hnla
Message:

Correct twentysixteen .no-js class conflict with BP's version of same class on body element

Commit adds a ruleset specific to twntysixteen to hide the onclick dropdown mobile menu on page load.

Twentysixteen adds a hardcoded class to the html element & changes class if JS active scripted in the 'head'; BP runs similar but on body el & changes no-js class on DOM fully loaded.

Menu remains in view after clicking due to 2016 updating js class early and BP lagging behind.

Ruleset targets body element if it has a class .no-js and it's parent has class .js thus we only run if JS active and for initial page load sequence.

See #7314

Location:
trunk/src/bp-templates/bp-legacy/css
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/css/twentysixteen-rtl.css

    r11132 r11263  
    5959*-------------------------------------------------------------------------------
    6060*/
     61/**
     62* Corrective measure to deal with 2016 / BP handling of no-js
     63* classes - hide menu if BP still showing 'no-js'.
     64*/
     65@media screen and (max-width: 905px) {
     66    html.js body.no-js .site-header-menu {
     67        display: none;
     68    }
     69}
     70
    6171.buddypress div.clear {
    6272    display: none;
  • trunk/src/bp-templates/bp-legacy/css/twentysixteen.css

    r11132 r11263  
    5959*-------------------------------------------------------------------------------
    6060*/
     61/**
     62* Corrective measure to deal with 2016 / BP handling of no-js
     63* classes - hide menu if BP still showing 'no-js'.
     64*/
     65@media screen and (max-width: 905px) {
     66    html.js body.no-js .site-header-menu {
     67        display: none;
     68    }
     69}
     70
    6171.buddypress div.clear {
    6272    display: none;
  • trunk/src/bp-templates/bp-legacy/css/twentysixteen.scss

    r11132 r11263  
    236236*/
    237237
    238 
     238// A conflict between BP's body.no-js being removed only
     239// when the DOM is fully loaded & Twentysixteens hardcoded
     240// class on the html el & scripting in head at start of DOM
     241// causes mobile menu to stay opened too long.
     242// This ruleset hides menu if html.js (2016 JS has kicked in) but BP still
     243// rendering body.no-js before it's own JS removal kicks in.
     244// See trac ticket https://buddypress.trac.wordpress.org/ticket/7314
     245
     246/**
     247* Corrective measure to deal with 2016 / BP handling of no-js
     248* classes - hide menu if BP still showing 'no-js'.
     249*/
     250
     251@media screen and (max-width: 905px) {
     252
     253    html.js {
     254
     255        body.no-js {
     256
     257            .site-header-menu {
     258                display: none;
     259            }
     260        }
     261    }
     262}
    239263
    240264.buddypress {
Note: See TracChangeset for help on using the changeset viewer.