0
http://websitename.com/pub/static/frontend/organica/organica_default/en_US/css/style.css

I want to change in to this folder. I have no idea where to make css changes

/app/design/frontend/organica/organica_default/web/css

can i create a style.css in above location and remove style.css from pub and then run deploy ?

UPDATE : I changed in style.less file in

 /app/design/frontend/organica/organica_default/web/css  and then deploy , every things work.

so my problem is solved but

I have a doubt that is it necessary to make changes in style.less file. can't i create a style.css and make changes in them.

2 Answers 2

0

Yes you can add a new css for your styles:

<head>
  <css src="Vendor_Module::css/custom-style.css"/>
</head>

But it's not the best way, especially if you have many customizations to do.

5
  • this means in magento 2 using less is standard and we must make changes in less.
    – inrsaurabh
    Jun 3, 2017 at 9:55
  • how to edit .less files Jun 3, 2017 at 11:08
  • Just open the main less file under your theme directory and deploy if your in default or in production mode, new CSS will be generated and replaced in pub folder.
    – inrsaurabh
    Jun 6, 2017 at 15:38
  • Hope you have basic knowledge of less file, they are very simple just some basic rule . sitepoint.com/write-better-css-with-less you can learn some basic from here.
    – inrsaurabh
    Jun 6, 2017 at 15:44
  • Or this one verekia.com/less-css/…
    – inrsaurabh
    Jun 6, 2017 at 15:57
0

I'm making the assumption that you are using this theme here. It's most often best practice to not edit the theme file from a vendor, as there is a chance that your customizations to that theme will be lost in an update. So you are better off making a child theme that inherits from the vendor's. There is a great article here that will show you how.

As a rule (as i think you point out) you never edit anything in the pub folder, as that all gets deleted when you compile your code.

You can follow this post here to get your less files set up correctly, Magento 2 - Overriding CSS without using !important everywhere. There are a lot of good suggestions from all the posters. And when you get the time, set up grunt, it's the best way to work with styles

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.