Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less compilation error: variable @field-date-icon--color is undefined in Magento/backend theme #4799

Closed
hostep opened this issue May 31, 2016 · 3 comments
Assignees

Comments

@hostep
Copy link
Contributor

hostep commented May 31, 2016

Steps to reproduce

  1. Install Magento 2.0.7 using composer
  2. Install a module which allows you to compile the less files using the native node.js less compiler (I'm working on such a module, but it isn't finished yet, I'm planning on releasing it as an open source module, teaser: it works over twice as fast as the php compiler)
  3. Run bin/magento setup:static-content:deploy

Expected result

  1. Every less file gets compiled correctly

Actual result

  1. Error message appears:
...

=== adminhtml -> Magento/backend -> en_US ===
........................................................................................................................................................................................................................................................................................................................................................................................................................................
Compilation from source:
adminhtml/Magento/backend/en_US/css/styles-old.less
NameError: variable @field-date-icon--color is undefined in var/view_preprocessed/css/adminhtml/Magento/backend/en_US/css/styles-old.less on line 1055, column 36:
1054                 @_icon-font-position: after,
1055                 @_icon-font-color: @field-date-icon--color
1056                 );
>

Extra info

I can see the the variable @field-date-icon--color being defined in: vendor/magento/theme-adminhtml-backend/Magento_Ui/web/css/source/_module-old.less but in the file vendor/magento/theme-adminhtml-backend/web/css/styles-old.less the import of the first file is commented out.

Other question: since those two are named *-old.less I assume they will be removed in the future, right? I can see in the Magento 2.1.0-rc1 version they still exists, is this correct?

Thanks!

@hostep
Copy link
Contributor Author

hostep commented May 31, 2016

i'm going to close this, this is a non-issue.

I was using the flag --strict-imports which only allows @import statements to be defined at the top of the less file and not somewhere in the middle or in media queries. This was the cause of the error. I now removed it and everything works perfectly fine.

Sorry for the noise!

@hostep hostep closed this as completed May 31, 2016
@sshymko
Copy link

sshymko commented Aug 10, 2016

@hostep,
How did you configure whether to pass the flag --strict-imports to the LESS compiler or not?

@hostep
Copy link
Contributor Author

hostep commented Aug 10, 2016

@sshymko: This was while writing a module to use less.js instead of less.php to improve the performance during deploys. See: https://github.com/baldwin-agency/magento2-module-less-js-compiler/blob/adf7781e4698289150f06cd8ad96707080acddeb/Css/PreProcessor/Adapter/Less/Processor.php#L141

So this had nothing to do with core Magento, was my mistake.

magento-engcom-team pushed a commit that referenced this issue Sep 19, 2019
- fixed Product Attribute Type Price Not Displaying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants