2

I'm beginer and I want to custom my theme in sample data. But i can not find the class I want to custom css on source code. You can help me to check it. For example: example

I want to custom css for class blocks-promo but I cannot check it locate in file less. Can you help me?

4 Answers 4

0

There is no style for the blocks-promo, it looks like a customised block. There are lots of way to add you css into magento. I am going to list some of them, hope that can help you.

  1. Use head default_head_blocks.xml embed your css directly, it's for every page.
  2. Insert you code into you theme less file (if you are in a module, then override _module.less).
0

Tomi, I want to create new theme to custom my page. I read the guide for create new theme. But I can't find locate file css or less have class I want to custom. I know It on vender but I can't check it. Can you help me?

0

This real time file is not in the vendor, we call all those html, css, js, images or other similar file as static files, every time you do a upgrade and deploy will copy those file from its origin to the pub\static\frontend\ModuleName\ThemeName\en_US\xxx.

So if you change the file in pub you can see the change directly.

However, next time you do upgrade and deploy will delete pub files. So you can test you change in pub files and then copy to your app folder. If you are overiding the vendor file, just copy it into the app\design\frontend\ModuleName\ThemeName\Magento_Catalog\web\css\_xxxxx.less

0

To see the class in the source files (.less) must use Grunt, of the explanation for this link, or see below

Magento2 Grunt Documentation

Install NodeJs in your pc

Use comand line:

  • Install Grunt CLI tool globally
npm install -g grunt-cli


* Install the node.js project dependency

npm install


* Remove Magento Cache

php bin/magento cache:clean


* Clean compiled files by command

grunt clean


* Run CMD command prompt with administrator privilege.

grunt exec:yourthemename
grunt less:yourthemename
grunt watch


https://drive.google.com/a/green-art.ro/file/d/0B_3mauXj4AQINXVoTXlBT2JSUjA/view?usp=sharing


If that does not work grunt watch during development or run software from Php Storm roll back the following commands:
* Remove Magento Cache

php bin/magento cache:clean


* Clean compiled files by command

grunt clean


* Run CMD command prompt with administrator privilege.

grunt exec:yourthemename
grunt less:yourthemename
grunt watch

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