eZ Platform Discussions

Inject scss in admin


#1

Bonjour,

https://doc.ezplatform.com/en/2.3/guide/extending_ez_platform/#further-extensibility-using-components

I followed this part of the doc to inject a css style sheet into the admin.
It works very well.

Only this is… I need to inject scss depending on the siteaccess…

    my.components.my_link_component:
       parent: EzSystems\EzPlatformAdminUi\Component\LinkComponent
       arguments:
           #$href: '/bundles/my/css/admin.css' # OK
           $href: '/bundles/my/scss/sites/admin1/style.scss' # KO
       tags:
           - { name: ezplatform.admin_ui.component, group: 'stylesheet-head' }

In the front. To include the scss style I do this:

{% stylesheets filter="scssphp, cssrewrite" output="css/site_edb.css"
    "bundles/my/scss/sites/site1/style.scss" %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
  • How to include style from a scss file?
  • How to include siteaccess dynamically in the $href patameter?