$old_css_path]), 'warning'); } $form['adminimal_custom'] = [ '#type' => 'fieldset', '#title' => t('Adminimal Customization'), '#weight' => -10, ]; $form['adminimal_custom']['custom_css'] = [ '#type' => 'checkbox', '#title' => t('Use "adminimal-custom.css"'), '#description' => t('Include adminimal-custom.css file to override or add custom css code without subthememing/hacking Adminimal Theme.'), '#default_value' => theme_get_setting('custom_css'), ]; $form['adminimal_custom']['adminimal_custom_check'] = [ '#type' => 'fieldset', '#title' => t('Custom CSS file check'), '#weight' => 50, '#states' => [ // Hide the settings when the cancel notify checkbox is disabled. 'visible' => [ ':input[name="custom_css"]' => ['checked' => TRUE], ], ], ]; if (file_exists($custom_css_path)) { $form['adminimal_custom']['adminimal_custom_check']['custom_css_description'] = [ '#type' => 'container', '#attributes' => [ 'class' => ['messages', 'messages--status'], ], 'message' => [ '#markup' => t('Custom CSS file Found in: @css', ['@css' => $custom_css_dir]), ], ]; } else { $form['adminimal_custom']['adminimal_custom_check']['custom_css_not_found'] = [ '#type' => 'container', '#attributes' => [ 'class' => ['messages', 'messages--error'], ], 'message' => [ '#markup' => t('Custom CSS file not found. You must create the @css file manually.', ['@css' => $custom_css_dir]), ], ]; } }