Optimize CSS processing and modernize vendor prefix handling#7
Merged
SteedMonteiro merged 3 commits intomainfrom Feb 22, 2026
Merged
Conversation
- Remove document.createElement at module init (SSR-safe) - Cache CSS.supports() results to avoid repeated queries - Remove obsolete vendor prefixes for modern browsers - Optimize CSS variable generation: single-pass, minified - Single-pass prop classification in extractUtilityClasses - Fast serialization in hashStyleProps (skip JSON.stringify) - Single-pass prop filtering in Element.tsx - Pre-compute media queries in processStyles - Add sideEffects: false for better tree-shaking Bundle size: CJS 24.12->23.52KB, ESM 23.92->23.31KB, UMD 24.36->23.74KB (~2.5% reduction) https://claude.ai/code/session_01MXi5KgyqXXzTFQ5Di811uz
size-limit report 📦
|
Integrated upstream htmlOnlyAttributes and useMemo removal with our perf optimizations (cssSupportCache, fast hash). https://claude.ai/code/session_01MXi5KgyqXXzTFQ5Di811uz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR optimizes CSS processing performance and modernizes vendor prefix support by removing outdated prefixes for older browsers and streamlining CSS variable normalization logic.
Key Changes
Vendor Prefix Modernization (
src/utils/vendorPrefixes.ts):-moz-prefixes (Firefox 91+ supports unprefixed properties)-ms-prefixes (IE/Edge Legacy no longer supported)-o-prefixes (Opera uses Blink engine)-webkit-prefixes for Safari/WebKit compatibilityCSS Value Normalization (
src/element/css.ts):charCodeAt()for performanceTheme CSS Generation (
src/providers/Theme.tsx):generateCSSVariables()for single-pass processingElement Rendering (
src/element/Element.tsx):styleRelevantPropsSet for efficient prop filteringStyle Utilities (
src/utils/style.ts):Build Configuration (
package.json):"sideEffects": falsefor better tree-shaking supportImplementation Details
https://claude.ai/code/session_01MXi5KgyqXXzTFQ5Di811uz