0

I have installed drupal 8.4.2 and created a subtheme with base theme bootstrap. I want to customize settings adding the color module, but really I do not know what steps I am missing.

  • I have enabled color module (it's in core)
  • I have copied (from bartik) the color directory and files
  • I have edited color.inc to have my custom color schemes
  • I have edited THEME.theme adding this:

    function MYTHEME_process_html(&$variables) {
      // Hook into color.module.
      if (module_exists('color')) {
        _color_html_alter($variables);
      }
    }
    function MYTHEME_preprocess_page(&$variables, $hook) {
        // Hook into color.module
        if (module_exists('color')) {
            _color_page_alter($variables);
        }
    }

As a result I have white page with no rendering. (It's not cache issue) and I guess my problem is with .theme file I'd like to know where to find the instructions (drupal.org has not much). Thanks

1 Answer 1

1

There's actually a video on YouTube about how to do this in Bootstrap. There's also a more general video for other themes by the same person.

You'll need to use a LESS or SASS subtheme; the most basic subtheme that just uses regular CSS will not work because the Color module will change the values of the variables.

You will also need a way to compile the LESS/SASS on the server that you use the Color module on, so if you plan to make adjustments on your production server, you will need something like the LESS module, which does not yet have an official release for Drupal 8 (might still work, needs testing).

You can also find a feature request on drupal.org for putting this directly into Bootstrap, but it hasn't made any progress in the past couple years.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.