I am creating a custom theme. Now I added a css file, only for checkout page.

css file call by default_head_block.xml at app/design/frontent/Amit/Customtheme/Magento_Checkout/layout/

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <css src="Magento_Checkout::css/checkoutstyle.css" />

Css file checkoutstyle.css location is app/design/frontent/Amit/Customtheme/Magento_Checkout/web/css.

Now when I try to deploy that css file using php bin/magento setup:static-content:deploy

I get this error:

Compilation from source: 
variable @checkout-tooltip-icon__font-size is undefined in file /var/www/html/Amit/var/view_preprocessed/css/frontend/Magento/blank/en_US/css/source/_extends.less in _extends.less on line 1056, column 21
1054|     input {
1055|         .lib-css(margin-right, @indent__s);
1056|         width: calc(~"100% - (@{checkout-tooltip-icon__font-size} + @{indent__s} + @{indent__xs})");
1057|     }
1058| }
1059| >

Note: Current application mode: developer and system is Ubuntu.

Can any one tell me what is happen?

  • Can any one tell m why is down vote?
    – Amit Bera
    Commented Apr 1, 2016 at 13:16

4 Answers 4


Solution is deprecated: Do not Not used it. Bad idea to switch to default

It got a solution, which may not be 100% right.

  • First I change change current application mode to default from developer at app/etc/env.php ['MAGE_MODE' => 'developer' to 'MAGE_MODE' => 'default'].
  • Also,Manually by clearing the pub/static and var/view_preprocessed directories and subdirectories. except for pub/static/.htaccess
  • Then run php bin/magento setup:static-content:deploy and it successfully generate static files.
  • And change Change current application developer and run php bin/magento setup:static-content:deploy and it successfully generate static files again.

Hope this will help anyone.

  • how did you change the application back to default from developer? Commented Apr 1, 2016 at 14:52
  • app/etc/env.php ['MAGE_MODE' => 'developer' to 'MAGE_MODE' => 'default']
    – Amit Bera
    Commented Apr 1, 2016 at 14:56
  • Great solution. I did the same as Amit suggested & got working. One thing I would like to add.....that......I performed the first step developer to default then 2nd step pub/static & var/view_preprocessed then ran command deploy.....at this time error did not go off.....it was still there but then I again changed the mode to developer from default. Then again ran the deploy command & then the error solved :) Whatever it may be but Amit's solution worked for me :) Thanks Amit :)
    – KA9
    Commented Sep 24, 2016 at 13:37
  • Hi Amit, i have tried your solution, still error exists...Here is my error msg:Compilation from source: /opt/lampp/htdocs/khelkart/vendor/magento/theme-frontend-blank/web/css/email-inline.less Compilation from source: frontend/Magento/blank/en_US/css/email-inline.less Unable to get content for 'frontend/Magento/blank/en_US/css/source/lib/_lib.less' ................................................................................................. Successful: 1411 files; errors: 14 can u please help me in solving this issue
    – 3bu1
    Commented May 8, 2017 at 6:15
  • 1
    It did not work for me!
    – Arvind07
    Commented Jun 12, 2017 at 16:13

Here's how I solved this issue (still within developer mode):

  • Make a copy of your theme
  • Delete theme from server
  • Switch back to Luma within admin
  • Clean cache, remove static files and var/view_preprocessed

    rm -rf pub/static/frontend/* var/view_preprocessed
    bin/magento c:c
    bin/magento c:f
  • run deploy command

    bin/magento setup:static-content:deploy -f
  • then re-upload your theme and switch it on within admin

  • run deploy again

    bin/magento setup:static-content:deploy -f
  • It dosn't make sense but after 2 days cleaning all sort of folders and files, I followed your instructions and it work, thanks, the crazy thing is that i have exactly the same repo and db in another 5 envs and i only had the issue in one envirourment Commented May 24, 2021 at 20:39

Go to /var/www/html/Amit/var/view_preprocessed/css/frontend/Magento/blank/en_US/css/source/_extends.less in _extends.less

and on the top add @checkout-tooltip-icon__font-size: 18px;

  • are u sure about this because of view_preprocesed is create during cache/deploy
    – Amit Bera
    Commented Apr 1, 2016 at 7:55
  • You can directly add this code on blank theme. Then delete view_preprocessed. and run php bin/magento setup:static-content:deploy
    – Asish Hira
    Commented Apr 1, 2016 at 7:59

Solution worked for me after updating Magento 2.2.5 to 2.3.2:

turns out if there is something missing in the lib folder, this will never recover. In order to do so, download a fresh copy of Magento and replace the lib folder.

After replacing I got this error :

Autoload error: Library 'magento/framework' from '/var/www/html/luiz/lib/internal/Magento/Framework' has been already defined in '/var/www/html/luiz/vendor/magento/framework'

Then I have deleted the folder lib/internal/Magento from Magento root directory.

rm -rf lib/internal/Magento

rm -rf var/cache var/page_cache var/view_preprocessed pub/static/*

After all of this, I have run:

php bin/magento setup:static-content:deploy -f

please notice, if you are in developer mode it is ok, but if you are in default or production run this:

php bin/magento setup:static-content:deploy

And of course you can use the following commands:

php bin/magento setup:static-content:deploy --jobs 3

where jobs 3 -> means number of threads to use for your deploy process.

php bin/magento setup:static-content:deploy en_US de_DE--jobs 3

You can use languages inline without any troubles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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