cherry.js

A native optimization engine.

Feature Coverage

Cherry.js scans for common technical debt and applies surgical fixes without dependencies.

Module Action Impact
Inclusivity ARIA Label Injection Accessibility
Performance CLS Dimension Healing Lighthouse
SEO H-Level Normalization Ranking

Core Engine Modules

Layout Shift Repair (CLS)

Cherry identifies images and video elements missing explicit width/height attributes. It calculates their natural aspect ratio and injects CSS contain-intrinsic-size properties to prevent page jumping.

Semantic Upgrading

By traversing the DOM, the engine identifies generic <div> wrappers that function as buttons or navs and upgrades them with the appropriate role and tabindex.

Contrast Correction

Using a lightweight luminance algorithm, Cherry checks foreground/background ratios. If an element fails WCAG 2.1, it subtly shifts the HSL value to ensure readability.

Usage & API

Standard integration is zero-config:

<script src="https://raw.githack.com/Kaiserrrrrr/cherry/main/dist/cherry.js" async></script>