Issues with Less Variable Syntax in IntelliJ IDEA
Hello Everybody,
I am experiencing issues with Less variable syntax in IntelliJ IDEA. The editor is highlighting several errors related to the use of variables in my Less files. Here are some of the errors I am encountering:
"Term expected" at line 5
"Variable expected" at line 5
"']' expected" at line 5
"Variable expected" at line 8
"']' expected" at line 8
"Term expected" at line 8
"Term expected" at line 12
"Variable expected" at line 12 …
Here is an excerpt from my Less file:
.heading {
font-family: @heading-font-family;
font-size: @fontSizes[xxxl];
margin-bottom: @spacing[4];
The errors only occuring for numbers, letters will not be error highlighted.
@import '/src/assets/css/theme.less';
//Font Sizes
@fontSizes: {
xs: 0.75rem;
s: 0.875rem;
m: 1rem;
l: 1.25rem;
xl: 1.5rem;
xxl: 1.75rem;
xxxl: 2.25rem;
};
//Spacing:
@spacing: {
1: (4 / @baseFontSize) * 1rem;
2: (8 / @baseFontSize) * 1rem;
3: (12 / @baseFontSize) * 1rem;
4: (16 / @baseFontSize) * 1rem;
I have tried various solutions, including adjusting the file types and inspections settings, searching for plugins, but the errors persist. Does anyone experienced the same issues and has some guidance for me?
Thank you for your assistance!
Best regards,
Marc
请先登录再写评论。
Thank you for contacting us!
Thank you for your help in providing all the details. We managed to reproduce the problem and have created a new ticket: https://youtrack.jetbrains.com/issue/WEB-72234. Please vote for it to get notified of any progress.
Best regards,
Lena