1

I've one composer module which has CSS stored in view/base/web/css/style.css

How can I override this file so that I can modify it.

I tried copying that file to my custom theme as below,

app/design/frontend/Vendor/Theme/ChildTheme/Vendor_Module/web/css/style.css

But this doesn't work for me. Any ideas ?

UPDATE

Actually thing is CSS is responsible for styling order PDF so I think it will not work by putting it at frontend theme. I'm not sure but I've to make admintheme and then override into it

3 Answers 3

0

You can add this CSS File as:

app/design/frontend/VendorName/ChildTheme/Vendor_Module/web/css/style.css

Hope this will Help!!

0

You are in the right path!

After copying the file in app/design/frontend/Vendor/Theme/ChildTheme/Vendor_Module/web/css/style.css

You need to know which deploy environment your in, so execute this CLI command in Magento Root directory php bin/magento deploy:mode:show

If you are in developer mode go to

back office => system => cache management

, click on button Flush JavaScript/CSS Cache and clear cache.

If you are in default or production mode generate the static content using the CLI command bin/magento setup:static-content:deploy {local you are testing with default is en_US}

Happy coding

1
  • 1
    Haha, Thanks for more clarifications but I did all but still doesnt work for me. Actually thing is CSS is responsible for styling order PDF so I think it will not work by putting it at frontend theme. I'm not sure but I've to make admintheme and then override into it.
    – anonymous
    Sep 27, 2019 at 8:31
0

everyone here is missing that the original css files were in the view/base/web/css folder, and not the view/frontend/web/css folder.

The way to extend anything outside the /frontend/ folder is unfortunately to make a custom module extending the original, as your app/design/frontend/Vendor/Theme/ChildTheme/Vendor_Module theme folder can only extend things in the /view/frontend space, which is why when you're extending them, you remove that from the path within your custom theme folder

making an adminhtml theme won't help much either as it's under the same restrictions but for the view/adminhtml space

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.