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.

CSS tag name lowercasing

See original GitHub issue

Prettier 1.14.3 Playground link

--parser scss

Input:

Label {
	font-size: 24;
}

Output:

label {
  font-size: 24;
}

Expected behavior:

Label {
  font-size: 24;
}

I am using prettier on a NativeScript project, which uses an Xml markup with some tag names similar to html but with uppercase names (like Label and Button). CSS is largely case-insensitive, so the styles still apply properly even with the incorrect lowercase tag names output by prettier, but it sure looks inconsistent when looking at the markup and the styles together.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
alexander-akaitcommented, Sep 6, 2019

@chevallard maybe we can detect what you use css for html or for xml, do you use some declaration for this?

2reactions
chevallardcommented, Sep 5, 2019

According to the CSS spec, the document that the CSS is being applied to determines case sensitivity. The CSS file has no indication of which type of document it is being applied to. This is an issue when we are using the supported CSS/Less/Sass.

Read more comments on GitHub >

github_iconTop Results From Across the Web

text-transform - CSS: Cascading Style Sheets - MDN Web Docs
The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or ...
Read more >
Why is "lower-case with dashes" the standard for HTML classes?
It's an acceptable naming convention, to help the author from confusing between his different languages. You can name your class names in ...
Read more >
Summarized test results: Case sensitivity in selectors (CSS ...
If the name of an HTML title attribute value in a selector is uppercase and the attribute value is lowercase in the markup,...
Read more >
CSS text-transform property - W3Schools
Property Values ; capitalize, Transforms the first character of each word to uppercase, Demo ❯ ; uppercase, Transforms all characters to uppercase, Demo...
Read more >
Why does the tagName need to be in CAPS when using event ...
The older versions of HTML back when JavaScript was first created used all caps for tag names by convention instead of today's lowercase....
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