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.

Indent broken for css multi-line code

See original GitHub issue

When using formatting in vscode (1.30.2) with prettier-vscode (v1.8.0). And with the following setting set;

{
  "prettier.stylelintIntegration": true,
  "prettier.eslintIntegration": true
}

My css styles that are multi-line are given a wrong indent.

.styles {
  background-image:
 linear-gradient(
    30deg,
    rgba(247, 251, 254, 1) 0%,
    rgba(221, 226, 232, 1) 100%
  );
  box-shadow:
 inset 0 2px 7px 1px rgba(255, 255, 255, .5),
    inset 0 -5px 20px rgba(187, 200, 225, .35),
    0 2px 6px rgba(40, 39, 66, .14),
 0 10px 20px rgba(40, 39, 66, .06),
    76px 75px 169px -35px rgba(0, 0, 0, .4);
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
GrimLinkcommented, Apr 13, 2019

Okay found the solution to fix my problem, for the most part. But this not perfect for me as I preferred the editorconfig to handle the indentation for me. But yeah this not a mayor issue.

To fix the issue set the indentation rule. If this is not set the indentation is not used correctly used by prettier-vscode. And not corrected by stylelint with the fix flag.

The only issue that is still present, is the the second example. If I am using using a box-shadow with multiple lines this will be wrongfully indented. But if you use stylelint, this is corrected.

0reactions
github-actions[bot]commented, Apr 12, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to keep indent for second line in ordered lists via CSS?
If you have multiple-line list items, and need consistent vertical spacing, the solution is to add vertical border-spacing to the ol selector, ...
Read more >
text-indent - CSS: Cascading Style Sheets - MDN Web Docs
The text-indent CSS property sets the length of empty space (indentation) that is put before lines of text in a block.
Read more >
How to set indent the second line of paragraph using CSS
Method 2: By making the position relative to the first line, set the text-indent to -26px and padding-left value to 26px. Here in...
Read more >
When a Line Doesn't Break | CSS-Tricks
We expect a line to break when the text on that line reaches the parent box boundaries. We see this every time we...
Read more >
How can you indent multiple lines all at once? - HTML FAQ
If you prefer using [spacebar] to indent your code rather than using [tab], you can select multiple lines by holding the [alt] key...
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