1

Hi i can try to add style to widget in the usual way. like here https://webkul.com/blog/magento2-how-to-add-css-and-js-file-in-module/

its not working.

How can i add to css file to widget?

4
  • try to deploy your static content
    – Ghulam.M
    Commented Mar 28, 2019 at 9:14
  • i did it. its not helpd Commented Mar 28, 2019 at 9:28
  • I think you can't specifically add it on a widget but you can add it on a head block in frontend in general
    – fmsthird
    Commented Mar 28, 2019 at 10:09
  • share your code here
    – Ghulam.M
    Commented Mar 28, 2019 at 11:06

1 Answer 1

0

Within your custom widget module create the following file:

view/frontend/web/css/source/_extend.less

Add the following code to _extend.less:

@import 'widget/example.less';

Create your .less file here:

view/frontend/web/css/source/widget/example.less

Your Answer

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

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