/* * Copyright 2026 Alessandro Chiapparini * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * See the LICENSE file in the project root for the full license text. */ /* Phase 16: sync theme apply before stylesheet load — avoids FOUC. Loaded without defer/async from . Reads sp:theme; dark → add class. Wrapped in try/catch so private-window localStorage denials no-op. */ try { if (localStorage.getItem('sp:theme') === 'dark') { document.documentElement.classList.add('dark'); } } catch (e) { /* localStorage denied — stay light. */ }