I want to add the custom.less file in my custom theme which i want to develop from scratch.
so, anyone have an idea then please share with me.
Let’s assume that you have created custom theme. Now, Create your custom less file and add your less code inside that file.
app/design/frontend/VendorName/ThemeName/web/css/source/_custom.less
After that you need to import this _custom.less file
app/design/frontend/VendorName/ThemeName/web/css/source/_sources.less
@import '_custom.less';
You need to import your _custom.less file using this above line. Just add that line inside _sources.less file. If this _sources.less file not exist in your custom theme then, you need to copy file from vendor/magento/theme-frontend-blank/web/css/source/_sources.less file in your theme.
Now, just need to deploy and clean cache.
php bin/magento s:up
php bin/magento s:s:d -f
php bin/magento c:c