diff --git a/drupal8_w3css_theme.services.yml b/drupal8_w3css_theme.services.yml
new file mode 100644
index 0000000..2e55081
--- /dev/null
+++ b/drupal8_w3css_theme.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\drupal8_w3css_theme\Hook\Drupal8W3cssThemeHooks:
+    class: Drupal\drupal8_w3css_theme\Hook\Drupal8W3cssThemeHooks
+    autowire: true
diff --git a/drupal8_w3css_theme.theme b/drupal8_w3css_theme.theme
index 8cf537b..08ed6c8 100644
--- a/drupal8_w3css_theme.theme
+++ b/drupal8_w3css_theme.theme
@@ -12,6 +12,10 @@
 
 declare(strict_types=1);
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\drupal8_w3css_theme\Hook\Drupal8W3cssThemeHooks;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
@@ -19,417 +23,78 @@ use Drupal\Core\Render\Element;
 /**
  * Implements hook_preprocess_HOOK() for HTML document templates.
  */
-function drupal8_w3css_theme_preprocess_html(array &$variables): void {
-  // Add node id to the body class.
-  $variables['path_info']['args'] = FALSE;
-
-  $routeMatch = \Drupal::routeMatch();
-  // Test route name.
-  switch ($routeMatch->getRouteName()) {
-
-    // Add node id to the body class.
-    case 'entity.node.canonical':
-      $node = $routeMatch->getParameter('node');
-      if ($node) {
-        $node_id = $node->id();
-        if ($node_id) {
-          $variables['attributes']['class'][] = 'path-node-' . $node_id;
-        }
-      }
-      break;
-
-    // Add vocabulary name and term id to the body class.
-    case 'entity.taxonomy_term.canonical':
-      $term = $routeMatch->getParameter('taxonomy_term');
-      if ($term) {
-        if ($term->id()) {
-          $variables['attributes']['class'][] = 'path-taxonomy-term-' . $term->id();
-        }
-        if ($term->bundle()) {
-          $variables['attributes']['class'][] = 'path-vocabulary-' . Html::cleanCssIdentifier($term->bundle());
-        }
-      }
-      break;
-  }
-
-  // If the user is logged in use ID if not use second word after user/login.
-  $curr_path = \Drupal::service('path.current')->getPath();
-  $curr_path = ltrim($curr_path, '/');
-  $user_url = explode('/', $curr_path);
-  if (isset($user_url[0], $user_url[1]) && ($user_url[0] == 'user')) {
-    $variables['attributes']['class'][] = 'path-user-' . $user_url[1];
-  }
-
-  // Add view id name to the body class.
-  $view_id = $routeMatch->getParameter('view_id');
-  if ($view_id) {
-    $variables['attributes']['class'][] = 'path-view-' . Html::cleanCssIdentifier($view_id);
-  }
-
-  /** @var \Drupal\Core\Routing\AdminContext $admin_context */
-  $admin_context = \Drupal::service('router.admin_context');
-  if ($admin_context->isAdminRoute()) {
-    $variables['attributes']['class'][] = 'admin-context';
-  }
+#[LegacyHook]
+function drupal8_w3css_theme_preprocess_html(array &$variables): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessHtml($variables);
 }
 
 /**
  * Implements hook_preprocess_page() for page templates.
  */
-function drupal8_w3css_theme_preprocess_page(array &$variables): void {
-  // Top regions variables.
-  $has_top_first = !empty($variables['page']['top_first']);
-  $has_top_second = !empty($variables['page']['top_second']);
-  $has_top_third = !empty($variables['page']['top_third']);
-  // Main regions variables.
-  $has_sidebar_first = !empty($variables['page']['sidebar_first']);
-  $has_sidebar_second = !empty($variables['page']['sidebar_second']);
-  // Bottom regions variables.
-  $has_bottom_first = !empty($variables['page']['bottom_first']);
-  $has_bottom_second = !empty($variables['page']['bottom_second']);
-  $has_bottom_third = !empty($variables['page']['bottom_third']);
-  $has_bottom_forth = !empty($variables['page']['bottom_forth']);
-  // Footer regions variables.
-  $has_footer_first = !empty($variables['page']['footer_first']);
-  $has_footer_second = !empty($variables['page']['footer_second']);
-  $has_footer_third = !empty($variables['page']['footer_third']);
-
-  // Add W3.CSS Responsive classes to Top Container.
-  if ($has_top_first && $has_top_second && $has_top_third) {
-    $variables['top_w3css'] = 'w3-third';
-  }
-  elseif (($has_top_first && $has_top_second) ||
-    ($has_top_first && $has_top_third) ||
-    ($has_top_second && $has_top_third)
-  ) {
-    $variables['top_w3css'] = 'w3-half';
-  }
-  else {
-    $variables['top_w3css'] = 'w3-col';
-  }
-
-  // Add W3.CSS Responsive classes to left and right sidebar.
-  if ($has_sidebar_first && $has_sidebar_second) {
-    $variables['content_w3css'] = 'w3-half';
-    $variables['sidebarfirst'] = 'w3-quarter';
-    $variables['sidebarsecond'] = 'w3-quarter';
-  }
-  elseif ($has_sidebar_first) {
-    $variables['content_w3css'] = 'w3-threequarter';
-    $variables['sidebarfirst'] = 'w3-quarter';
-  }
-  elseif ($has_sidebar_second) {
-    $variables['content_w3css'] = 'w3-threequarter';
-    $variables['sidebarsecond'] = 'w3-quarter';
-  }
-  else {
-    $variables['content_w3css'] = 'w3-col';
-  }
-
-  // Add 3col stacked equal width.
-  $variables['equal_width'] = theme_get_setting('equal_width');
-  if ($variables['equal_width'] != NULL) {
-    if ($has_sidebar_first && $has_sidebar_second) {
-      $variables['content_w3css'] = 'w3-third';
-      $variables['sidebarfirst'] = 'w3-third';
-      $variables['sidebarsecond'] = 'w3-third';
-    }
-    elseif ($has_sidebar_first) {
-      $variables['content_w3css'] = 'w3-twothird';
-      $variables['sidebarfirst'] = 'w3-third';
-    }
-    elseif ($has_sidebar_second) {
-      $variables['content_w3css'] = 'w3-twothird';
-      $variables['sidebarsecond'] = 'w3-third';
-    }
-    else {
-      $variables['content_w3css'] = 'w3-col';
-    }
-  }
-
-  // Add W3.CSS Responsive classes to Bottom Container.
-  if ($has_bottom_first && $has_bottom_second && $has_bottom_third && $has_bottom_forth) {
-    $variables['bottom_w3css'] = 'w3-quarter';
-  }
-  elseif (($has_bottom_first && $has_bottom_second && $has_bottom_third) ||
-    ($has_bottom_first && $has_bottom_third && $has_bottom_forth) ||
-    ($has_bottom_first && $has_bottom_second && $has_bottom_forth) ||
-    ($has_bottom_second && $has_bottom_third && $has_bottom_forth)
-  ) {
-    $variables['bottom_w3css'] = 'w3-third';
-  }
-  elseif (($has_bottom_first && $has_bottom_second) ||
-    ($has_bottom_first && $has_bottom_third) ||
-    ($has_bottom_first && $has_bottom_forth) ||
-    ($has_bottom_second && $has_bottom_forth) ||
-    ($has_bottom_second && $has_bottom_third) ||
-    ($has_bottom_third && $has_bottom_forth)
-  ) {
-    $variables['bottom_w3css'] = 'w3-half';
-  }
-  else {
-    $variables['bottom_w3css'] = 'w3-col';
-  }
-
-  // Add W3.CSS Responsive classes to Footer Container.
-  if ($has_footer_first && $has_footer_second && $has_footer_third) {
-    $variables['footer_w3css'] = 'w3-third';
-  }
-  elseif (($has_footer_first && $has_footer_second) ||
-    ($has_footer_first && $has_footer_third) ||
-    ($has_footer_second && $has_footer_third)
-  ) {
-    $variables['footer_w3css'] = 'w3-half';
-  }
-  else {
-    $variables['footer_w3css'] = 'w3-col';
-  }
-
-  // Mix variables.
-  $mvar = [
-    'd8w3css_site_gfs',
-    'd8w3css_site_gfh',
-    'd8w3css_site_gf',
-    'd8w3css_google_font_local',
-    'd8w3css_font_awesome',
-    'full_opacity_onscroll',
-    'layout_user_login_custom',
-    'pagetitle_animation',
-    'breadcrumb_page_title',
-    'sitename_animation',
-    'border_animation',
-    'top_region',
-    'main_region',
-    'bottom_region',
-    'footer_region',
-    'website_width',
-  ];
-  foreach ($mvar as $value) {
-    $variables[$value] = theme_get_setting($value);
-  }
-
-  // Social Media's $variables.
-  $svar = [
-    'social_media_size',
-    'show_social_icon',
-    'facebook_url',
-    'twitter_url',
-    'pinterest_url',
-    'linkedin_url',
-    'instagram_url',
-    'youtube_url',
-    'drupal_url',
-    'rss_url',
-    'mastodon_url',
-    'copyright_text',
-    'show_credit_link',
-  ];
-  foreach ($svar as $value) {
-    $variables[$value] = theme_get_setting($value);
-  }
-
-  // Color's variables.
-  $cvar = [
-    'color_page_wrapper',
-    'color_header',
-    'color_primary_menu',
-    'color_welcome_text',
-    'color_highlighted',
-    'color_top_container',
-    'color_top_first',
-    'color_top_second',
-    'color_top_third',
-    'color_page_title',
-    'color_main',
-    'color_breadcrumb',
-    'color_sidebar_first',
-    'color_sidebar_second',
-    'color_content',
-    'color_bottom_container',
-    'color_bottom_first',
-    'color_bottom_second',
-    'color_bottom_third',
-    'color_bottom_forth',
-    'color_footer_container',
-    'color_footer_first',
-    'color_footer_second',
-    'color_footer_third',
-    'color_footer_menu',
-    'color_copyright',
-  ];
-  foreach ($cvar as $value) {
-    $variables[$value] = theme_get_setting($value);
-  }
-
-  // Check if the current user on login/register or reset.
-  if (theme_get_setting('layout_user_login_custom')) {
-    $curr_path = \Drupal::service('path.current')->getPath();
-    $curr_path = ltrim($curr_path, '/');
-    if ($curr_path == 'user/login' || $curr_path == 'user/register' || $curr_path == 'user/password') {
-      unset($variables['page']['sidebar_first'], $variables['page']['sidebar_second']);
-      $variables['#attached']['library'][] = 'drupal8_w3css_theme/d8w3css-user-login-custom';
-    }
-  }
+#[LegacyHook]
+function drupal8_w3css_theme_preprocess_page(array &$variables): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessPage($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK() for node.html.twig.
  */
+#[LegacyHook]
 function drupal8_w3css_theme_preprocess_node(array &$variables): void {
-  // Remove the "Add new comment" link on teasers or when the comment form is
-  // displayed on the page.
-  if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) {
-    unset($variables['content']['links']['comment']['#links']['comment-add']);
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessNode($variables);
 }
 
 /**
  * Implements hook_preprocess_breadcrumb().
  */
+#[LegacyHook]
 function drupal8_w3css_theme_preprocess_breadcrumb(array &$variables): void {
-  if ($variables['breadcrumb'] && !theme_get_setting('breadcrumb_page_title')) {
-    $request = \Drupal::request();
-    $route_match = \Drupal::routeMatch();
-    $page_title = \Drupal::service('title_resolver')
-      ->getTitle($request, $route_match->getRouteObject());
-    if (!empty($page_title)) {
-      $variables['breadcrumb'][] = [
-        'text' => $page_title,
-      ];
-      // Add cache context based on url.
-      $variables['#cache']['contexts'][] = 'url';
-    }
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessBreadcrumb($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function drupal8_w3css_theme_preprocess_field__node__created(array &$variables): void {
-  foreach (Element::children($variables['items']) as $item) {
-    unset($variables['items'][$item]['content']['#prefix']);
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessFieldNodeCreated($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK() for setting classes.
  */
+#[LegacyHook]
 function drupal8_w3css_theme_preprocess_filter_caption(array &$variables): void {
-  $variables['classes'] = isset($variables['classes']) && !empty($variables['classes']) ? $variables['classes'] . ' caption' : 'caption';
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessFilterCaption($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK() for comment templates.
  */
-function drupal8_w3css_theme_preprocess_comment(array &$variables): void {
-  // Getting the node creation time stamp from the comment object.
-  $date = $variables['comment']->getCreatedTime();
-  // Formatting "created" as "X days ago".
-  $variables['created'] = t('@time ago', [
-    '@time' => \Drupal::service('date.formatter')
-      ->formatInterval(\Drupal::time()->getRequestTime() - $date),
-  ]);
+#[LegacyHook]
+function drupal8_w3css_theme_preprocess_comment(array &$variables): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessComment($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK() for maintenance-page.html.twig.
  */
-function drupal8_w3css_theme_preprocess_maintenance_page(array &$variables): void {
-  // By default, site_name is set to Drupal if no db connection is available
-  // or during site installation. Setting site_name to an empty string makes
-  // the site and update pages look cleaner.
-  // @see template_preprocess_maintenance_page
-  if (!$variables['db_is_active']) {
-    $variables['site_name'] = '';
-  }
-
-  // drupal8_w3css_theme has custom styling for the maintenance page.
-  $variables['#attached']['library'][] = 'drupal8_w3css_theme/templates/layout/maintenance_page';
+#[LegacyHook]
+function drupal8_w3css_theme_preprocess_maintenance_page(array &$variables): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->preprocessMaintenancePage($variables);
 }
 
 /**
  * Implements hook_page_attachments_alter().
  */
-function drupal8_w3css_theme_page_attachments_alter(array &$attachments): void {
-
-  // Load google fonts locally - Global.
-  if (theme_get_setting('d8w3css_google_font_local') && theme_get_setting('d8w3css_site_gf')) {
-    $in_font = theme_get_setting('d8w3css_site_gf');
-    $current_ingf = 'drupal8_w3css_theme/d8w3css-gfin' . substr($in_font, 7);
-    $attachments['#attached']['library'][] = $current_ingf;
-  }
-  // Load fonts external - Global.
-  if (!theme_get_setting('d8w3css_google_font_local') && theme_get_setting('d8w3css_site_gf')) {
-    $ex_font = theme_get_setting('d8w3css_site_gf');
-    $current_exgf = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font, 7);
-    $attachments['#attached']['library'][] = $current_exgf;
-  }
-
-  // Load google fonts locally - Heading.
-  if (theme_get_setting('d8w3css_google_font_local') && theme_get_setting('d8w3css_site_gfh')) {
-    $in_font_h = theme_get_setting('d8w3css_site_gfh');
-    $current_ingfh = 'drupal8_w3css_theme/d8w3css-gfin' . substr($in_font_h, 7);
-    $attachments['#attached']['library'][] = $current_ingfh;
-  }
-  // Load fonts external - Heading.
-  if (!theme_get_setting('d8w3css_google_font_local') && theme_get_setting('d8w3css_site_gfh')) {
-    $ex_font_h = theme_get_setting('d8w3css_site_gfh');
-    $current_exgfh = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font_h, 7);
-    $attachments['#attached']['library'][] = $current_exgfh;
-  }
-
-  // Load special fonts' library.
-  if (theme_get_setting('d8w3css_site_gfs')) {
-    $ex_font_s = theme_get_setting('d8w3css_site_gfs');
-    $current_exgfs = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font_s, 7);
-    $attachments['#attached']['library'][] = $current_exgfs;
-  }
-
-  // Load default color theme if not.
-  if ((!theme_get_setting('current_theme')) || (theme_get_setting('current_theme') == 'none')) {
-    $attachments['#attached']['library'][] = 'drupal8_w3css_theme/w3css-default-theme';
-  }
-  else {
-    $my_current_theme = theme_get_setting('current_theme');
-    $predefined_theme_filename = 'drupal8_w3css_theme/' . str_replace('w3-theme-', 'w3-css-theme-', $my_current_theme);
-    $attachments['#attached']['library'][] = $predefined_theme_filename;
-  }
-
-  // Load font awesome.
-  switch (theme_get_setting('d8w3css_font_awesome')) {
-    case 1:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-4-in';
-      break;
-
-    case 2:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-4-ex';
-      break;
-
-    case 3:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-5-ex';
-      break;
-
-    case 4:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-6-ex';
-      break;
-  }
-
-  switch (theme_get_setting('social_media_size')) {
-    case 1:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/social-media-icon-size-m';
-      break;
-
-    case 2:
-      $attachments['#attached']['library'][] = 'drupal8_w3css_theme/social-media-icon-size-l';
-      break;
-  }
-
-  // Load full opacity if enabled but not on admin pages.
-  /** @var \Drupal\Core\Routing\AdminContext $admin_context */
-  $admin_context = \Drupal::service('router.admin_context');
-  if ((theme_get_setting('full_opacity_onscroll')) && (!$admin_context->isAdminRoute())) {
-    $attachments['#attached']['library'][] = 'drupal8_w3css_theme/d8w3css-full-opacity';
-  }
+#[LegacyHook]
+function drupal8_w3css_theme_page_attachments_alter(array &$attachments): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->pageAttachmentsAlter($attachments);
 }
 
 /**
@@ -437,122 +102,75 @@ function drupal8_w3css_theme_page_attachments_alter(array &$attachments): void {
  *
  * Changes vertical tabs to container.
  */
-function drupal8_w3css_theme_form_node_form_alter(array &$form, FormStateInterface $form_state): void {
-  $form['#theme'] = ['node_edit_form'];
-  $form['advanced']['#type'] = 'container';
-  $form['meta']['#type'] = 'container';
-  $form['meta']['#access'] = TRUE;
-  $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline';
-  $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline';
-
-  $form['revision_information']['#type'] = 'container';
-  $form['revision_information']['#group'] = 'meta';
+#[LegacyHook]
+function drupal8_w3css_theme_form_node_form_alter(array &$form, FormStateInterface $form_state): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->formNodeFormAlter($form, $form_state);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function drupal8_w3css_theme_form_comment_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void {
-  $comment = $form_state->getFormObject()->getEntity();
-  /** @var \Drupal\comment\Entity\Comment $comment */
-  if ($comment->hasParentComment()) {
-    $form['actions']['submit']['#value'] = t('Reply to comment');
-  }
-  else {
-    $form['actions']['submit']['#value'] = t('Post comment');
-  }
+#[LegacyHook]
+function drupal8_w3css_theme_form_comment_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->formCommentFormAlter($form, $form_state, $form_id);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function drupal8_w3css_theme_form_search_block_form_alter(array &$form, FormStateInterface &$form_state): void {
-  $form['keys']['#attributes']['placeholder'] = t('Search');
-  $form['actions']['submit']['#value'] = '.';
-  $form['actions']['submit']['#attributes']['class'][] = 'search-button-block';
+#[LegacyHook]
+function drupal8_w3css_theme_form_search_block_form_alter(array &$form, FormStateInterface &$form_state): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->formSearchBlockFormAlter($form, $form_state);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
+#[LegacyHook]
 function drupal8_w3css_theme_form_search_form_alter(array &$form, FormStateInterface &$form_state): void {
-  unset($form['help_link']);
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->formSearchFormAlter($form, $form_state);
 }
 
 /**
  * Implements hook_theme_suggestions_block_alter().
  */
+#[LegacyHook]
 function drupal8_w3css_theme_theme_suggestions_block_alter(array &$suggestions, array $variables): void {
-  if (!empty($variables['elements']['#id'])) {
-
-    /** @var \Drupal\block\BlockInterface $block */
-    $block = \Drupal::entityTypeManager()
-      ->getStorage('block')
-      ->load($variables['elements']['#id']);
-    if ($block) {
-
-      // Add region-specific block theme suggestions.
-      $region = $block->getRegion();
-      $suggestions[] = 'block__' . $region;
-      $suggestions[] = 'block__' . $region . '__' . 'plugin_id' . '__' . $variables['elements']['#plugin_id'];
-      $suggestions[] = 'block__' . $region . '__' . 'id' . '__' . $variables['elements']['#id'];
-    }
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->themeSuggestionsBlockAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter() for menu.
  */
+#[LegacyHook]
 function drupal8_w3css_theme_theme_suggestions_menu_alter(array &$suggestions, array $variables): void {
-  if (isset($variables['attributes']['region'])) {
-    $suggestions[] = 'menu__' . $variables['attributes']['region'];
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->themeSuggestionsMenuAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter() for form templates.
  */
+#[LegacyHook]
 function drupal8_w3css_theme_theme_suggestions_form_alter(array &$suggestions, array $variables): void {
-  // Suggest the name for the search block.
-  if ($variables['element']['#form_id'] == 'search_block_form') {
-    $suggestions[] = 'form__search_block_form';
-  }
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->themeSuggestionsFormAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_page_alter().
  */
-function drupal8_w3css_theme_theme_suggestions_page_alter(array &$suggestions, array $variables): void {
-  $routeMatch = \Drupal::routeMatch();
-  // Test route name.
-  switch ($routeMatch->getRouteName()) {
-    // Suggest the node page according to the content type name.
-    case 'entity.node.canonical':
-      $node = $routeMatch->getParameter('node');
-      if ($node) {
-        array_splice($suggestions, 1, 0, 'page__' . $node->bundle());
-      }
-      break;
-
-    // Suggest the vocabulary page according to the vocabulary name.
-    case 'entity.taxonomy_term.canonical':
-      $term = $routeMatch->getParameter('taxonomy_term');
-      if ($term) {
-        array_splice($suggestions, 1, 0, 'page__taxonomy__' . $term->bundle());
-      }
-      break;
-  }
-
-  // Suggest the view page according to the view name.
-  $route = $routeMatch->getRouteObject();
-  if ($route && $view_name = $route->getDefault('view_id')) {
-    $suggestions[] = 'page__' . $view_name;
-  }
+#[LegacyHook]
+function drupal8_w3css_theme_theme_suggestions_page_alter(array &$suggestions, array $variables): void
+{
+    \Drupal::service(Drupal8W3cssThemeHooks::class)->themeSuggestionsPageAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter().
  */
+#[LegacyHook]
 function drupal8_w3css_theme_theme_suggestions_user_alter(array &$suggestions, array $variables): void {
-  $suggestions[] = 'user__' . $variables['elements']['#view_mode'];
+  \Drupal::service(Drupal8W3cssThemeHooks::class)->themeSuggestionsUserAlter($suggestions, $variables);
 }
diff --git a/includes/advanced_site_colors.inc b/includes/advanced_site_colors.inc
index 2dc2a47..3a53d3d 100644
--- a/includes/advanced_site_colors.inc
+++ b/includes/advanced_site_colors.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Advanced site colors theme settings.
  */
@@ -308,130 +311,130 @@ $form['drupal8_w3css_theme_settings']['w3_colors'] = [
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_page_wrapper'] = [
   '#type' => 'textfield',
   '#title' => t('Page Wrapper'),
-  '#default_value' => theme_get_setting('color_page_wrapper'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_page_wrapper'), fn() => theme_get_setting('color_page_wrapper')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_header'] = [
   '#type' => 'textfield',
   '#title' => t('Header'),
-  '#default_value' => theme_get_setting('color_header'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_header'), fn() => theme_get_setting('color_header')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_primary_menu'] = [
   '#type' => 'textfield',
   '#title' => t('Main Menu'),
-  '#default_value' => theme_get_setting('color_primary_menu'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_primary_menu'), fn() => theme_get_setting('color_primary_menu')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_welcome_text'] = [
   '#type' => 'textfield',
   '#title' => t('Welcome Text'),
-  '#default_value' => theme_get_setting('color_welcome_text'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_welcome_text'), fn() => theme_get_setting('color_welcome_text')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_highlighted'] = [
   '#type' => 'textfield',
   '#title' => t('Highlighted'),
-  '#default_value' => theme_get_setting('color_highlighted'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_highlighted'), fn() => theme_get_setting('color_highlighted')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_top_container'] = [
   '#type' => 'textfield',
   '#title' => t('Top Container Wrapper'),
-  '#default_value' => theme_get_setting('color_top_container'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_top_container'), fn() => theme_get_setting('color_top_container')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_top_first'] = [
   '#type' => 'textfield',
   '#title' => t('Top First'),
-  '#default_value' => theme_get_setting('color_top_first'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_top_first'), fn() => theme_get_setting('color_top_first')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_top_second'] = [
   '#type' => 'textfield',
   '#title' => t('Top Second'),
-  '#default_value' => theme_get_setting('color_top_second'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_top_second'), fn() => theme_get_setting('color_top_second')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_top_third'] = [
   '#type' => 'textfield',
   '#title' => t('Top Third'),
-  '#default_value' => theme_get_setting('color_top_third'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_top_third'), fn() => theme_get_setting('color_top_third')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_page_title'] = [
   '#type' => 'textfield',
   '#title' => t('Page Title'),
-  '#default_value' => theme_get_setting('color_page_title'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_page_title'), fn() => theme_get_setting('color_page_title')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_main'] = [
   '#type' => 'textfield',
   '#title' => t('Main Container Wrapper'),
-  '#default_value' => theme_get_setting('color_main'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_main'), fn() => theme_get_setting('color_main')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_breadcrumb'] = [
   '#type' => 'textfield',
   '#title' => t('Breadcrumb'),
-  '#default_value' => theme_get_setting('color_breadcrumb'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_breadcrumb'), fn() => theme_get_setting('color_breadcrumb')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_sidebar_first'] = [
   '#type' => 'textfield',
   '#title' => t('Sidebar First'),
-  '#default_value' => theme_get_setting('color_sidebar_first'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_sidebar_first'), fn() => theme_get_setting('color_sidebar_first')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_content'] = [
   '#type' => 'textfield',
   '#title' => t('W3CSS Content'),
-  '#default_value' => theme_get_setting('color_content'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_content'), fn() => theme_get_setting('color_content')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_sidebar_second'] = [
   '#type' => 'textfield',
   '#title' => t('Sidebar Second'),
-  '#default_value' => theme_get_setting('color_sidebar_second'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_sidebar_second'), fn() => theme_get_setting('color_sidebar_second')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_bottom_container'] = [
   '#type' => 'textfield',
   '#title' => t('Bottom Container Wrapper'),
-  '#default_value' => theme_get_setting('color_bottom_container'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_bottom_container'), fn() => theme_get_setting('color_bottom_container')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_bottom_first'] = [
   '#type' => 'textfield',
   '#title' => t('Bottom First'),
-  '#default_value' => theme_get_setting('color_bottom_first'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_bottom_first'), fn() => theme_get_setting('color_bottom_first')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_bottom_second'] = [
   '#type' => 'textfield',
   '#title' => t('Bottom Second'),
-  '#default_value' => theme_get_setting('color_bottom_second'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_bottom_second'), fn() => theme_get_setting('color_bottom_second')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_bottom_third'] = [
   '#type' => 'textfield',
   '#title' => t('Bottom Third'),
-  '#default_value' => theme_get_setting('color_bottom_third'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_bottom_third'), fn() => theme_get_setting('color_bottom_third')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_bottom_forth'] = [
   '#type' => 'textfield',
   '#title' => t('Bottom Forth'),
-  '#default_value' => theme_get_setting('color_bottom_forth'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_bottom_forth'), fn() => theme_get_setting('color_bottom_forth')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_footer_container'] = [
   '#type' => 'textfield',
   '#title' => t('Footer Container Wrapper'),
-  '#default_value' => theme_get_setting('color_footer_container'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_footer_container'), fn() => theme_get_setting('color_footer_container')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_footer_first'] = [
   '#type' => 'textfield',
   '#title' => t('Footer First'),
-  '#default_value' => theme_get_setting('color_footer_first'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_footer_first'), fn() => theme_get_setting('color_footer_first')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_footer_second'] = [
   '#type' => 'textfield',
   '#title' => t('Footer Second'),
-  '#default_value' => theme_get_setting('color_footer_second'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_footer_second'), fn() => theme_get_setting('color_footer_second')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_footer_third'] = [
   '#type' => 'textfield',
   '#title' => t('Footer Third'),
-  '#default_value' => theme_get_setting('color_footer_third'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_footer_third'), fn() => theme_get_setting('color_footer_third')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_footer_menu'] = [
   '#type' => 'textfield',
   '#title' => t('Footer Menu'),
-  '#default_value' => theme_get_setting('color_footer_menu'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_footer_menu'), fn() => theme_get_setting('color_footer_menu')),
 ];
 $form['drupal8_w3css_theme_settings']['w3_colors']['color_copyright'] = [
   '#type' => 'textfield',
   '#title' => t('Copyright'),
-  '#default_value' => theme_get_setting('color_copyright'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('color_copyright'), fn() => theme_get_setting('color_copyright')),
 ];
diff --git a/includes/border_animation.inc b/includes/border_animation.inc
index c38e57e..68878d4 100644
--- a/includes/border_animation.inc
+++ b/includes/border_animation.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Border animation theme settings.
  */
@@ -26,5 +29,5 @@ $form['drupal8_w3css_theme_settings']['w3_border_animation'] = [
 $form['drupal8_w3css_theme_settings']['w3_border_animation']['border_animation'] = [
   '#type' => 'checkbox',
   '#title' => t("Check this box to animate the region's border."),
-  '#default_value' => theme_get_setting('border_animation'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('border_animation'), fn() => theme_get_setting('border_animation')),
 ];
diff --git a/includes/breadcrumb_page_title.inc b/includes/breadcrumb_page_title.inc
index 554f938..9eba708 100644
--- a/includes/breadcrumb_page_title.inc
+++ b/includes/breadcrumb_page_title.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Breadcrumb page title theme settings.
  */
@@ -25,5 +28,5 @@ $form['drupal8_w3css_theme_settings']['w3_breadcrumb_page_title'] = [
 $form['drupal8_w3css_theme_settings']['w3_breadcrumb_page_title']['breadcrumb_page_title'] = [
   '#type' => 'checkbox',
   '#title' => t('Check this box to remove the page title from breadcrumb.'),
-  '#default_value' => theme_get_setting('breadcrumb_page_title'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('breadcrumb_page_title'), fn() => theme_get_setting('breadcrumb_page_title')),
 ];
diff --git a/includes/copyright.inc b/includes/copyright.inc
index 6a0aa6a..e779d32 100644
--- a/includes/copyright.inc
+++ b/includes/copyright.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Copyright theme settings.
  */
@@ -25,5 +28,5 @@ $form['drupal8_w3css_theme_settings']['copyright']['copyright_text'] = [
   '#type' => 'textfield',
   '#title' => t('Enter Copyright Text'),
   '#description' => t("Type %year% instead of an actual year number for dynamic copyright. (Copyright © %year% Company Name - All rights reserved)."),
-  '#default_value' => theme_get_setting('copyright_text'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('copyright_text'), fn() => theme_get_setting('copyright_text')),
 ];
diff --git a/includes/credit.inc b/includes/credit.inc
index e94f460..87d2ed0 100644
--- a/includes/credit.inc
+++ b/includes/credit.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Credit link theme settings.
  */
@@ -24,6 +27,6 @@ $form['drupal8_w3css_theme_settings']['credit_link'] = [
 $form['drupal8_w3css_theme_settings']['credit_link']['show_credit_link'] = [
   '#type' => 'checkbox',
   '#title' => t('Show/Hide Credit Text'),
-  '#default_value' => theme_get_setting('show_credit_link'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('show_credit_link'), fn() => theme_get_setting('show_credit_link')),
   '#description'   => t('Please display credit in footer'),
 ];
diff --git a/includes/equal_width.inc b/includes/equal_width.inc
index 1a36f1c..edf316f 100644
--- a/includes/equal_width.inc
+++ b/includes/equal_width.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Equal width columns theme settings.
  */
@@ -25,5 +28,5 @@ $form['drupal8_w3css_theme_settings']['w3_equal_width'] = [
 $form['drupal8_w3css_theme_settings']['w3_equal_width']['equal_width'] = [
   '#type' => 'checkbox',
   '#title' => t('Change the columns in the main container to (33% 33% 33%)'),
-  '#default_value' => theme_get_setting('equal_width'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('equal_width'), fn() => theme_get_setting('equal_width')),
 ];
diff --git a/includes/external_libraries.inc b/includes/external_libraries.inc
index 4a46ebb..3ac3169 100644
--- a/includes/external_libraries.inc
+++ b/includes/external_libraries.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * External libraries theme settings.
  */
@@ -26,7 +29,7 @@ $form['drupal8_w3css_theme_settings']['w3_fontawesome_libraries'] = [
 $form['drupal8_w3css_theme_settings']['w3_fontawesome_libraries']['d8w3css_font_awesome'] = [
   '#type' => 'radios',
   '#title' => t('Select Font Awesome Library'),
-  '#default_value' => theme_get_setting('d8w3css_font_awesome'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('d8w3css_font_awesome'), fn() => theme_get_setting('d8w3css_font_awesome')),
   '#options' => [
     0 => t('None'),
     1 => t('Load Font Awesome 4.7 locally.'),
@@ -47,7 +50,7 @@ $form['drupal8_w3css_theme_settings']['w3_external_libraries'] = [
 $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_google_font_local'] = [
   '#type' => 'checkbox',
   '#title' => t('Check this box if you would like to load Google fonts (Global Site Fonts and Heading Fonts only) locally. This is for use with the W3CSS Theme.'),
-  '#default_value' => theme_get_setting('d8w3css_google_font_local'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('d8w3css_google_font_local'), fn() => theme_get_setting('d8w3css_google_font_local')),
 ];
 
 $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gf'] = [
@@ -109,7 +112,7 @@ $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gf'
     'd8w3css-work-sans' => t('Work Sans - sans-serif'),
 
   ],
-  '#default_value' => theme_get_setting('d8w3css_site_gf'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('d8w3css_site_gf'), fn() => theme_get_setting('d8w3css_site_gf')),
 ];
 
 $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gfh'] = [
@@ -146,7 +149,7 @@ $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gfh
     'd8w3css-yanone-kaffeesatz' => t('Yanone Kaffeesatz - sans-serif'),
 
   ],
-  '#default_value' => theme_get_setting('d8w3css_site_gfh'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfh'), fn() => theme_get_setting('d8w3css_site_gfh')),
 ];
 
 $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gfs'] = [
@@ -182,5 +185,5 @@ $form['drupal8_w3css_theme_settings']['w3_external_libraries']['d8w3css_site_gfs
     'd8w3css-unifrakturmaguntia' => t('unifrakturmaguntia - cursive'),
 
   ],
-  '#default_value' => theme_get_setting('d8w3css_site_gfs'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfs'), fn() => theme_get_setting('d8w3css_site_gfs')),
 ];
diff --git a/includes/full_opacity_onscroll.inc b/includes/full_opacity_onscroll.inc
index 46c30f9..73981df 100644
--- a/includes/full_opacity_onscroll.inc
+++ b/includes/full_opacity_onscroll.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Full opacity on scroll theme settings.
  */
@@ -25,5 +28,5 @@ $form['drupal8_w3css_theme_settings']['w3_full_opacity'] = [
 $form['drupal8_w3css_theme_settings']['w3_full_opacity']['full_opacity_onscroll'] = [
   '#type' => 'checkbox',
   '#title' => t('Check this box to animate the opacity on scroll down.'),
-  '#default_value' => theme_get_setting('full_opacity_onscroll'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('full_opacity_onscroll'), fn() => theme_get_setting('full_opacity_onscroll')),
 ];
diff --git a/includes/layout_user_login.inc b/includes/layout_user_login.inc
index 7a826a0..b72eaaa 100644
--- a/includes/layout_user_login.inc
+++ b/includes/layout_user_login.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * User login layout theme settings.
  */
@@ -25,5 +28,5 @@ $form['drupal8_w3css_theme_settings']['w3_layout_user'] = [
 $form['drupal8_w3css_theme_settings']['w3_layout_user']['layout_user_login_custom'] = [
   '#type' => 'checkbox',
   '#title' => t('Check this box to change the layout for the login, register and reset password pages.'),
-  '#default_value' => theme_get_setting('layout_user_login_custom'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('layout_user_login_custom'), fn() => theme_get_setting('layout_user_login_custom')),
 ];
diff --git a/includes/predefined_themes.inc b/includes/predefined_themes.inc
index ee3a755..67da3a8 100644
--- a/includes/predefined_themes.inc
+++ b/includes/predefined_themes.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Predefined color themes settings.
  */
@@ -80,5 +83,5 @@ $form['drupal8_w3css_theme_settings']['w3_theme_current']['current_theme'] = [
     'w3-theme-00028' => t('00028 - DarkRed LightBlue'),
     'w3-theme-00029' => t('00029 - Colorfull Image Background'),
   ],
-  '#default_value' => theme_get_setting('current_theme'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('current_theme'), fn() => theme_get_setting('current_theme')),
 ];
diff --git a/includes/sitename_animation.inc b/includes/sitename_animation.inc
index 6cd9bf4..e6a74f4 100644
--- a/includes/sitename_animation.inc
+++ b/includes/sitename_animation.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * CSS text animation theme settings.
  */
@@ -55,7 +58,7 @@ $form['drupal8_w3css_theme_settings']['w3_sitename_animation']['sitename_animati
     'animate-name-24' => t('Style 24 (animate-text-24)'),
 
   ],
-  '#default_value' => theme_get_setting('sitename_animation'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('sitename_animation'), fn() => theme_get_setting('sitename_animation')),
 ];
 
 $form['drupal8_w3css_theme_settings']['w3_sitename_animation']['pagetitle_animation'] = [
@@ -89,5 +92,5 @@ $form['drupal8_w3css_theme_settings']['w3_sitename_animation']['pagetitle_animat
     'animate-title-24' => t('Style 24'),
 
   ],
-  '#default_value' => theme_get_setting('pagetitle_animation'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('pagetitle_animation'), fn() => theme_get_setting('pagetitle_animation')),
 ];
diff --git a/includes/social_links.inc b/includes/social_links.inc
index 1a80fe9..4802f35 100644
--- a/includes/social_links.inc
+++ b/includes/social_links.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Social media links theme settings.
  */
@@ -25,7 +28,7 @@ $form['drupal8_w3css_theme_settings']['social_icon'] = [
 $form['drupal8_w3css_theme_settings']['social_icon']['social_media_size'] = [
   '#type' => 'radios',
   '#title' => t('Select The Social Media Icon Size'),
-  '#default_value' => theme_get_setting('social_media_size'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('social_media_size'), fn() => theme_get_setting('social_media_size')),
   '#options' => [
     0 => t('Small - Default'),
     1 => t('Medium'),
@@ -36,51 +39,51 @@ $form['drupal8_w3css_theme_settings']['social_icon']['social_media_size'] = [
 $form['drupal8_w3css_theme_settings']['social_icon']['show_social_icon'] = [
   '#type' => 'checkbox',
   '#title' => t('Show Social Icons'),
-  '#default_value' => theme_get_setting('show_social_icon'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('show_social_icon'), fn() => theme_get_setting('show_social_icon')),
   '#description' => t("Check this option to show Social Icon. Uncheck to hide."),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['facebook_url'] = [
   '#type' => 'textfield',
   '#title' => t('Facebook Page'),
-  '#default_value' => theme_get_setting('facebook_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('facebook_url'), fn() => theme_get_setting('facebook_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['twitter_url'] = [
   '#type' => 'textfield',
   '#title' => t('X Profile'),
-  '#default_value' => theme_get_setting('twitter_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('twitter_url'), fn() => theme_get_setting('twitter_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['pinterest_url'] = [
   '#type' => 'textfield',
   '#title' => t('Pinterest Profile'),
-  '#default_value' => theme_get_setting('pinterest_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('pinterest_url'), fn() => theme_get_setting('pinterest_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['linkedin_url'] = [
   '#type' => 'textfield',
   '#title' => t('Linkedin Profile'),
-  '#default_value' => theme_get_setting('linkedin_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('linkedin_url'), fn() => theme_get_setting('linkedin_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['instagram_url'] = [
   '#type' => 'textfield',
   '#title' => t('Instagram Profile'),
-  '#default_value' => theme_get_setting('instagram_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('instagram_url'), fn() => theme_get_setting('instagram_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['youtube_url'] = [
   '#type' => 'textfield',
   '#title' => t('Youtube Profile'),
-  '#default_value' => theme_get_setting('youtube_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('youtube_url'), fn() => theme_get_setting('youtube_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['drupal_url'] = [
   '#type' => 'textfield',
   '#title' => t('Drupal Profile'),
-  '#default_value' => theme_get_setting('drupal_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('drupal_url'), fn() => theme_get_setting('drupal_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['rss_url'] = [
   '#type' => 'textfield',
   '#title' => t('RSS Link'),
-  '#default_value' => theme_get_setting('rss_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('rss_url'), fn() => theme_get_setting('rss_url')),
 ];
 $form['drupal8_w3css_theme_settings']['social_icon']['mastodon_url'] = [
   '#type' => 'textfield',
   '#title' => t('Mastodon Profile'),
-  '#default_value' => theme_get_setting('mastodon_url'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('mastodon_url'), fn() => theme_get_setting('mastodon_url')),
 ];
diff --git a/includes/website_width.inc b/includes/website_width.inc
index 4d24bba..22f6279 100644
--- a/includes/website_width.inc
+++ b/includes/website_width.inc
@@ -12,6 +12,9 @@
 
 declare(strict_types=1);
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+
 /**
  * Website width theme settings.
  */
@@ -36,5 +39,5 @@ $form['drupal8_w3css_theme_settings']['w3_website_width']['website_width'] = [
     'w3-width-800' => t('800 Pixels'),
     'w3-width-100-percent' => t('100%'),
   ],
-  '#default_value' => theme_get_setting('website_width'),
+  '#default_value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(ThemeSettingsProvider::class)->getSetting('website_width'), fn() => theme_get_setting('website_width')),
 ];
diff --git a/src/Hook/Drupal8W3cssThemeHooks.php b/src/Hook/Drupal8W3cssThemeHooks.php
new file mode 100644
index 0000000..5350ac9
--- /dev/null
+++ b/src/Hook/Drupal8W3cssThemeHooks.php
@@ -0,0 +1,512 @@
+<?php
+
+namespace Drupal\drupal8_w3css_theme\Hook;
+
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\ThemeSettingsProvider;
+use Drupal\Component\Utility\Html;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\Element;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for drupal8_w3css_theme.
+ */
+class Drupal8W3cssThemeHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_preprocess_HOOK() for HTML document templates.
+     */
+    #[Hook('preprocess_html')]
+    public static function preprocessHtml(array &$variables): void
+    {
+        // Add node id to the body class.
+        $variables['path_info']['args'] = FALSE;
+        $routeMatch = \Drupal::routeMatch();
+        // Test route name.
+        switch ($routeMatch->getRouteName()) {
+            // Add node id to the body class.
+            case 'entity.node.canonical':
+                $node = $routeMatch->getParameter('node');
+                if ($node) {
+                    $node_id = $node->id();
+                    if ($node_id) {
+                        $variables['attributes']['class'][] = 'path-node-' . $node_id;
+                    }
+                }
+                break;
+            // Add vocabulary name and term id to the body class.
+            case 'entity.taxonomy_term.canonical':
+                $term = $routeMatch->getParameter('taxonomy_term');
+                if ($term) {
+                    if ($term->id()) {
+                        $variables['attributes']['class'][] = 'path-taxonomy-term-' . $term->id();
+                    }
+                    if ($term->bundle()) {
+                        $variables['attributes']['class'][] = 'path-vocabulary-' . \Drupal\Component\Utility\Html::cleanCssIdentifier($term->bundle());
+                    }
+                }
+                break;
+        }
+        // If the user is logged in use ID if not use second word after user/login.
+        $curr_path = \Drupal::service('path.current')->getPath();
+        $curr_path = ltrim($curr_path, '/');
+        $user_url = explode('/', $curr_path);
+        if (isset($user_url[0], $user_url[1]) && $user_url[0] == 'user') {
+            $variables['attributes']['class'][] = 'path-user-' . $user_url[1];
+        }
+        // Add view id name to the body class.
+        $view_id = $routeMatch->getParameter('view_id');
+        if ($view_id) {
+            $variables['attributes']['class'][] = 'path-view-' . \Drupal\Component\Utility\Html::cleanCssIdentifier($view_id);
+        }
+        /** @var \Drupal\Core\Routing\AdminContext $admin_context */
+        $admin_context = \Drupal::service('router.admin_context');
+        if ($admin_context->isAdminRoute()) {
+            $variables['attributes']['class'][] = 'admin-context';
+        }
+    }
+    /**
+     * Implements hook_preprocess_page() for page templates.
+     */
+    #[Hook('preprocess_page')]
+    public static function preprocessPage(array &$variables): void
+    {
+        // Top regions variables.
+        $has_top_first = !empty($variables['page']['top_first']);
+        $has_top_second = !empty($variables['page']['top_second']);
+        $has_top_third = !empty($variables['page']['top_third']);
+        // Main regions variables.
+        $has_sidebar_first = !empty($variables['page']['sidebar_first']);
+        $has_sidebar_second = !empty($variables['page']['sidebar_second']);
+        // Bottom regions variables.
+        $has_bottom_first = !empty($variables['page']['bottom_first']);
+        $has_bottom_second = !empty($variables['page']['bottom_second']);
+        $has_bottom_third = !empty($variables['page']['bottom_third']);
+        $has_bottom_forth = !empty($variables['page']['bottom_forth']);
+        // Footer regions variables.
+        $has_footer_first = !empty($variables['page']['footer_first']);
+        $has_footer_second = !empty($variables['page']['footer_second']);
+        $has_footer_third = !empty($variables['page']['footer_third']);
+        // Add W3.CSS Responsive classes to Top Container.
+        if ($has_top_first && $has_top_second && $has_top_third) {
+            $variables['top_w3css'] = 'w3-third';
+        } elseif ($has_top_first && $has_top_second || $has_top_first && $has_top_third || $has_top_second && $has_top_third) {
+            $variables['top_w3css'] = 'w3-half';
+        } else {
+            $variables['top_w3css'] = 'w3-col';
+        }
+        // Add W3.CSS Responsive classes to left and right sidebar.
+        if ($has_sidebar_first && $has_sidebar_second) {
+            $variables['content_w3css'] = 'w3-half';
+            $variables['sidebarfirst'] = 'w3-quarter';
+            $variables['sidebarsecond'] = 'w3-quarter';
+        } elseif ($has_sidebar_first) {
+            $variables['content_w3css'] = 'w3-threequarter';
+            $variables['sidebarfirst'] = 'w3-quarter';
+        } elseif ($has_sidebar_second) {
+            $variables['content_w3css'] = 'w3-threequarter';
+            $variables['sidebarsecond'] = 'w3-quarter';
+        } else {
+            $variables['content_w3css'] = 'w3-col';
+        }
+        // Add 3col stacked equal width.
+        $variables['equal_width'] = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('equal_width'), fn() => theme_get_setting('equal_width'));
+        if ($variables['equal_width'] != NULL) {
+            if ($has_sidebar_first && $has_sidebar_second) {
+                $variables['content_w3css'] = 'w3-third';
+                $variables['sidebarfirst'] = 'w3-third';
+                $variables['sidebarsecond'] = 'w3-third';
+            } elseif ($has_sidebar_first) {
+                $variables['content_w3css'] = 'w3-twothird';
+                $variables['sidebarfirst'] = 'w3-third';
+            } elseif ($has_sidebar_second) {
+                $variables['content_w3css'] = 'w3-twothird';
+                $variables['sidebarsecond'] = 'w3-third';
+            } else {
+                $variables['content_w3css'] = 'w3-col';
+            }
+        }
+        // Add W3.CSS Responsive classes to Bottom Container.
+        if ($has_bottom_first && $has_bottom_second && $has_bottom_third && $has_bottom_forth) {
+            $variables['bottom_w3css'] = 'w3-quarter';
+        } elseif ($has_bottom_first && $has_bottom_second && $has_bottom_third || $has_bottom_first && $has_bottom_third && $has_bottom_forth || $has_bottom_first && $has_bottom_second && $has_bottom_forth || $has_bottom_second && $has_bottom_third && $has_bottom_forth) {
+            $variables['bottom_w3css'] = 'w3-third';
+        } elseif ($has_bottom_first && $has_bottom_second || $has_bottom_first && $has_bottom_third || $has_bottom_first && $has_bottom_forth || $has_bottom_second && $has_bottom_forth || $has_bottom_second && $has_bottom_third || $has_bottom_third && $has_bottom_forth) {
+            $variables['bottom_w3css'] = 'w3-half';
+        } else {
+            $variables['bottom_w3css'] = 'w3-col';
+        }
+        // Add W3.CSS Responsive classes to Footer Container.
+        if ($has_footer_first && $has_footer_second && $has_footer_third) {
+            $variables['footer_w3css'] = 'w3-third';
+        } elseif ($has_footer_first && $has_footer_second || $has_footer_first && $has_footer_third || $has_footer_second && $has_footer_third) {
+            $variables['footer_w3css'] = 'w3-half';
+        } else {
+            $variables['footer_w3css'] = 'w3-col';
+        }
+        // Mix variables.
+        $mvar = [
+            'd8w3css_site_gfs',
+            'd8w3css_site_gfh',
+            'd8w3css_site_gf',
+            'd8w3css_google_font_local',
+            'd8w3css_font_awesome',
+            'full_opacity_onscroll',
+            'layout_user_login_custom',
+            'pagetitle_animation',
+            'breadcrumb_page_title',
+            'sitename_animation',
+            'border_animation',
+            'top_region',
+            'main_region',
+            'bottom_region',
+            'footer_region',
+            'website_width',
+        ];
+        foreach ($mvar as $value) {
+            $variables[$value] = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting($value), fn() => theme_get_setting($value));
+        }
+        // Social Media's $variables.
+        $svar = [
+            'social_media_size',
+            'show_social_icon',
+            'facebook_url',
+            'twitter_url',
+            'pinterest_url',
+            'linkedin_url',
+            'instagram_url',
+            'youtube_url',
+            'drupal_url',
+            'rss_url',
+            'mastodon_url',
+            'copyright_text',
+            'show_credit_link',
+        ];
+        foreach ($svar as $value) {
+            $variables[$value] = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting($value), fn() => theme_get_setting($value));
+        }
+        // Color's variables.
+        $cvar = [
+            'color_page_wrapper',
+            'color_header',
+            'color_primary_menu',
+            'color_welcome_text',
+            'color_highlighted',
+            'color_top_container',
+            'color_top_first',
+            'color_top_second',
+            'color_top_third',
+            'color_page_title',
+            'color_main',
+            'color_breadcrumb',
+            'color_sidebar_first',
+            'color_sidebar_second',
+            'color_content',
+            'color_bottom_container',
+            'color_bottom_first',
+            'color_bottom_second',
+            'color_bottom_third',
+            'color_bottom_forth',
+            'color_footer_container',
+            'color_footer_first',
+            'color_footer_second',
+            'color_footer_third',
+            'color_footer_menu',
+            'color_copyright',
+        ];
+        foreach ($cvar as $value) {
+            $variables[$value] = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting($value), fn() => theme_get_setting($value));
+        }
+        // Check if the current user on login/register or reset.
+        if (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('layout_user_login_custom'), fn() => theme_get_setting('layout_user_login_custom'))) {
+            $curr_path = \Drupal::service('path.current')->getPath();
+            $curr_path = ltrim($curr_path, '/');
+            if ($curr_path == 'user/login' || $curr_path == 'user/register' || $curr_path == 'user/password') {
+                unset($variables['page']['sidebar_first'], $variables['page']['sidebar_second']);
+                $variables['#attached']['library'][] = 'drupal8_w3css_theme/d8w3css-user-login-custom';
+            }
+        }
+    }
+    /**
+     * Implements hook_preprocess_HOOK() for node.html.twig.
+     */
+    #[Hook('preprocess_node')]
+    public static function preprocessNode(array &$variables): void
+    {
+        // Remove the "Add new comment" link on teasers or when the comment form is
+        // displayed on the page.
+        if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) {
+            unset($variables['content']['links']['comment']['#links']['comment-add']);
+        }
+    }
+    /**
+     * Implements hook_preprocess_breadcrumb().
+     */
+    #[Hook('preprocess_breadcrumb')]
+    public static function preprocessBreadcrumb(array &$variables): void
+    {
+        if ($variables['breadcrumb'] && !\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('breadcrumb_page_title'), fn() => theme_get_setting('breadcrumb_page_title'))) {
+            $request = \Drupal::request();
+            $route_match = \Drupal::routeMatch();
+            $page_title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());
+            if (!empty($page_title)) {
+                $variables['breadcrumb'][] = [
+                    'text' => $page_title,
+                ];
+                // Add cache context based on url.
+                $variables['#cache']['contexts'][] = 'url';
+            }
+        }
+    }
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_field__node__created')]
+    public static function preprocessFieldNodeCreated(array &$variables): void
+    {
+        foreach (\Drupal\Core\Render\Element::children($variables['items']) as $item) {
+            unset($variables['items'][$item]['content']['#prefix']);
+        }
+    }
+    /**
+     * Implements hook_preprocess_HOOK() for setting classes.
+     */
+    #[Hook('preprocess_filter_caption')]
+    public static function preprocessFilterCaption(array &$variables): void
+    {
+        $variables['classes'] = isset($variables['classes']) && !empty($variables['classes']) ? $variables['classes'] . ' caption' : 'caption';
+    }
+    /**
+     * Implements hook_preprocess_HOOK() for comment templates.
+     */
+    #[Hook('preprocess_comment')]
+    public function preprocessComment(array &$variables): void
+    {
+        // Getting the node creation time stamp from the comment object.
+        $date = $variables['comment']->getCreatedTime();
+        // Formatting "created" as "X days ago".
+        $variables['created'] = $this->t('@time ago', [
+            '@time' => \Drupal::service('date.formatter')->formatInterval(\Drupal::time()->getRequestTime() - $date),
+        ]);
+    }
+    /**
+     * Implements hook_preprocess_HOOK() for maintenance-page.html.twig.
+     */
+    #[Hook('preprocess_maintenance_page')]
+    public static function preprocessMaintenancePage(array &$variables): void
+    {
+        // By default, site_name is set to Drupal if no db connection is available
+        // or during site installation. Setting site_name to an empty string makes
+        // the site and update pages look cleaner.
+        // @see template_preprocess_maintenance_page
+        if (!$variables['db_is_active']) {
+            $variables['site_name'] = '';
+        }
+        // drupal8_w3css_theme has custom styling for the maintenance page.
+        $variables['#attached']['library'][] = 'drupal8_w3css_theme/templates/layout/maintenance_page';
+    }
+    /**
+     * Implements hook_page_attachments_alter().
+     */
+    #[Hook('page_attachments_alter')]
+    public static function pageAttachmentsAlter(array &$attachments): void
+    {
+        // Load google fonts locally - Global.
+        if (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_google_font_local'), fn() => theme_get_setting('d8w3css_google_font_local')) && \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gf'), fn() => theme_get_setting('d8w3css_site_gf'))) {
+            $in_font = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gf'), fn() => theme_get_setting('d8w3css_site_gf'));
+            $current_ingf = 'drupal8_w3css_theme/d8w3css-gfin' . substr($in_font, 7);
+            $attachments['#attached']['library'][] = $current_ingf;
+        }
+        // Load fonts external - Global.
+        if (!\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_google_font_local'), fn() => theme_get_setting('d8w3css_google_font_local')) && \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gf'), fn() => theme_get_setting('d8w3css_site_gf'))) {
+            $ex_font = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gf'), fn() => theme_get_setting('d8w3css_site_gf'));
+            $current_exgf = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font, 7);
+            $attachments['#attached']['library'][] = $current_exgf;
+        }
+        // Load google fonts locally - Heading.
+        if (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_google_font_local'), fn() => theme_get_setting('d8w3css_google_font_local')) && \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfh'), fn() => theme_get_setting('d8w3css_site_gfh'))) {
+            $in_font_h = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfh'), fn() => theme_get_setting('d8w3css_site_gfh'));
+            $current_ingfh = 'drupal8_w3css_theme/d8w3css-gfin' . substr($in_font_h, 7);
+            $attachments['#attached']['library'][] = $current_ingfh;
+        }
+        // Load fonts external - Heading.
+        if (!\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_google_font_local'), fn() => theme_get_setting('d8w3css_google_font_local')) && \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfh'), fn() => theme_get_setting('d8w3css_site_gfh'))) {
+            $ex_font_h = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfh'), fn() => theme_get_setting('d8w3css_site_gfh'));
+            $current_exgfh = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font_h, 7);
+            $attachments['#attached']['library'][] = $current_exgfh;
+        }
+        // Load special fonts' library.
+        if (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfs'), fn() => theme_get_setting('d8w3css_site_gfs'))) {
+            $ex_font_s = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_site_gfs'), fn() => theme_get_setting('d8w3css_site_gfs'));
+            $current_exgfs = 'drupal8_w3css_theme/d8w3css-gfex' . substr($ex_font_s, 7);
+            $attachments['#attached']['library'][] = $current_exgfs;
+        }
+        // Load default color theme if not.
+        if (!\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('current_theme'), fn() => theme_get_setting('current_theme')) || \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('current_theme'), fn() => theme_get_setting('current_theme')) == 'none') {
+            $attachments['#attached']['library'][] = 'drupal8_w3css_theme/w3css-default-theme';
+        } else {
+            $my_current_theme = \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('current_theme'), fn() => theme_get_setting('current_theme'));
+            $predefined_theme_filename = 'drupal8_w3css_theme/' . str_replace('w3-theme-', 'w3-css-theme-', $my_current_theme);
+            $attachments['#attached']['library'][] = $predefined_theme_filename;
+        }
+        // Load font awesome.
+        switch (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('d8w3css_font_awesome'), fn() => theme_get_setting('d8w3css_font_awesome'))) {
+            case 1:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-4-in';
+                break;
+            case 2:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-4-ex';
+                break;
+            case 3:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-5-ex';
+                break;
+            case 4:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/font-awesome-6-ex';
+                break;
+        }
+        switch (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('social_media_size'), fn() => theme_get_setting('social_media_size'))) {
+            case 1:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/social-media-icon-size-m';
+                break;
+            case 2:
+                $attachments['#attached']['library'][] = 'drupal8_w3css_theme/social-media-icon-size-l';
+                break;
+        }
+        // Load full opacity if enabled but not on admin pages.
+        /** @var \Drupal\Core\Routing\AdminContext $admin_context */
+        $admin_context = \Drupal::service('router.admin_context');
+        if (\Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.3.0', fn() => \Drupal::service(\Drupal\Core\Extension\ThemeSettingsProvider::class)->getSetting('full_opacity_onscroll'), fn() => theme_get_setting('full_opacity_onscroll')) && !$admin_context->isAdminRoute()) {
+            $attachments['#attached']['library'][] = 'drupal8_w3css_theme/d8w3css-full-opacity';
+        }
+    }
+    /**
+     * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
+     *
+     * Changes vertical tabs to container.
+     */
+    #[Hook('form_node_form_alter')]
+    public static function formNodeFormAlter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state): void
+    {
+        $form['#theme'] = [
+            'node_edit_form',
+        ];
+        $form['advanced']['#type'] = 'container';
+        $form['meta']['#type'] = 'container';
+        $form['meta']['#access'] = TRUE;
+        $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline';
+        $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline';
+        $form['revision_information']['#type'] = 'container';
+        $form['revision_information']['#group'] = 'meta';
+    }
+    /**
+     * Implements hook_form_FORM_ID_alter().
+     */
+    #[Hook('form_comment_form_alter')]
+    public function formCommentFormAlter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state, string $form_id): void
+    {
+        $comment = $form_state->getFormObject()->getEntity();
+        /** @var \Drupal\comment\Entity\Comment $comment */
+        if ($comment->hasParentComment()) {
+            $form['actions']['submit']['#value'] = $this->t('Reply to comment');
+        } else {
+            $form['actions']['submit']['#value'] = $this->t('Post comment');
+        }
+    }
+    /**
+     * Implements hook_form_FORM_ID_alter().
+     */
+    #[Hook('form_search_block_form_alter')]
+    public function formSearchBlockFormAlter(array &$form, \Drupal\Core\Form\FormStateInterface &$form_state): void
+    {
+        $form['keys']['#attributes']['placeholder'] = $this->t('Search');
+        $form['actions']['submit']['#value'] = '.';
+        $form['actions']['submit']['#attributes']['class'][] = 'search-button-block';
+    }
+    /**
+     * Implements hook_form_FORM_ID_alter().
+     */
+    #[Hook('form_search_form_alter')]
+    public static function formSearchFormAlter(array &$form, \Drupal\Core\Form\FormStateInterface &$form_state): void
+    {
+        unset($form['help_link']);
+    }
+    /**
+     * Implements hook_theme_suggestions_block_alter().
+     */
+    #[Hook('theme_suggestions_block_alter')]
+    public static function themeSuggestionsBlockAlter(array &$suggestions, array $variables): void
+    {
+        if (!empty($variables['elements']['#id'])) {
+            /** @var \Drupal\block\BlockInterface $block */
+            $block = \Drupal::entityTypeManager()->getStorage('block')->load($variables['elements']['#id']);
+            if ($block) {
+                // Add region-specific block theme suggestions.
+                $region = $block->getRegion();
+                $suggestions[] = 'block__' . $region;
+                $suggestions[] = 'block__' . $region . '__' . 'plugin_id' . '__' . $variables['elements']['#plugin_id'];
+                $suggestions[] = 'block__' . $region . '__' . 'id' . '__' . $variables['elements']['#id'];
+            }
+        }
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter() for menu.
+     */
+    #[Hook('theme_suggestions_menu_alter')]
+    public static function themeSuggestionsMenuAlter(array &$suggestions, array $variables): void
+    {
+        if (isset($variables['attributes']['region'])) {
+            $suggestions[] = 'menu__' . $variables['attributes']['region'];
+        }
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter() for form templates.
+     */
+    #[Hook('theme_suggestions_form_alter')]
+    public static function themeSuggestionsFormAlter(array &$suggestions, array $variables): void
+    {
+        // Suggest the name for the search block.
+        if ($variables['element']['#form_id'] == 'search_block_form') {
+            $suggestions[] = 'form__search_block_form';
+        }
+    }
+    /**
+     * Implements hook_theme_suggestions_page_alter().
+     */
+    #[Hook('theme_suggestions_page_alter')]
+    public static function themeSuggestionsPageAlter(array &$suggestions, array $variables): void
+    {
+        $routeMatch = \Drupal::routeMatch();
+        // Test route name.
+        switch ($routeMatch->getRouteName()) {
+            // Suggest the node page according to the content type name.
+            case 'entity.node.canonical':
+                $node = $routeMatch->getParameter('node');
+                if ($node) {
+                    array_splice($suggestions, 1, 0, 'page__' . $node->bundle());
+                }
+                break;
+            // Suggest the vocabulary page according to the vocabulary name.
+            case 'entity.taxonomy_term.canonical':
+                $term = $routeMatch->getParameter('taxonomy_term');
+                if ($term) {
+                    array_splice($suggestions, 1, 0, 'page__taxonomy__' . $term->bundle());
+                }
+                break;
+        }
+        // Suggest the view page according to the view name.
+        $route = $routeMatch->getRouteObject();
+        if ($route && $view_name = $route->getDefault('view_id')) {
+            $suggestions[] = 'page__' . $view_name;
+        }
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter().
+     */
+    #[Hook('theme_suggestions_user_alter')]
+    public static function themeSuggestionsUserAlter(array &$suggestions, array $variables): void
+    {
+        $suggestions[] = 'user__' . $variables['elements']['#view_mode'];
+    }
+}
