Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Dec 9, 2025

This PR adds a theme selector UI.

The theme is now part of preferences, and can be applied to the user/role/defaults like all other preferences.

CleanShot 2025-12-17 at 17 23 21

You can publish your custom themes to the marketplace and they will be available to browse and select from within the control panel.

CleanShot 2025-12-17 at 17 27 15

Breaking change

(But not really breaking since themes were introduced in an Alpha.)

The config-based way of defining your theme has been removed. If you need to migrate it, you can drop this Artisan command into routes/console.php and run php artisan theme:migrate

Artisan::command('migrate:theme', function () {
    if (! $config = config('statamic.cp.theme')) {
        $this->error('No CP theme configured. Nothing to migrate.');
        return 1;
    }

    if (is_string($config)) {
        $this->error('CP theme is a string. Not migratable.');
        return 1;
    }

    \Statamic\Facades\Preference::default()->set('theme', ['colors' => $config])->save();

    $this->info('Migrated CP theme to default preferences.');
});

jasonvarga and others added 4 commits December 10, 2025 11:45
When you edit custom values, the option to publish becomes available and takes you to statamic.com to publish in your account.

The next time you switch to the themes tab, it'll refresh / bust the cache so you will see your newly added theme.

Added some methods to the Marketplace client that'll handle busting the cache. Realized there's two layers of caching. Just going to work around that for now. Fixing is out of scope of this PR.
@jackmcdade
Copy link
Member

cursor review

@jasonvarga jasonvarga marked this pull request as ready for review December 17, 2025 21:24
@jasonvarga jasonvarga merged commit e4f243d into master Dec 17, 2025
11 checks passed
@jasonvarga jasonvarga deleted the theming branch December 17, 2025 22:49
@robdekort
Copy link
Contributor

Hey Jason. I'm wondering what would be the best way to default a theme in a starter kit? I've also noticed somehow my theme is published but I don't recall doing this. I'm guessing you might've done this during testing? Which is fine of course. If I republish after making changes, does it overwrite the current published version? Happy days for you and yours.

@robdekort
Copy link
Contributor

Never mind Jason, think I figured it out. However I'm wondering if themes will update on the client site when a theme is re-published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants