2

Here is my scenario. I have create new area for my theme (Not adminhtml , frontend).
Used Developer mode and no symlinks config in admin
I have create new module simple for define new area theme

etc/di.xml

<type name="Magento\Theme\Model\View\Design">
    <arguments>
        <argument name="themes" xsi:type="array">
            <item name="vendors" xsi:type="string">Vendor/vendor</item>
        </argument>
    </arguments>
</type>

Just like magento does in frontend and adminhtml
From here i have created new area vendors

Now i go to app\design create new folder vendors and put my theme in that.
My theme path will be

app\design\vendors\Vendor\vendor

But now problem happen i can't deploy less files Got issue

The contents from the "/var/www/html/pub/static/vendors/Vendor/vendor/en_US
/css/styles-m.css" file can't be read


Content of styles-m.less below

@import (reference) 'source/_extends.less';

//
//  Magento Import instructions
//  ---------------------------------------------

//@magento_import 'source/_module.less'; // Theme modules

//
//  Media queries collector
//  ---------------------------------------------

@import 'source/_responsive.less';

@media-target: 'mobile'; // Sets target device for this file

//
//  Global variables override
//  ---------------------------------------------

@import 'source/_theme.less';

//
//  Extend for minor customisation
//  ---------------------------------------------

//@magento_import 'source/_extend.less';

All files less already created and valid but not sure why magento can't read css compiled. I expect compile will success without red error warn

  • which parent theme you defined in your theme? – Sanju Nov 8 at 13:52
  • No parent defined. Just same as blank theme – mrtuvn Nov 9 at 0:45
0

first of delete the cache folder inside your var directory then navigate to pub-> static->front-end and delete all files from here.

now run the following commands if you are in default mode

php bin/magento setup:di:compile  
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

hope this will solve your problem.

  • Tried that but not work – mrtuvn Nov 8 at 9:12
  • then most probably it might be that your browser is taking old cache. just try to refresh the cache by striking SHIFT+F5. – Pramod Nov 8 at 9:36
  • Error keep should in terminal when run deploy – mrtuvn Nov 8 at 9:46
0

Seem my problem come from "Some less file with empty selector declare rule got issue with compile"
I'm feeling stupid here

Solutions: Remove empty rules (selector without do anything)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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