question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

customize theme build the less file error

See original GitHub issue

Version

2.13.9

Environment

browser

Reproduction link

https://github.com/ant-design/antd-init/issues/126

Steps to reproduce

origin this issue: https://github.com/ant-design/antd-init/issues/126

What is expected?

should compile without error

What is actually happening?

./src/index.less Module build failed:

  color: @text-color-secondary;
  .iconfont-size-under-12px(9px);
^

Error evaluating function unit: the first argument to unit must be a number. Have you forgotten parenthesis? …/antd/lib/cascader/style/index.less (line 94, column 6)

and less ^2.7.2 less-loader: ^4.0.5 and only with options: strictMath: true,


I thought this is a simple issue. Hope someone from antd will nicely resolve this

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

27reactions
pydlvcommented, May 26, 2021

@gustav0 @mendoncanorma I had the same issue but I think I have resolved it. If you check the Less options documentation here: https://lesscss.org/usage/ it states that the strictMath option was replaced by the math option.

Set math: 'always' in your less options for it to compile like it did in Less v3

7reactions
liamfendcommented, Jun 15, 2021

@gustav0 @mendoncanorma I had the same issue but I think I have resolved it. If you check the Less options documentation here: https://lesscss.org/usage/ it states that the strictMath option was replaced by the math option.

Set math: 'always' in your less options for it to compile like it did in Less v3

you did a great thing ~~ in Chinese is 🐂🍺 。。

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem while compile less in custom theme of magento 2
Make sure your own Less files don't have the same name as the Less files from the Luma theme!
Read more >
LESS css compile error - Stack Overflow
@theme-images-dir appears to be defined and included in another less file before this statement is reached. Any hints as to what is happening ......
Read more >
Error loading file theme.less - YOOtheme Support
Usually "Error loading file theme.less" implies that the URL is invalid, meaning the file doesn't exist in the defined location. The syntax in ......
Read more >
Theme Compilation Issue Due to missing '{' or '}' in Input Less ...
When attempting to compile a theme, an error message similar to the following occurs: Making a change to a single less file in...
Read more >
Customize Theme - Ant Design
In version 5.0, we provide a new way to customize themes. Different from the less and CSS variables of the 4.x version, with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found