In order to make a project compatible with D11, the govcms8_modifier module needs to be removed; But in some cases the website might be using the modifier features provided by this module, so below are the steps to migrate these features to the custom theme (such that this deprecated module can be gracefully removed without causing styling issue).

Step1: Bring Over the xxyyzz.modifier.yml File
Firstly, you need to bring over the govcms8_modifiers.modifiers.yml file to your custom theme:
copy the
govcms8_modifiers.modifiers.ymlto the root folder of the custom theme you’re using (link)rename it to match with your theme’s machine name (e.g.
myproject_bootstrap.modifiers.yml)alter the
class/namespacein the file to use your theme’s plugin instead1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35custom_colors_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\CustomColorsModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\CustomColorsModifier label: 'Colors Modifier' description: 'Provides a Modifier to set the colors on an element' color_background_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\ColorBackgroundModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\ColorBackgroundModifier label: 'Colour Background Modifier' description: 'Provides a Modifier to set the background color on an element' linear_gradient_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\LinearGradientModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\LinearGradientModifier label: 'Linear Gradient Modifier' description: 'Provides a Modifier to set the linear gradient on an element using colors from library' image_bg_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\ImageBgModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\ImageBgModifier label: 'Image Background Modifier' description: 'Provides a Modifier to set the image background on an element' parallax_bg_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\ParallaxBgModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\ParallaxBgModifier label: 'Parallax Background Modifier' description: 'Provides a Modifier to set the parallax background on an element' relative_height_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\RelativeHeightModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\RelativeHeightModifier label: 'Relative Height Modifier' description: 'Provides a Modifier to set the relative height on an element' padding_modifier: - class: Drupal\govcms8_modifiers\Plugin\modifiers\PaddingModifier + class: Drupal\myproject_bootstrap\Plugin\modifiers\PaddingModifier label: 'Padding Modifier' description: 'Provides a Modifier to set the padding on an element'
Step-2: Bring Over the Modifier Plugin
Secondly, you need to copy over the modifier plugins declared in the govcms8_modifier module to your custom theme:
copy the whole
src/Plugin/modifiersdirectory in thegovcms8_modifiermodule, to the root folder of your custom theme (link)rename the
class/namespacein every single modifier*.phpfile to match with your custom theme’s machine name:1 2 3 4 5 6 7 8 9<?php - namespace Drupal\govcms8_modifiers\Plugin\modifiers; + namespace Drupal\myproject_bootstrap\Plugin\modifiers; use Drupal\modifiers\Modification; use Drupal\modifiers\ModifierPluginBase; ....
Step-3: Uninstall the Module and Review
Finally, uninstall the module via drush pm:uninstall govcms8_modifier (after running ahoy cli), clear the cache, and check that the pages originally using modifier is still working and displaying as they originally was.