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

Error when using css variables without semi. #3373

Closed
honkinglin opened this issue Mar 12, 2019 · 4 comments · Fixed by #3700
Closed

Error when using css variables without semi. #3373

honkinglin opened this issue Mar 12, 2019 · 4 comments · Fixed by #3700

Comments

@honkinglin
Copy link

Hey,I found it will parse error when I import a css like this:
import './test.css'

// test.css
.test {
    --animate-margin-top: -30px;
    --animate-transform-vertical: top
}

the error detail is:

ERROR in ./src/test.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/less-loader/dist/cjs.js):
    --animate-transform-vertical: top
}

Unrecognised input. Possibly missing opening '{'
......

I know it's not a good idea to leave CSS without a semicolon at the end,but it is normal in the less@2.x version,so it kind of confused me.

@seven-phases-max
Copy link
Member

Confirmed.

@matthew-dean
Copy link
Member

This likely won't be addressed until Less 4.

@matthew-dean matthew-dean added this to the 4.0 milestone Jul 16, 2020
@matthew-dean matthew-dean modified the milestones: 4.0, 5.0 Dec 18, 2020
@raind33
Copy link

raind33 commented Mar 3, 2022

Still not good?

@moelders
Copy link

Hello,

The issue is still happening in version less@3.12.2.

As @HQ-Lin commented, it happens when you have a variable without semi colon at the end of the block.

This can be fixed by adding the semi colon if you are the owner of the code, but in case of a third-party library it is not viable.

I am using lessc file.less --clean-css="--s1 --advanced" to minify some files that later are used in other projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants