A reusable WordPress header component that switches between coordinated dark and light visual states as the page scrolls.
The component is builder-independent. The core CSS and JavaScript are stored once. Integration guides explain how to add the same files to WordPress and visual builders.
View the Header Scroll Logo Swap demo
The included example uses:
The supplied logo files use two matching background colors:
--wpcl-header-dark: #313737;
--wpcl-header-light: #f1ece6;
cube-logo-dark-bg.jpg is used on the initial dark header.cube-logo-light-bg.jpg is used on the light scrolled header.Because the supplied assets are JPG files with solid backgrounds, the header backgrounds should match these values to reduce visible edges around the images.
header-scroll-logo-swap/
├── README.md
├── CHANGELOG.md
├── styles.css
├── script.js
├── assets/
│ ├── README.md
│ ├── cube-logo-dark-bg.jpg
│ └── cube-logo-light-bg.jpg
├── examples/
│ ├── README.md
│ ├── index.html
│ └── example.css
└── integrations/
├── README.md
├── child-theme.md
└── bricks.md
wpcl-header
wpcl-header__inner
wpcl-header__logo
wpcl-header__logo-image
wpcl-header__logo-image--dark-bg
wpcl-header__logo-image--light-bg
wpcl-header__toggle
wpcl-header__nav
wpcl-header__menu
wpcl-header__cta
JavaScript adds these state classes:
is-scrolled
is-menu-open
The script also adds wpcl-menu-open to the body element while the mobile navigation is open.
styles.css to the website.script.js in the footer.examples/index.html.The core component does not depend on a specific builder.
The integrations folder documents how to add the files and classes in different WordPress setups. Builder-specific guides should be added only after the component has been tested in that builder.
Every repository change should include:
CHANGELOG.md when behavior, design, structure, or installation changesThis keeps the component history easy to understand.