I have created a custom theme in Magento 2 and I want to add
_custommixins.less in all other less files.
I have added these files in the following location.
I have created separate less files for different areas like
product-pages now when I tried to import
_custommixins.less via following code
@import '../../../Magento_Theme/web/css/source/_variables.less'; @import '../../../Magento_Theme/web/css/source/_mixins.less';
I have got following errors in
[2018-06-29 12:55:43] main.CRITICAL: File path 'magento2/app/design/frontend/Vendor/theme1/Magento_Cms/web/../../Magento_Theme/web/css/source/_variables.less' is forbidden for security reasons.  
When i try to run
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f then i found follwoing errors in cli
Compilation from source: magento2/app/design/frontend/Vendor/theme1/web/css/media.less . File path 'magento2/app/design/frontend/Vendor/default/web/../Magento_Theme/web/css/source/_custommixins.less' is forbidden for security reasons.
I am using
Koala for less compilation it successfully compiles with the
@import but when we clean the
pub/static directory or
deploy static content the CSS files are not created properly.
I have read this thread (How can I custom less file and compile less file in magento 2), but in my case the
_custommixins.less and the files which imports are in different directories like
File which imports : magento2/app/design/frontend/Vendor/theme1/Magento_Customer/web/css/source/customer_acc.less File which need to import : magento2/app/design/frontend/Vendor/theme1/Magento_Theme/web/css/source/_custommixins.less
Currently, I'm not using