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

wrong handling of punctuation between comma separated function calls #91

Closed
papandreou opened this issue Aug 18, 2019 · 0 comments
Closed

Comments

@papandreou
Copy link

  • Webpack Version: n/a
  • Operating System (or Browser): Ubuntu Linux 18.10
  • Node Version: 10.16.2
  • postcss-values-parser Version: 3.0.5

How Do We Reproduce?

require('postcss-values-parser').parse('local(foo),local(bar)')

Expected Behavior

Should come out as a func node followed by a punctuation node (the comma) and another func node.

Actual Behavior

Root {
  raws: { semicolon: false, after: '' },
  type: 'root',
  nodes:
   [ Func {
       raws: [Object],
       name: 'local',
       type: 'func',
       isColor: false,
       nodes: [Array],
       parent: [Circular],
       source: [Object],
       params: '(foo)' },
     Func {
       raws: [Object],
       name: ',local', // <-- that comma should have been its own token
       type: 'func',
       isColor: false,
       nodes: [Array],
       parent: [Circular],
       source: [Object],
       params: '(bar)' } ],
  source: [...]
}

I haven't done a thorough reading of the CSS syntax module spec, but I'm fairly sure that the spacing around the comma is optional. I've also seen cssnano compress font-family values to omit it between local(...) tokens like these.

papandreou added a commit to Munter/subfont that referenced this issue Sep 1, 2019
* master:
  Switch to postcss-value-parser instead
  Make a little progress with stripLocalTokens
  Convert extractReferencedCustomPropertyNames
  Add a test for extractReferencedCustomPropertyNames
  Start converting lib/stripLocalTokens.js, blocked on shellscape/postcss-values-parser#91
  WIP, carried over from assetgraph/assetgraph#989
  Update unexpected-set to ^2.0.1
  3.7.0
papandreou added a commit to Munter/subfont that referenced this issue Oct 20, 2019
* master: (35 commits)
  Fix path to the new main file
  Tidy up some tests a bit
  Also accept --canonical-root (not only --canonicalroot) and --dry-run (not only (--dryrun)
  inlineSubsets => inlineFonts to match the cli
  Exploit that yargs provides camelCased versions of --kebab-cased switches
  Test parseCommandLineOptions a bit more exhaustively
  Rearrange so the main export works as a programmatic api (instead of accepting an argv array)
  docs(readme): add Greenkeeper badge
  chore(package): update dependencies
  Update yargs and async-main-wrap
  Update assetgaph, httpception, mocha, nyc, sinon and unexpected
  Align linting config with Assetgraph
  3.7.1
  Fix broken main reference in package.json
  Switch to postcss-value-parser instead
  Make a little progress with stripLocalTokens
  Convert extractReferencedCustomPropertyNames
  Add a test for extractReferencedCustomPropertyNames
  Start converting lib/stripLocalTokens.js, blocked on shellscape/postcss-values-parser#91
  WIP, carried over from assetgraph/assetgraph#989
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants