Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Fork of the D.O. project of the same name to make PHP 8 compatible.

Notifications You must be signed in to change notification settings

mobomo/configurable_theme_libraries

Repository files navigation

CONFIGURABLE THEME LIBRARIES

Thanks for taking the time to check this readme!

INTRODUCTION

This module provides a neat solution to define configurable theme libraries in your THEME.info.yml file. These libraries can be enabled or disabled for a given theme.

REQUIREMENTS

This module has no hard dependencies.

CONFIGURATION

But, to make it work for your theme there are a few steps you should take:

  • Define at least one configurable library in your THEME.info.yml. Defining them is done by using the configurable-libraries key. This module scans the active theme for these to register them.

Each configurable library can contain their own library definitions as normally used in the THEME.info.yml. This consists of:

  • libraries
  • libraries-extend
  • libraries-override

An example definition looks like:

configurable-libraries:
  global-styling-green:
    name: Global Styling (Green)
    libraries:
      - my_theme/global-styling-green
    libraries-override:
      - my_theme/global-styling: false
  global-styling-blue:
    name: Global Styling (Blue)
    description: This makes the site blue.
    libraries:
      - my_theme/global-styling-blue
    libraries-override:
      - my_theme/global-styling: false
  • Configure which libraries will be used at /admin/appearance/settings/YOUR_THEME

INSTALLATION

Install this module as any other Drupal module, see the documentation on Drupal.org.

THANKS TO

About

Fork of the D.O. project of the same name to make PHP 8 compatible.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages