diff --git a/hovercss.install b/hovercss.install
index de83282..4bc1172 100644
--- a/hovercss.install
+++ b/hovercss.install
@@ -1,5 +1,8 @@
 <?php
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
+
 /**
  * @file
  * Install, update, uninstall Requirements functions for the HoverCSS module.
@@ -18,7 +21,7 @@ function hovercss_requirements($phase) {
   $requirements = [];
 
   // Check Hover.css library is exists.
-  /** @var Drupal\Core\Asset\LibraryDiscovery $library_discovery */
+  /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
   $library_discovery = \Drupal::service('library.discovery');
   $library_get_hover = $library_discovery->getLibraryByName('hovercss', 'hover.css');
   $library_exist_css = FALSE;
@@ -49,7 +52,7 @@ function hovercss_requirements($phase) {
   $requirements['hovercss'] = [
     'title'       => t('Hover.css library'),
     'value'       => $library_exist_css ? t('Installed') : t('Not installed'),
-    'severity'    => $library_exist_css ? REQUIREMENT_OK : REQUIREMENT_ERROR,
+    'severity'    => $library_exist_css ? DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK) : DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR),
     'description' => $description,
   ];
 
diff --git a/hovercss.module b/hovercss.module
index 33a476b..98cd5aa 100644
--- a/hovercss.module
+++ b/hovercss.module
@@ -17,34 +17,17 @@
  *
  * Copyright (C) 2013-2023 Ian Lunn
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\hovercss\Hook\HovercssHooks;
 use Drupal\Core\Installer\InstallerKernel;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function hovercss_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.hovercss':
-      $output  = '<h3 class="animate__animated animate__bounce">' . t('About') . '</h3>';
-      $output .= '<p class="animate__animated animate__fadeInUp animate__delay-1s">' . t('The HoverCSS is a module that aims to integrate <a href=":hover_library">Hover.css</a> library with Drupal. Hover.css is a collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.', [':hover_library' => 'https://ianlunn.github.io/Hover/']) . '</p>';
-      $output .= '<h3 class="animate__animated animate__zoomIn animate__delay-2s">' . t('Uses') . '</h3>';
-      $output .= '<dl>';
-      $output .= '<dt class="animate__animated animate__flipInX animate__delay-3s">' . t('Basic usage') . '</dt>';
-      $output .= '<dd class="animate__animated animate__slideInLeft animate__delay-4s"><p>' . t('Add the hover effect class to an element, along with any of the effects names (do not forget the hvr- prefix!)') . '</p>';
-      $output .= '<pre><code>';
-      $output .= '&lt;a class="button hvr-grow"&gt;Add to Basket&lt;/a&gt;' . "\n";
-      $output .= '</code></pre></dd>';
-      $output .= '<dt class="animate__animated animate__flipInX animate__delay-3s">' . t('Usage with Javascript') . '</dt>';
-      $output .= '<dd class="animate__animated animate__slideInRight animate__delay-4s"><p>' . t('You can do a whole bunch of other stuff with hover.css when you combine it with Javascript.') . '</p>';
-      $output .= '<pre>';
-      $output .= "const element = document.querySelector('.my-element');" . "\n";
-      $output .= "element.classList.add('hvr-grow');";
-      $output .= '</pre></dd>';
-      $output .= '</dl>';
-      return $output;
-  }
+  return \Drupal::service(HovercssHooks::class)->help($route_name, $route_match);
 }
 
 /**
@@ -55,7 +38,7 @@ function hovercss_help($route_name, RouteMatchInterface $route_match) {
  */
 function hovercss_check_installed() {
   // Throw error if hovercss.css library file not found.
-  /** @var Drupal\Core\Asset\LibraryDiscovery $library_discovery */
+  /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
   $library_discovery = \Drupal::service('library.discovery');
   $library_exists = FALSE;
   $definition = $library_discovery->getLibraryByName('hovercss', 'hover.css');
@@ -71,22 +54,10 @@ function hovercss_check_installed() {
 /**
  * Implements hook_page_attachments().
  */
-function hovercss_page_attachments(array &$attachments) {
-  // Don't add the Library during installation.
-  if (InstallerKernel::installationAttempted()) {
-    return;
-  }
-
-  // Check first HoverCSS UI module in not installed and library not exists.
-  $moduleHandler = \Drupal::service('module_handler');
-  if (!$moduleHandler->moduleExists('hovercss_ui')) {
-    if (hovercss_check_installed()) {
-      $attachments['#attached']['library'][] = 'hovercss/hover.css';
-    }
-    else {
-      $attachments['#attached']['library'][] = 'hovercss/hover.cdn';
-    }
-  }
+#[LegacyHook]
+function hovercss_page_attachments(array &$attachments)
+{
+    \Drupal::service(HovercssHooks::class)->pageAttachments($attachments);
 }
 
 /**
diff --git a/hovercss.services.yml b/hovercss.services.yml
new file mode 100644
index 0000000..5516beb
--- /dev/null
+++ b/hovercss.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\hovercss\Hook\HovercssHooks:
+    class: Drupal\hovercss\Hook\HovercssHooks
+    autowire: true
diff --git a/hovercss_ui/hovercss_ui.install b/hovercss_ui/hovercss_ui.install
index 04da959..b2dd980 100644
--- a/hovercss_ui/hovercss_ui.install
+++ b/hovercss_ui/hovercss_ui.install
@@ -4,7 +4,7 @@
  * @file
  * Install, update and uninstall functions for the HoverCSS module.
  */
-
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Url;
 
 /**
@@ -105,5 +105,5 @@ function hovercss_ui_update_8000() {
   $config = $config_factory->getEditable('hovercss.settings');
   // Add new hide configuration field.
   $config->set('hide', FALSE);
-  $config->save(TRUE);
+  DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => $config->save(), fn() => $config->save(TRUE));
 }
diff --git a/hovercss_ui/hovercss_ui.module b/hovercss_ui/hovercss_ui.module
index a72f830..5181479 100644
--- a/hovercss_ui/hovercss_ui.module
+++ b/hovercss_ui/hovercss_ui.module
@@ -17,7 +17,8 @@
  *
  * Copyright (C) 2013-2023 Ian Lunn
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\hovercss_ui\Hook\HovercssUiHooks;
 use Drupal\Core\Asset\AttachedAssetsInterface;
 use Drupal\Core\Installer\InstallerKernel;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -28,227 +29,27 @@ use Symfony\Component\HttpFoundation\RequestStack;
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function hovercss_ui_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.hovercss_ui':
-      $output  = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('HoverCSS UI is a innovative and powerful Drupal module that provides hover effect dynamically, enhancing site interactivity with awesome animations.') . '</p>';
-      $output .= '<h3>' . t('Usage') . '</h3>';
-      $output .= '<dl>';
-      $output .= '<dt><strong>' . t('Hover admin page') . '</strong></dt>';
-      $output .= '<dd><p>' . t('Go to <a href=":hovercss_admin">Hover CSS</a> admin overview page in your Drupal administration configuration menu.', [':hovercss_admin' => Url::fromRoute('hovercss.admin')->setAbsolute()->toString()]) . '</p></dd>';
-      $output .= '<dd><p>' . t('Click on <a href=":add_effect">Add effect</a> button in top of the hover css admin overview page.', [':add_effect' => Url::fromRoute('hovercss.add')->setAbsolute()->toString()]) . '</p></dd>';
-      $output .= '<dd><p>' . t('Enter valid selector, you can use HTML tag, class with dot(.) and ID with hash(#) prefix.') . '</p></dd>';
-      $output .= '<dd><p>' . t('Then you can add hover effect.') . '</p></dd>';
-      $output .= '<dd><p>' . t('Save effect and that`s it, Enjoy animation with Hover!') . '</p></dd>';
-      $output .= '<br>';
-      $output .= '<dt><strong>' . t('HoverCSS global configuration page') . '</strong></dt>';
-      $output .= '<dd><p>' . t('Go to <a href=":hovercss_settings">Hover CSS settings</a> page in your Drupal configuration menu.', [':hovercss_settings' => Url::fromRoute('hovercss.settings')->setAbsolute()->toString()]) . '</p></dd>';
-      $output .= '<dd><p>' . t('You can change default setting options if you need such as:') . '</p></dd>';
-      $output .= '<div><ul>';
-      $output .= '<li><strong>' . t('Load Hover.css library') . '</strong><br><em>' . t('If enabled, this module will attempt to load the Hover.css library for your site.') . '</em></li>';
-      $output .= '<li><strong>' . t('Use Hover.css patch') . '</strong><br><em>' . t('If enabled, this module will use the patch for your hover to resolve Drupal button css conflicts.') . '</em></li>';
-      $output .= '<li><strong>' . t('Load on Specific URLs') . '</strong><br><em>' . t('If you use the hover library only for a special section or pages, you can control to load the Hover.css library to that page to improve performance.') . '</em></li>';
-      $output .= '<li><strong>' . t('Default Options') . '</strong><br><em>' . t('You can change the default settings of Hover options so that you don`t need to customize every time in the "Add effect" form.') . '</em></li>';
-      $output .= '<li><strong>' . t('Hover Preview') . '</strong><br><em>' . t('You can test your desired effect animation with its settings and see the result on different button types.') . '</em></li>';
-      $output .= '</ul></div>';
-      $output .= '</dl>';
-      $output .= '<br>';
-      $output .= '<h3>' . t('Additional Information') . '</h3>';
-      $output .= '<p>' . t('Pick existing valid selector you want to add hover effect by using right-click on your website, choose "Inspect" or "View page source (CTRL + U)" of context menu in your Chrome browser and find exact valid button class name.') . '</p>';
-      $output .= '<div><ul>';
-      $output .= '<li><strong>' . t('Use class with dot(.) and ID with hash(#) prefix or HTML tags.');
-      $output .= '</strong><br>e.g. "button", ".button", "#edit-submit" etc.</li>';
-      $output .= '<li><strong>' . t('Nested selector is allowed.');
-      $output .= '</strong><br>e.g. ".user-login-form .button", "body.page-node-type-article a.btn" etc.</li>';
-      $output .= '</ul></div>';
-      return $output;
-  }
+  return \Drupal::service(HovercssUiHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_css_alter().
  */
-function hovercss_ui_css_alter(&$css, AttachedAssetsInterface $assets) {
-  // Load the Hover.css configuration settings.
-  $config = \Drupal::config('hovercss.settings');
-  $hover_library = [];
-
-  if (_hovercss_ui_check_admin()) {
-    if (hovercss_check_installed()) {
-      $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-dev');
-    }
-    else {
-      $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn-dev');
-    }
-
-    $path = $hover_library['css'][0]['data'] ?? '';
-
-    if (isset($css[$path])) {
-      $css[$path]['group'] = 369;
-
-      // Check hover.patch.css.
-      if ($config->get('patch')) {
-        $hover_patch = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-patch');
-        $patch_path = $hover_patch['css'][0]['data'] ?? '';
-        if (isset($css[$patch_path])) {
-          $css[$patch_path]['group'] = 396;
-        }
-      }
-    }
-  }
-
-  // Don't include Hover.css library if the user has opted out of loading it.
-  if (!$config->get('load')) {
-    return TRUE;
-  }
-
-  // Don't add the Hover.css on specified paths.
-  if (!_hovercss_ui_check_url()) {
-    return TRUE;
-  }
-
-  // Check Hover.css with chosen method.
-  $method = hovercss_check_installed() ? $config->get('method') : 'cdn';
-
-  // Check for development and production version.
-  $variant_options = ['source', 'minified'];
-  $variant = $variant_options[$config->get('minimized.options')];
-
-  if ($method == 'cdn') {
-    // Check variant Hover.css is CDN.
-    switch ($variant) {
-      case 'minified':
-        $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn');
-        break;
-
-      case 'source':
-        $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn-dev');
-        break;
-    }
-  }
-  else {
-    // Check variant Hover.css is local.
-    switch ($variant) {
-      case 'minified':
-        $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-css');
-        break;
-
-      case 'source':
-        $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-dev');
-        break;
-    }
-  }
-
-  $path = $hover_library['css'][0]['data'] ?? '';
-
-  if (isset($css[$path])) {
-    $css[$path]['group'] = 369;
-
-    // Check hover.patch.css.
-    if ($config->get('patch')) {
-      $hover_patch = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-patch');
-      $patch_path = $hover_patch['css'][0]['data'] ?? '';
-      if (isset($css[$patch_path])) {
-        $css[$patch_path]['group'] = 396;
-      }
-    }
-  }
+#[LegacyHook]
+function hovercss_ui_css_alter(&$css, AttachedAssetsInterface $assets)
+{
+    return \Drupal::service(HovercssUiHooks::class)->cssAlter($css, $assets);
 }
 
 /**
  * Implements hook_page_attachments().
  */
-function hovercss_ui_page_attachments(array &$attachments) {
-  // Don't add the library during installation.
-  if (InstallerKernel::installationAttempted()) {
-    return;
-  }
-
-  // Load the Hover.css configuration settings.
-  $config = \Drupal::config('hovercss.settings');
-
-  // Checking the path to load Hover.css for demo examples,
-  // It's just in HoverCSS configuration.
-  if (_hovercss_ui_check_admin()) {
-    $options = $config->get('options');
-    $options['selector'] = '.hover__sample';
-
-    // Attach Hover.css for examples.
-    $attachments['#attached']['drupalSettings']['hovercss']['sample'] = $options;
-    if (hovercss_check_installed()) {
-      $attachments['#attached']['library'][] = 'hovercss_ui/hover-dev';
-    }
-    else {
-      $attachments['#attached']['library'][] = 'hovercss_ui/hover-cdn-dev';
-    }
-
-    // Attach hover.patch.css for examples.
-    if ($config->get('patch')) {
-      $attachments['#attached']['library'][] = 'hovercss_ui/hover-patch';
-    }
-
-    $attachments['#attached']['library'][] = 'hovercss_ui/hover-admin';
-
-    return;
-  }
-
-  // Don't include Hover.css library if the user has opted out of loading it.
-  if (!$config->get('load')) {
-    return TRUE;
-  }
-
-  // Don't add the Hover.css on specified paths.
-  if (!_hovercss_ui_check_url()) {
-    return TRUE;
-  }
-
-  // Check if config is an object.
-  if (is_object($config)) {
-    // Attach Hover.css by config.
-    _hovercss_ui_attach_library($attachments, $config);
-  }
-
-  // Get selectors from config.
-  $options = $config->get('options');
-  $hovered = [];
-
-  // Load enabled hover selectors from database.
-  $results = \Drupal::service('hovercss.effect_manager')->loadHover()->fetchAll();
-  if (count($results)) {
-    $selectors = [];
-    foreach ($results as $hover) {
-      $selectors[] = $hover->selector;
-      $hover_options = unserialize($hover->options, ['allowed_classes' => FALSE]);
-      $hovered[$hover->hid] = ['selector' => $hover->selector] + $hover_options;
-    }
-
-    // Merge global selectors from config with database selectors.
-    if (count($config->get('options.selector')) && count($selectors)) {
-      $options['selector'] = array_diff($options['selector'], $selectors);
-
-      // Attach config selectors after merge if there were any left.
-      if (count($options['selector'])) {
-        array_unshift($hovered, $options);
-      }
-    }
-  }
-  else {
-    // If global selectors are set, get the selectors from the configuration.
-    if (count($config->get('options.selector'))) {
-      $hovered = [$options];
-    }
-  }
-
-  // If there is hover selectors, then the init file
-  // with options will be added to the page.
-  if (count($hovered)) {
-    // Export settings.
-    $attachments['#attached']['drupalSettings']['hovercss']['elements'] = $hovered;
-
-    // Init hover.
-    $attachments['#attached']['library'][] = 'hovercss_ui/hover-init';
-  }
+#[LegacyHook]
+function hovercss_ui_page_attachments(array &$attachments)
+{
+    return \Drupal::service(HovercssUiHooks::class)->pageAttachments($attachments);
 }
 
 /**
diff --git a/hovercss_ui/hovercss_ui.services.yml b/hovercss_ui/hovercss_ui.services.yml
index 841f515..f841d9c 100644
--- a/hovercss_ui/hovercss_ui.services.yml
+++ b/hovercss_ui/hovercss_ui.services.yml
@@ -4,3 +4,7 @@ services:
     arguments: [ '@database' ]
     tags:
       - { name: backend_overridable }
+
+  Drupal\hovercss_ui\Hook\HovercssUiHooks:
+    class: Drupal\hovercss_ui\Hook\HovercssUiHooks
+    autowire: true
diff --git a/hovercss_ui/src/Hook/HovercssUiHooks.php b/hovercss_ui/src/Hook/HovercssUiHooks.php
new file mode 100644
index 0000000..ece7af4
--- /dev/null
+++ b/hovercss_ui/src/Hook/HovercssUiHooks.php
@@ -0,0 +1,230 @@
+<?php
+
+namespace Drupal\hovercss_ui\Hook;
+
+use Drupal\Core\Asset\AttachedAssetsInterface;
+use Drupal\Core\Installer\InstallerKernel;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for hovercss_ui.
+ */
+class HovercssUiHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        switch ($route_name) {
+            case 'help.page.hovercss_ui':
+                $output = '<h3>' . $this->t('About') . '</h3>';
+                $output .= '<p>' . $this->t('HoverCSS UI is a innovative and powerful Drupal module that provides hover effect dynamically, enhancing site interactivity with awesome animations.') . '</p>';
+                $output .= '<h3>' . $this->t('Usage') . '</h3>';
+                $output .= '<dl>';
+                $output .= '<dt><strong>' . $this->t('Hover admin page') . '</strong></dt>';
+                $output .= '<dd><p>' . $this->t('Go to <a href=":hovercss_admin">Hover CSS</a> admin overview page in your Drupal administration configuration menu.', [
+                    ':hovercss_admin' => \Drupal\Core\Url::fromRoute('hovercss.admin')->setAbsolute()->toString(),
+                ]) . '</p></dd>';
+                $output .= '<dd><p>' . $this->t('Click on <a href=":add_effect">Add effect</a> button in top of the hover css admin overview page.', [
+                    ':add_effect' => \Drupal\Core\Url::fromRoute('hovercss.add')->setAbsolute()->toString(),
+                ]) . '</p></dd>';
+                $output .= '<dd><p>' . $this->t('Enter valid selector, you can use HTML tag, class with dot(.) and ID with hash(#) prefix.') . '</p></dd>';
+                $output .= '<dd><p>' . $this->t('Then you can add hover effect.') . '</p></dd>';
+                $output .= '<dd><p>' . $this->t('Save effect and that`s it, Enjoy animation with Hover!') . '</p></dd>';
+                $output .= '<br>';
+                $output .= '<dt><strong>' . $this->t('HoverCSS global configuration page') . '</strong></dt>';
+                $output .= '<dd><p>' . $this->t('Go to <a href=":hovercss_settings">Hover CSS settings</a> page in your Drupal configuration menu.', [
+                    ':hovercss_settings' => \Drupal\Core\Url::fromRoute('hovercss.settings')->setAbsolute()->toString(),
+                ]) . '</p></dd>';
+                $output .= '<dd><p>' . $this->t('You can change default setting options if you need such as:') . '</p></dd>';
+                $output .= '<div><ul>';
+                $output .= '<li><strong>' . $this->t('Load Hover.css library') . '</strong><br><em>' . $this->t('If enabled, this module will attempt to load the Hover.css library for your site.') . '</em></li>';
+                $output .= '<li><strong>' . $this->t('Use Hover.css patch') . '</strong><br><em>' . $this->t('If enabled, this module will use the patch for your hover to resolve Drupal button css conflicts.') . '</em></li>';
+                $output .= '<li><strong>' . $this->t('Load on Specific URLs') . '</strong><br><em>' . $this->t('If you use the hover library only for a special section or pages, you can control to load the Hover.css library to that page to improve performance.') . '</em></li>';
+                $output .= '<li><strong>' . $this->t('Default Options') . '</strong><br><em>' . $this->t('You can change the default settings of Hover options so that you don`t need to customize every time in the "Add effect" form.') . '</em></li>';
+                $output .= '<li><strong>' . $this->t('Hover Preview') . '</strong><br><em>' . $this->t('You can test your desired effect animation with its settings and see the result on different button types.') . '</em></li>';
+                $output .= '</ul></div>';
+                $output .= '</dl>';
+                $output .= '<br>';
+                $output .= '<h3>' . $this->t('Additional Information') . '</h3>';
+                $output .= '<p>' . $this->t('Pick existing valid selector you want to add hover effect by using right-click on your website, choose "Inspect" or "View page source (CTRL + U)" of context menu in your Chrome browser and find exact valid button class name.') . '</p>';
+                $output .= '<div><ul>';
+                $output .= '<li><strong>' . $this->t('Use class with dot(.) and ID with hash(#) prefix or HTML tags.');
+                $output .= '</strong><br>e.g. "button", ".button", "#edit-submit" etc.</li>';
+                $output .= '<li><strong>' . $this->t('Nested selector is allowed.');
+                $output .= '</strong><br>e.g. ".user-login-form .button", "body.page-node-type-article a.btn" etc.</li>';
+                $output .= '</ul></div>';
+                return $output;
+        }
+    }
+    /**
+     * Implements hook_css_alter().
+     */
+    #[Hook('css_alter')]
+    public static function cssAlter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface $assets)
+    {
+        // Load the Hover.css configuration settings.
+        $config = \Drupal::config('hovercss.settings');
+        $hover_library = [
+        ];
+        if (_hovercss_ui_check_admin()) {
+            if (hovercss_check_installed()) {
+                $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-dev');
+            } else {
+                $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn-dev');
+            }
+            $path = $hover_library['css'][0]['data'] ?? '';
+            if (isset($css[$path])) {
+                $css[$path]['group'] = 369;
+                // Check hover.patch.css.
+                if ($config->get('patch')) {
+                    $hover_patch = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-patch');
+                    $patch_path = $hover_patch['css'][0]['data'] ?? '';
+                    if (isset($css[$patch_path])) {
+                        $css[$patch_path]['group'] = 396;
+                    }
+                }
+            }
+        }
+        // Don't include Hover.css library if the user has opted out of loading it.
+        if (!$config->get('load')) {
+            return TRUE;
+        }
+        // Don't add the Hover.css on specified paths.
+        if (!_hovercss_ui_check_url()) {
+            return TRUE;
+        }
+        // Check Hover.css with chosen method.
+        $method = hovercss_check_installed() ? $config->get('method') : 'cdn';
+        // Check for development and production version.
+        $variant_options = [
+            'source',
+            'minified',
+        ];
+        $variant = $variant_options[$config->get('minimized.options')];
+        if ($method == 'cdn') {
+            // Check variant Hover.css is CDN.
+            switch ($variant) {
+                case 'minified':
+                    $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn');
+                    break;
+                case 'source':
+                    $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-cdn-dev');
+                    break;
+            }
+        } else {
+            // Check variant Hover.css is local.
+            switch ($variant) {
+                case 'minified':
+                    $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-css');
+                    break;
+                case 'source':
+                    $hover_library = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-dev');
+                    break;
+            }
+        }
+        $path = $hover_library['css'][0]['data'] ?? '';
+        if (isset($css[$path])) {
+            $css[$path]['group'] = 369;
+            // Check hover.patch.css.
+            if ($config->get('patch')) {
+                $hover_patch = \Drupal::service('library.discovery')->getLibraryByName('hovercss_ui', 'hover-patch');
+                $patch_path = $hover_patch['css'][0]['data'] ?? '';
+                if (isset($css[$patch_path])) {
+                    $css[$patch_path]['group'] = 396;
+                }
+            }
+        }
+    }
+    /**
+     * Implements hook_page_attachments().
+     */
+    #[Hook('page_attachments')]
+    public static function pageAttachments(array &$attachments)
+    {
+        // Don't add the library during installation.
+        if (\Drupal\Core\Installer\InstallerKernel::installationAttempted()) {
+            return;
+        }
+        // Load the Hover.css configuration settings.
+        $config = \Drupal::config('hovercss.settings');
+        // Checking the path to load Hover.css for demo examples,
+        // It's just in HoverCSS configuration.
+        if (_hovercss_ui_check_admin()) {
+            $options = $config->get('options');
+            $options['selector'] = '.hover__sample';
+            // Attach Hover.css for examples.
+            $attachments['#attached']['drupalSettings']['hovercss']['sample'] = $options;
+            if (hovercss_check_installed()) {
+                $attachments['#attached']['library'][] = 'hovercss_ui/hover-dev';
+            } else {
+                $attachments['#attached']['library'][] = 'hovercss_ui/hover-cdn-dev';
+            }
+            // Attach hover.patch.css for examples.
+            if ($config->get('patch')) {
+                $attachments['#attached']['library'][] = 'hovercss_ui/hover-patch';
+            }
+            $attachments['#attached']['library'][] = 'hovercss_ui/hover-admin';
+            return;
+        }
+        // Don't include Hover.css library if the user has opted out of loading it.
+        if (!$config->get('load')) {
+            return TRUE;
+        }
+        // Don't add the Hover.css on specified paths.
+        if (!_hovercss_ui_check_url()) {
+            return TRUE;
+        }
+        // Check if config is an object.
+        if (is_object($config)) {
+            // Attach Hover.css by config.
+            _hovercss_ui_attach_library($attachments, $config);
+        }
+        // Get selectors from config.
+        $options = $config->get('options');
+        $hovered = [
+        ];
+        // Load enabled hover selectors from database.
+        $results = \Drupal::service('hovercss.effect_manager')->loadHover()->fetchAll();
+        if (count($results)) {
+            $selectors = [
+            ];
+            foreach ($results as $hover) {
+                $selectors[] = $hover->selector;
+                $hover_options = unserialize($hover->options, [
+                    'allowed_classes' => FALSE,
+                ]);
+                $hovered[$hover->hid] = [
+                    'selector' => $hover->selector,
+                ] + $hover_options;
+            }
+            // Merge global selectors from config with database selectors.
+            if (count($config->get('options.selector')) && count($selectors)) {
+                $options['selector'] = array_diff($options['selector'], $selectors);
+                // Attach config selectors after merge if there were any left.
+                if (count($options['selector'])) {
+                    array_unshift($hovered, $options);
+                }
+            }
+        } else if (count($config->get('options.selector'))) {
+            $hovered = [
+                $options,
+            ];
+        }
+        // If there is hover selectors, then the init file
+        // with options will be added to the page.
+        if (count($hovered)) {
+            // Export settings.
+            $attachments['#attached']['drupalSettings']['hovercss']['elements'] = $hovered;
+            // Init hover.
+            $attachments['#attached']['library'][] = 'hovercss_ui/hover-init';
+        }
+    }
+}
diff --git a/src/Hook/HovercssHooks.php b/src/Hook/HovercssHooks.php
new file mode 100644
index 0000000..a21034f
--- /dev/null
+++ b/src/Hook/HovercssHooks.php
@@ -0,0 +1,64 @@
+<?php
+
+namespace Drupal\hovercss\Hook;
+
+use Drupal\Core\Installer\InstallerKernel;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for hovercss.
+ */
+class HovercssHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        switch ($route_name) {
+            case 'help.page.hovercss':
+                $output = '<h3 class="animate__animated animate__bounce">' . $this->t('About') . '</h3>';
+                $output .= '<p class="animate__animated animate__fadeInUp animate__delay-1s">' . $this->t('The HoverCSS is a module that aims to integrate <a href=":hover_library">Hover.css</a> library with Drupal. Hover.css is a collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.', [
+                    ':hover_library' => 'https://ianlunn.github.io/Hover/',
+                ]) . '</p>';
+                $output .= '<h3 class="animate__animated animate__zoomIn animate__delay-2s">' . $this->t('Uses') . '</h3>';
+                $output .= '<dl>';
+                $output .= '<dt class="animate__animated animate__flipInX animate__delay-3s">' . $this->t('Basic usage') . '</dt>';
+                $output .= '<dd class="animate__animated animate__slideInLeft animate__delay-4s"><p>' . $this->t('Add the hover effect class to an element, along with any of the effects names (do not forget the hvr- prefix!)') . '</p>';
+                $output .= '<pre><code>';
+                $output .= '&lt;a class="button hvr-grow"&gt;Add to Basket&lt;/a&gt;' . "\n";
+                $output .= '</code></pre></dd>';
+                $output .= '<dt class="animate__animated animate__flipInX animate__delay-3s">' . $this->t('Usage with Javascript') . '</dt>';
+                $output .= '<dd class="animate__animated animate__slideInRight animate__delay-4s"><p>' . $this->t('You can do a whole bunch of other stuff with hover.css when you combine it with Javascript.') . '</p>';
+                $output .= '<pre>';
+                $output .= "const element = document.querySelector('.my-element');" . "\n";
+                $output .= "element.classList.add('hvr-grow');";
+                $output .= '</pre></dd>';
+                $output .= '</dl>';
+                return $output;
+        }
+    }
+    /**
+     * Implements hook_page_attachments().
+     */
+    #[Hook('page_attachments')]
+    public static function pageAttachments(array &$attachments)
+    {
+        // Don't add the Library during installation.
+        if (\Drupal\Core\Installer\InstallerKernel::installationAttempted()) {
+            return;
+        }
+        // Check first HoverCSS UI module in not installed and library not exists.
+        $moduleHandler = \Drupal::service('module_handler');
+        if (!$moduleHandler->moduleExists('hovercss_ui')) {
+            if (hovercss_check_installed()) {
+                $attachments['#attached']['library'][] = 'hovercss/hover.css';
+            } else {
+                $attachments['#attached']['library'][] = 'hovercss/hover.cdn';
+            }
+        }
+    }
+}
