0
votes

I'm trying to override the file:

web/bundles/syliusweb/css/backend.css

Every tutorial I see on theming or overriding shows how to do this for src bundles, for example located in: src/bundles/bundleHere/css/fileHere.css

So far, I've got a theme folder for my theme within app/themes. I've imported a new yml config file for my theme, which reads:

sylius_theme:
    sources:
        filesystem: ~

I have a composer.json within my theme, which reads:

{
    "name": "vendor/my-theme",
    "type": "sylius-theme",
    "description": "My custom theme.",
    "extra": {
        "my-theme": {
            "description": "My custom theme."
        }
    }
}

This was enough to get the theme to show up on the 'theme' dropdown in the 'channels' section of the admin panel. I selected my theme, so I assume it's being used.

I've tried overriding web/bundles/syliusweb/css/backend.css, but am having trouble doing it. My changes simply aren't showing, even after dumping assetic. I've also tried clearing the server-side cache. Here are the two locations I've tried for my override:

.
└── MyTheme
    ├── composer.json
    └── public
        └── css
            └── backend.css

.
└── MyTheme
    ├── composer.json
    └── public
        └── SyliusWeb
            └── css
                └── backend.css

I'm not sure how to reference the web bundles, or if there's another step that I'm missing even though I saw and activated my theme. I tried to follow the documentation on theming, but only src bundles were referenced, and some of the instructions didn't have enough information to verify I'd followed them correctly.

UPDATE

I've realized that the same css file also exists where I normally find (and have been able to override) bundle files: src/Sylius/Bundle/WebBundle/Resources/public/css/backend.css

I've tried overriding this the same way I normally would:

.
└── MyTheme
    └── SyliusWebBundle
        └── public
            └── css
                └── backend.css

I've cleared the cache and dumped Assetic after this, but it also hasn't worked, and I don't see my changes being applied.   

1
One possibility, as I don't see any Assetic references to web/bundles, only to assets/compiled (which is where I see them end up when I dump Assetic) may be that either these assets are compiled by something entirely separate from Assetic that I'm not able to find. I think this is unlikely, but possible. The alternative could be that the web/bundles folder (as it's nothing but assets, and specifically assets which seem to exist elsewhere already) is really just meant for this purpose already, user overrides. If this is true, I'm not sure how you could separate themes, but it might be possible.carbide20
Have you been able to solve this? I'm having the same problem overriding assets in themes.Linas

1 Answers

0
votes

php bin/console sylius:theme:assets:install