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 Apr 1 '16 at 13:16

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? – Claudiu Creanga Apr 1 '16 at 14:52
  • app/etc/env.php ['MAGE_MODE' => 'developer' to 'MAGE_MODE' => 'default'] – Amit Bera Apr 1 '16 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 Sep 24 '16 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 May 8 '17 at 6:15
  • It did not work for me! – Arvind07 Jun 12 '17 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/*
    rm -rf 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

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 Apr 1 '16 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 Apr 1 '16 at 7:59

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.