css override in Drupal not working for editor.

Hi everyone,

I want to override my css in both the content and the editor. Based on the code here, I wrote the below. It works fine for when content is viewed, but the file doesn't load for the h5p the editor.

<?php

function custom_h5p_css_h5p_styles_alter(&$styles, $libraries, $mode) {
    $styles[] = (object) array(
      // Path relative to drupal root
      'path' => drupal_get_path('module', 'custom_h5p_css') . '/h5p-overrides.css',
      // Cache buster
    	'version' => '?ver=1',
    );
}
thomasmars's picture

Hi,
Please provide more context, so we can help you better.What is in your h5p-overrides.css file, what are you trying to override ? What selector is not working ? HTML and CSS structures varies from view to editor.

I have tested it with Drupal and changing CSS in the editor, it works like it should.

You won't however see the .css file in the networks tab of yor developer tools since the css is aggregated and inlined in a <style> tag for the document, but you should see the changes in your developer tools and in the editor's css if you've written the selectors properly.