Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Unsupported media range queries #15

Closed
Antonio-Laguna opened this issue Sep 25, 2021 · 0 comments · Fixed by #16
Closed

Unsupported media range queries #15

Antonio-Laguna opened this issue Sep 25, 2021 · 0 comments · Fixed by #16

Comments

@Antonio-Laguna
Copy link
Member

Following the test within the library, here's a reduced test case that will spark the issue:

@media (width < env(--another-custom-width)) {
	body {
		order: 3;
	}
}

@media (width < 64em) {
	body {
		order: 4;
	}
}

Which throws as follows:

postcss-env-fn: <css input>:1:8: Unknown word
CssSyntaxError: <css input>:1:8: Unknown word
    at postcss-env-function/test/basic.css:12:1
    at Input.error (postcss-env-function/node_modules/postcss/lib/input.js:123:16)
    at ValuesParser.unknownWord (postcss-env-function/node_modules/postcss/lib/parser.js:518:22)
    at ValuesParser.unknownWord (postcss-env-function/node_modules/postcss-values-parser/lib/ValuesParser.js:195:15)
    at ValuesParser.other (postcss-env-function/node_modules/postcss-values-parser/lib/ValuesParser.js:110:10)
    at ValuesParser.parse (postcss-env-function/node_modules/postcss-values-parser/lib/ValuesParser.js:135:16)
    at Object.parse (postcss-env-function/node_modules/postcss-values-parser/lib/index.js:21:12)
    at getReplacedValue (postcss-env-function/dist/index.js:101:35)
    at AtRule (postcss-env-function/dist/index.js:240:29)
    at async LazyResult.runAsync (postcss-env-function/node_modules/postcss/lib/lazy-result.js:411:15)
    at async postcss-env-function/node_modules/postcss-tape/dist/index.js:334:18 {
  reason: 'Unknown word',
  source: '(width < env(--another-custom-width))',
  line: 1,
  column: 8,
  input: {
    line: 1,
    column: 8,
    source: '(width < env(--another-custom-width))'
  },
  postcssNode: <ref *1> AtRule {
    raws: {
      before: '\n\n',
      between: ' ',
      afterName: ' ',
      semicolon: false,
      after: '\n'
    },
    type: 'atrule',
    name: 'media',
    parent: Root {
      raws: [Object],
      type: 'root',
      nodes: [Array],
      source: [Object],
      lastEach: 1,
      indexes: [Object],
      [Symbol(isClean)]: true,
      [Symbol(my)]: true
    },
    source: { start: [Object], input: [Input], end: [Object] },
    params: '(width < env(--another-custom-width))',
    nodes: [ [Rule] ],
    proxyCache: [Circular *1],
    [Symbol(isClean)]: true,
    [Symbol(my)]: true
  },
  plugin: 'postcss-env-fn'
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant