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.

Reveal classes on hover on masked chars

See original GitHub issue

Hi,

I like the extension alot and it saves alot of space on the editor. Thanks for such a great extension @moalamri.

I think hovering on the masked chars revealing all the classes inside a popover can be a great feature to have. This will help us with some few extra clicks.

Moreover, conditional masking can be applied on the basis of number of classes crossing certain threshold.

This scenario won’t hurt since only 2 classes are used.

<div className="rounded p-4"></div>

But this would be great scenario of masking.

<button className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"></button>

Hope you also find these feature helpful.

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
moalamricommented, Jul 6, 2022

Hey @androizer Glad you found it useful 😃 Regarding your first suggestion, it’s already there and hovering on unfolded text, it show a popover with full text, but regarding hovering on folded text it’s impossible (The code is there also) but hovering on it won’t trigger the popover. The reason is because this is not a built-in API, it’s a hacky way I used to achieve this which goes as the following:

  • Text get matched.
  • A custom decorator is used for the matched text which set the letterspacing to -1 ch (ch = character)
  • Since letters are overlapping each other into -1 ch there’s nothing to show.
  • I used a decorator option (before) which insert text at the beginning as a “mask”.
  • I exposed the other decorator option (after) so the user can append any custom text. So, in this case there’s no text to hover 😄 it’s only possible when hovering unfolded content.

Regarding your second question, it is possible using the regex. instead of using * which indicate (0 - unlimited) you can replace it with {10,100} which indicate (10 - 100) any matched content that is less than 10 characters won’t be folded.

0reactions
moalamricommented, Jul 11, 2022

@androizer I made some fixes in the recent two updates, please be sure to have the latest version.

You are right about documentation, it lacks some extra details. I will leave it to the contributors👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display hidden css class on hover - Stack Overflow
In CSS you can do it the following way: .hint { display: none; } .field:hover .hint { display: block; }. Edit: As Karl...
Read more >
4 Ways to Animate the Color of a Text Link on Hover
While this technique does achieve the hover effect, Safari and Chrome will clip text decorations and shadows, meaning they won't be displayed.
Read more >
mask - CSS: Cascading Style Sheets - MDN Web Docs
The mask CSS shorthand property hides an element (partially or fully) by masking or clipping the image at specific points.
Read more >
CSS Hover Effects Examples 2022 - AVADA Commerce Blog
98+ Best CSS Hover Effects Examples from hundreds of the CSS Hover Effects reviews in the market (Codepen.io) as derived from Avada Commerce...
Read more >
Create a Liquid Hover Effect with GSAP & SVG | George Francis
Add a vector-based, fluid hover effect to any simple SVG path. Perfect for buttons, image masks, wobbly jelly characters, etc...
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