question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Docs say syntax one way, but output is another way.

See original GitHub issue

Expected behavior:

The docs on Alternative syntax for space and comma separated values say that

export default {
  button: {
      border: ['1px solid red', '1px solid blue'],
  },
};

should compile to

.button-0-1-179 {
  border: 1px solid red, 1px solid blue;
}

Describe the bug:

But instead it is missing a comma, so the output looks like

.button-0-1-179 {
  border: 1px solid red 1px solid blue;
}

so there’s either a bug with the docs, or a bug with the lib. Which one?

Note that the docs for jss-extended Full syntax conflict with the Core JSON syntax doc.

The output for

  a: {
    border: [
      // Numbers can become default unit automatically.
      [1, 'solid', 'red'],
      [1, 'solid', 'blue']
    ]
  },

looks as expected, with a comma.

Codesandbox link:

Paste

export default {
  button: {
      border: ['1px solid red', '1px solid blue'],
  },
  a: {
    border: [
      // Numbers can become default unit automatically.
      [1, 'solid', 'red'],
      [1, 'solid', 'blue']
    ]
  },
};

into the repl.

(P.S. It would be neat if the repl updated the URL with a query so we can paste a repl URL and the visitor can see the same code, like the Babel repl).

Versions (please complete the following information):

  • see repl

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
kofcommented, Sep 7, 2018

Mb though it needs to be fixed in the docs, because for jss-expand it probably does make sense. Its just confusing that we have different output for the same syntax.

Plugins should add syntax, but not change the existing syntax in a confusing way.

0reactions
kofcommented, Sep 12, 2018

Btw. even in the core, the simple [] syntax can be used, because it needs nothing special, it will be just converted to a string by js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Apps Script - Google Developers
When your script encounters an error, an error message is displayed. The message is accompanied by a line number used for troubleshooting. There ......
Read more >
Functions, operators, and conditionals | BigQuery
This topic is a compilation of functions, operators, and conditional expressions. To learn more about how to call functions, function call rules, ...
Read more >
Workflow syntax for GitHub Actions
Example: Using a single environment name. Example: Using environment name and URL. Example: Using output as URL. jobs.<job_id>.concurrency.
Read more >
Documentation: 15: 43.3. Declarations - PostgreSQL
All variables used in a block must be declared in the declarations section ... The other way is to explicitly declare an alias,...
Read more >
NetLogo 6.3.0 User Manual: Programming Guide
In NetLogo, commands and reporters tell agents what to do. ... (Because patch variables are shared by turtles in this way, you can't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found