|
| 1 | +/* ========================================================================== |
| 2 | + Firefox Performance Overrides |
| 3 | + Reduces expensive CSS effects that Firefox renders less efficiently |
| 4 | + than Chromium browsers. Applied via .is-firefox class on <html>. |
| 5 | + ========================================================================== */ |
| 6 | + |
| 7 | +/* ========================================================================== |
| 8 | + Backdrop Filter Reduction |
| 9 | + Firefox supports backdrop-filter but renders it expensively. |
| 10 | + Replace blur effects with solid semi-transparent backgrounds. |
| 11 | + ========================================================================== */ |
| 12 | + |
| 13 | +.is-firefox header, |
| 14 | +.is-firefox footer, |
| 15 | +.is-firefox .footer, |
| 16 | +.is-firefox section, |
| 17 | +.is-firefox form, |
| 18 | +.is-firefox .form-container, |
| 19 | +.is-firefox .matrix-spinner-overlay, |
| 20 | +.is-firefox nav ul, |
| 21 | +.is-firefox nav ul.mobile-open, |
| 22 | +.is-firefox header.scrolled, |
| 23 | +.is-firefox .backdrop-performance { |
| 24 | + backdrop-filter: none !important; |
| 25 | + -webkit-backdrop-filter: none !important; |
| 26 | +} |
| 27 | + |
| 28 | +/* Compensate for lost blur with slightly more opaque backgrounds */ |
| 29 | +.is-firefox header { |
| 30 | + background: rgba(26, 26, 26, 0.98) !important; |
| 31 | +} |
| 32 | + |
| 33 | +.is-firefox footer, |
| 34 | +.is-firefox .footer { |
| 35 | + background: rgba(26, 26, 26, 0.95) !important; |
| 36 | +} |
| 37 | + |
| 38 | +.is-firefox section { |
| 39 | + background-color: var(--matrix-darker) !important; |
| 40 | +} |
| 41 | + |
| 42 | +.is-firefox nav ul { |
| 43 | + background: rgba(0, 20, 0, 0.98) !important; |
| 44 | +} |
| 45 | + |
| 46 | +.is-firefox form, |
| 47 | +.is-firefox .form-container { |
| 48 | + background: rgba(0, 20, 0, 0.85) !important; |
| 49 | +} |
| 50 | + |
| 51 | +/* ========================================================================== |
| 52 | + Will-Change Cleanup |
| 53 | + Firefox doesn't release will-change layers efficiently. |
| 54 | + Remove persistent will-change; let the browser optimize naturally. |
| 55 | + ========================================================================== */ |
| 56 | + |
| 57 | +.is-firefox .mainContent, |
| 58 | +.is-firefox header, |
| 59 | +.is-firefox footer, |
| 60 | +.is-firefox .back-to-top { |
| 61 | + will-change: auto !important; |
| 62 | +} |
| 63 | + |
| 64 | +.is-firefox .will-change-transform, |
| 65 | +.is-firefox .will-change-opacity, |
| 66 | +.is-firefox .will-change-filter, |
| 67 | +.is-firefox .will-change-contents, |
| 68 | +.is-firefox .interactive, |
| 69 | +.is-firefox .gpu-accelerated { |
| 70 | + will-change: auto !important; |
| 71 | +} |
| 72 | + |
| 73 | +/* ========================================================================== |
| 74 | + Filter Animation Reduction |
| 75 | + CSS filter animations (hue-rotate, brightness, blur) are not |
| 76 | + GPU-accelerated in Firefox. Simplify or disable them. |
| 77 | + ========================================================================== */ |
| 78 | + |
| 79 | +.is-firefox .glitch-text:hover { |
| 80 | + animation: none !important; |
| 81 | +} |
| 82 | + |
| 83 | +.is-firefox .matrix-rain-background { |
| 84 | + filter: none !important; |
| 85 | +} |
| 86 | + |
| 87 | +/* ========================================================================== |
| 88 | + Scanline Overlay Optimization |
| 89 | + The full-screen repeating-gradient scanline is expensive in Firefox. |
| 90 | + Reduce opacity to minimize compositing cost. |
| 91 | + ========================================================================== */ |
| 92 | + |
| 93 | +.is-firefox [data-theme="matrix"] body::after { |
| 94 | + opacity: 0.2; |
| 95 | +} |
| 96 | + |
| 97 | +/* ========================================================================== |
| 98 | + Text Shadow / Glow Reduction |
| 99 | + Firefox renders multi-layer text-shadow less efficiently. |
| 100 | + Simplify to single-layer glows. |
| 101 | + ========================================================================== */ |
| 102 | + |
| 103 | +.is-firefox [data-theme="matrix"] h1, |
| 104 | +.is-firefox [data-theme="matrix"] h2, |
| 105 | +.is-firefox [data-theme="matrix"] .section-title, |
| 106 | +.is-firefox [data-theme="matrix"] .page-heading { |
| 107 | + text-shadow: 0 0 10px var(--glow-color-primary) !important; |
| 108 | +} |
| 109 | + |
| 110 | +/* ========================================================================== |
| 111 | + Transition Simplification |
| 112 | + Reduce the global wildcard transition on theme changes. |
| 113 | + ========================================================================== */ |
| 114 | + |
| 115 | +.is-firefox * { |
| 116 | + transition-property: none !important; |
| 117 | +} |
| 118 | + |
| 119 | +.is-firefox a, |
| 120 | +.is-firefox button, |
| 121 | +.is-firefox input, |
| 122 | +.is-firefox textarea, |
| 123 | +.is-firefox header, |
| 124 | +.is-firefox [class*="card"], |
| 125 | +.is-firefox [class*="btn"], |
| 126 | +.is-firefox .menu-toggle, |
| 127 | +.is-firefox nav ul { |
| 128 | + transition-property: color, background-color, border-color, opacity, transform, box-shadow !important; |
| 129 | + transition-duration: 0.2s !important; |
| 130 | +} |
0 commit comments