Add setting for unstyled mode

Created on 4 December 2024, 18 days ago

Problem/Motivation

The "Getting started" section at the Klaro lib points out:

We also provide a version of Klaro without stylesheets included, which is useful in case you want to provide your own styles: klaro-no-css.js. If you use this, make sure to either include your own styles or to include klaro.min.css separetely, like this:

https://github.com/klaro-org/klaro-js?tab=readme-ov-file#getting-started

But I couldn't find a setting for that yet. Wouldn't it make sense to allow using the unstyled mode?
Or should that be done differently, e.g. unsetting the css in theme? Then we should maybe add some documentation to the styling section in the Klaro settings and the README.md?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    In 🐛 Klaro library seems way too large? Active I saw that klaro-no-css.js actually IS used already, so the left question is - should there be a way to use a styled one or do we better solve all styling in Drupal? (I'd vote for the second option and would close this then, but maybe others think different?)

  • 🇩🇪Germany jan kellermann

    We are using the JS without CSS, but loading the CSS-file separately, see klaro.libraries.yml

    Here I have linked the SCSS which we use to override klaro-styles:
    https://www.drupal.org/project/klaro/issues/3495342#comment-15912052 Stylings per used theme Active

    If you want to disable loading the klaro.min.css, you can use this code:

    /**
     * Implements hook_library_info_alter().
     */
    function mymodule_library_info_alter(&$libraries, $extension) {
      if ($extension === 'klaro') {
        unset($libraries['library']['css']);
      }
    }
    

    If more people need this function, we can add this as config item.

Production build 0.71.5 2024