# fluent-cart/1.5.3/app/Services/Theme/AdminTheme.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.5.3. 39 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Services/Theme/AdminTheme.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.5.3/raw/app/Services/Theme/AdminTheme.php
- Modified: 2026-05-14T15:41:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Services/Theme/AdminTheme.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Services\Theme;

use FluentCart\App\App;

class AdminTheme
{
    const DARK_CLASS = 'fluent_theme_dark';

    public static function applyTheme()
    {
        if ('fluent-cart' === App::request()->get('page')) {
            add_action('admin_head', function () {
                ?>
                <script>
                    (function() {
                        let theme = localStorage.getItem('fluent_theme_mode');

                        if (!theme) {
                            theme = localStorage.getItem('fcart_admin_theme');

                            if (theme) {
                                localStorage.setItem('fluent_theme_mode', theme);
                                localStorage.removeItem('fcart_admin_theme');
                            }
                        }
        
                        if (theme && theme.split(':').pop() === 'dark') {
                            document.documentElement.classList.add('<?php echo esc_js(self::DARK_CLASS); ?>');
                        }
                    })();
                </script>
                <?php
            });
        }
    }
}

```
