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) Animations highlighting incorrectly

See original GitHub issue

CSS animations highlighting incorrectly When writing CSS animations, such as:

@keyframes animation {
  10.1% {
    left: 10px;
  }
}

It highlights incorrectly.

  • animation isn’t highlighted as a variable
  • 10.1% isn’t highlighted as an hljs-number as it should be
  • .1 is highlighted as a hljs-selector-class.

Language: CSS

I used highlight

Sample Code to Reproduce

@keyframes animation {
  10.1% {
    left: 10px;
  }
}

Or any other CSS animation, really. Example JSFiddle: https://jsfiddle.net/barhatsor/oz14ewyx/2/

Expected behavior Turns out Github also higlights it incorrectly so here’s a picture of CodeMirror getting it right:

Codemirror

Would be happy if this got fixed. Thanks!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
joshgoebelcommented, Dec 23, 2020

FYI css_consistency is rebased and merged into master now.

1reaction
joshgoebelcommented, Dec 25, 2020

We’ll see if @allejo has any thoughts. I been working on the CSS consistency more and this is pretty simple once you flatten the grammar… you can just use from/to keywords at the top-level for the frame positives, easy peasy. So complexity shouldn’t stop us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to auto-animate text highlight in css? - Stack Overflow
You will need to use a pseudo element (preferably :after) and play around with the width of that pseudo element.
Read more >
Using CSS transitions - CSS: Cascading Style Sheets | MDN
CSS transitions provide a way to control animation speed when changing ... A common use of CSS is to highlight items in a...
Read more >
25 cool CSS animation effects and how to create them
CSS animations can delight, entertain and help users of a site or app. Here's how to create 25 examples with code provided.
Read more >
CSS Hover Highlight Effect Code Along - YouTube
A quick code along to learn how to replicate the CSS highlight on hover effect. Subscribe for more and get the code here ......
Read more >
An Interactive Guide to CSS Transitions - Josh W Comeau
This problem can be solved in a rather elegant way without needing to reach for JS. We can use transition-delay ! css.
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