Skip to content

Commit

Permalink
fix darkmode flicker issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Dec 13, 2024
1 parent 94aaa0d commit ec219d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/showcase/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400|Roboto:500|Roboto:600|Roboto:700'" />
<meta property="og:image" content="https://primefaces.org/static/social/primeng-preview.jpg" />
<script>
(function () {
const APP_CONFIG_KEY = 'appConfigState';
const storedConfig = localStorage.getItem(APP_CONFIG_KEY);

if (storedConfig) {
const parsedConfig = JSON.parse(storedConfig);
if (parsedConfig.darkTheme) {
document.documentElement.classList.add('p-dark');
} else {
document.documentElement.classList.remove('p-dark');
}
}
})();
</script>
</head>

<body>
Expand Down

0 comments on commit ec219d0

Please sign in to comment.