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
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.
-
this means in magento 2 using less is standard and we must make changes in less.inrsaurabh– inrsaurabh2017年06月03日 09:55:13 +00:00Commented Jun 3, 2017 at 9:55
-
how to edit .less filesshivashankar m– shivashankar m2017年06月03日 11:08:23 +00:00Commented 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– inrsaurabh2017年06月06日 15:38:16 +00:00Commented 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– inrsaurabh2017年06月06日 15:44:33 +00:00Commented Jun 6, 2017 at 15:44
-
Or this one verekia.com/less-css/…inrsaurabh– inrsaurabh2017年06月06日 15:57:15 +00:00Commented Jun 6, 2017 at 15:57
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