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

fix: When format the less-node, keep its context. #3726

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lumburr
Copy link
Contributor

@lumburr lumburr commented May 10, 2022

What: fix: #3314

Why: Use % () to format less node is missing parameters.

eg: %("%d", hsla(90, 100%, 50%, 0.5)); will output "hsla(89.99999999999999, 100%, 50%, 0.5)"

How:

Add parameter toCSSOptions for toCSS(). like:

const toCSSOptions = {
compress,
dumpLineNumbers: options.dumpLineNumbers,
strictUnits: Boolean(options.strictUnits),
numPrecision: 8};
if (options.sourceMap) {
sourceMapBuilder = new SourceMapBuilder(options.sourceMap);
result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);
} else {
result.css = evaldRoot.toCSS(toCSSOptions);
}

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

@matthew-dean
Copy link
Member

@iChenLei Reason for failing test?

@iChenLei
Copy link
Member

@matthew-dean Github actions logs expired, I don't know why actions failed, but noly node16-macos test suite failed, I think it's not big problem.
@lumburr Can you re-trigger the github actions ci ?

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

Successfully merging this pull request may close these issues.

Escape function with nested var failed
3 participants