Have configuration form use a different theme than the currently set Admin theme I built a custom configuration form with the following settings

The contents of my aaep_settings_main.routing.yml

my_settings:
  path: '/admin/config/system/my_settings'
  defaults:
    _form: 'Drupal\my_settings\Form\SettingsForm'
  requirements:
    _permission: 'administer site configuration'


And then inside my SettingsForm.php I have

class SettingsForm extends ConfigFormBase {

protected function getEditableConfigNames() {
    return array(
        'my_settings.settings',
    );
}

public function submitForm(array&amp;$form, FormStateInterface $form_state) {

    $this-&gt;config('my_settings.settings')
         -&gt;set('test', $form_state-&gt;getValue('test'))
         -&gt;save();
}

public function buildForm(array $form, FormStateInterface $form_state){
    $config = $this-&gt;config('my_settings.settings');
    $form['test'] = [
         '#type' =&gt; 'textfield',
         '#title' =&gt; t('Test'),
         '#default_value' =&gt; $config-&gt;get('test'),
    ];
}


It works just fine, but when I visit the page it's using the admin theme instead of the regular theme. I'm assuming that's because it's using a configuration form and extending ConfigFormBase. I'm assuming that that's the default behavior. But is there a way to override that and have my configuration page use my site theme instead?
You can control this in the route definition.

If you give non admin users access to the form they will see it in a regular theme:

my_settings:
  path: '/admin/config/system/my_settings'
  defaults:
    _form: 'Drupal\my_settings\Form\SettingsForm'
  requirements:
    _permission: 'access content'


If you want to have admins see the form in a regular theme then move the path outside of /admin:

my_settings:
  path: '/other-path/my_settings'
  defaults:
    _form: 'Drupal\my_settings\Form\SettingsForm'
  requirements:
    _permission: 'administer site configuration'


Or do both at the same time.

Details:

If you give a non admin user permission for an admin route, then the form will be displayed in the regular theme, because the admin theme is only accessible for admin users or users who have the "administration theme" permission.

Whether a route is considered as admin route is controlled by the route option _admin_route. If this option is not set, it is added by AdminRouteSubscriber::alterRoutes to all routes with an admin path:

  protected function alterRoutes(RouteCollection $collection) {
    foreach ($collection-&gt;all() as $route) {
      if (strpos($route-&gt;getPath(), '/admin') === 0 &amp;&amp; !$route-&gt;hasOption('_admin_route')) {
        $route-&gt;setOption('_admin_route', TRUE);
      }
    }
  }


If you want to override this you can set the option to false:

  options:
    _admin_route: FALSE