Add CSS/JS on a modul settings page

MODULNAME.libraries.yml


admin:
css:
theme:
css/MODULNAME.admin.css: {}

MODULNAME\Form\MODULNAMESettingsForm


public function buildForm(array $form, FormStateInterface $form_state) {
// code settings form
$form['css'] = [
'#attached' => array(
'library' => array(
'MODULNAME/admin',
),
),
];
return parent::buildForm($form, $form_state);
}
?>

Zwahlendesign: