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.

Tokenizing fails when font property line height value is set from custom property

See original GitHub issue

Tokenizer fails to tokenize font property correctly if line-height is using a custom property. Example of CSS that is not tokenized correctly:

html { font: 1em/var(--line-height); }

Tokenizer seems to think that 1em/var is a function.

I created a failing test for this here: https://github.com/lauriii/postcss/commit/87085589fa6ed303f0f2052f424214a54a804b72

This trickles down to https://github.com/shellscape/postcss-values-parser. I also created a failing test for that https://github.com/lauriii/postcss-values-parser/commit/d0bbbbcae47afee98f2d367e3fd0e525d0480cfe.

This finally trickles down to https://github.com/postcss/postcss-custom-properties. I did also create a failing test for that: https://github.com/lauriii/postcss-custom-properties/commit/6de537ec9c25c87f3f5b41be0dd0f353a9f83e28.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shellscapecommented, Oct 8, 2019

@ai no worries, I don’t believe the issue is in PostCSS’s tokenizer 😄

The tokenizer in postcss-values-parser was always very difficult for me to maintain before I started leveraging PostCSS tokenizer - but please let me specify by saying that it was only difficult for me personally. I would never say that it would be 1000x worse for anyone else 👍

0reactions
aicommented, Oct 8, 2019

It’s actually quite an efficient and reliable method and makes maintenance 1000x easier.

I am supporting the tokenizer in potscss-scss. It is not 1000x worse (check out special patch comments in SCSS tokenizer).

If you can’t send non-breaking changes PR, I can accept it.

I understand that you want “ready for everything tokenizer”, but I just don’t believe that it is possible to create it (and I can change my mind if you will show me some).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why isn't the CSS property 'line-height' letting me make tight ...
Show activity on this post. line-height is relative to font-size, you can't go any lower than that unless you declare negative margin. False,...
Read more >
line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >
Proposed Line height in style attributes is not !important - W3C
This rule checks that the style attribute is not used to prevent adjusting line-height by using !important , except if it's at least...
Read more >
How to Tame Line Height in CSS
We will need some content, so let's an create an <h1> tag with some text and set the line-height to something obnoxiously huge,...
Read more >
Deep dive CSS: font metrics, line-height and vertical-align
Explores line-height and vertical-align properties, as well as the font metrics. Understand how text is rendered on screen, and how to control it...
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