From d82f13a1bc829af8c886c50d3d4e8e8354dc003f Mon Sep 17 00:00:00 2001 From: rdrew Date: Wed, 12 Nov 2025 15:22:50 -0400 Subject: [PATCH] removed hex code form --- mobile_facets.module | 28 ------------------------- mobile_facets.routing.yml | 7 ------- src/Form/SettingsForm.php | 43 --------------------------------------- 3 files changed, 78 deletions(-) delete mode 100644 mobile_facets.routing.yml delete mode 100644 src/Form/SettingsForm.php diff --git a/mobile_facets.module b/mobile_facets.module index d0b1e8a..555b638 100755 --- a/mobile_facets.module +++ b/mobile_facets.module @@ -9,31 +9,3 @@ function mobile_facets_page_attachments(array &$attachments) { $attachments['#attached']['library'][] = 'mobile_facets/mobile_facets'; } -/** - * @file - * Contains mobile_facets.module. - */ - -/** - * Implements hook_preprocess_html(). - */ -function mobile_facets_preprocess_html(&$variables) { - $config = \Drupal::config('mobile_facets.settings'); - $color = $config->get('color') ?? '#000000'; - - // Preload the CSS from the module path (theme-agnostic). - $css_path = \Drupal::service('extension.list.module')->getPath('mobile_facets') . '/css/mobile_facets.css'; - $variables['#attached']['html_head_link'][] = [ - [ - 'rel' => 'preload', - 'as' => 'style', - 'href' => $css_path, - ], - ]; - - // Add the CSS variable to attributes (global across all themes). - $variables['html_attributes']['style'] = '--mobile_facets-color: ' . $color . ';'; - - // Optionally attach the library if not already (loads CSS from module). - //$variables['#attached']['library'][] = 'mobile_facets/mobile_facets'; -} diff --git a/mobile_facets.routing.yml b/mobile_facets.routing.yml deleted file mode 100644 index dae9265..0000000 --- a/mobile_facets.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -mobile_facets.settings: - path: '/admin/config/mobile_facets/settings' - defaults: - _form: '\Drupal\mobile_facets\Form\SettingsForm' - _title: 'Mobile Facets Settings' - requirements: - _permission: 'administer site configuration' diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php deleted file mode 100644 index dbe2cda..0000000 --- a/src/Form/SettingsForm.php +++ /dev/null @@ -1,43 +0,0 @@ -config('mobile_facets.settings'); - - $form['color'] = [ - '#type' => 'color', - '#title' => $this->t('Custom Color'), - '#default_value' => $config->get('color') ?? '#000000', // Default to black if not set. - '#description' => $this->t('Enter a hex color code for your module (e.g., #FF0000 for red).'), - ]; - - return parent::buildForm($form, $form_state); - } - -}