Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 2.31 KB

2022-03-28-allow-plugin-config-scss-vars.md

File metadata and controls

44 lines (37 loc) · 2.31 KB
title issue
Allow plugin configurations as scss variables
NEXT-19595

Storefront

  • Added Context as parameter for Shopware\Storefront\Theme\ThemeCompilerInterface::compileTheme. This will be mandatory in 6.5.0.
  • Added ConfigurationService and ActiveAppsLoader as parameter to Shopware\Storefront\Theme\ThemeCompiler
  • Deprecated Shopware\Storefront\Event\ThemeCompilerEnrichScssVariablesEvent use Shopware\Storefront\Theme\Event\ThemeCompilerEnrichScssVariablesEvent instead.
  • Added Shopware\Storefront\Theme\Event\ThemeCompilerEnrichScssVariablesEvent
  • Added Shopware\Storefront\Theme\Subscriber\ThemeCompilerEnrichScssVarSubscriber
  • Changed Shopware\Storefront\Theme\StorefrontPluginRegistry to hold all plugins and apps, not only the themes.
  • Deprecated Shopware\Storefront\Theme\Subscriber\PluginLifecycleSubscriber::pluginActivate use \Shopware\Storefront\Theme\Subscriber\PluginLifecycleSubscriber::pluginPostActivate instead.

Core

  • Added SystemConfigService as parameters for \Shopware\Core\System\SystemConfig\Service\ConfigurationService::__construct
  • Added new method getResolvedConfiguration to \Shopware\Core\System\SystemConfig\Service\ConfigurationService to get the configurations with the current values.

Upgrade Information

Added new plugin config field

Now you can declare a config field in your plugin config.xml to be available as scss variable. The new tag is <css> and takes the name of the scss variable as its value.

<input-field>
    <name>myPluginBackgroundcolor</name>
    <label>Backgroundcolor</label>
    <label lang="de-DE">Hintergrundfarbe</label>
    <css>my-plugin-background-color</css>
    <defaultValue>#eee</defaultValue>
</input-field>

Next Major Version Changes

Moved and changed the ThemeCompilerEnrichScssVariablesEvent

We moved the event ThemeCompilerEnrichScssVariablesEvent from \Shopware\Storefront\Event\ThemeCompilerEnrichScssVariablesEvent to \Shopware\Storefront\Theme\Event\ThemeCompilerEnrichScssVariablesEvent. Please use the new event now.

Method pluginActivate in PluginLifecycleSubscriber will be exchanged with new method pluginPostActivate

We exchanged the method pluginActivate in PluginLifecycleSubscriber and will now use the pluginPostActivate with the PluginPostActivateEvent.