Issue #1843✓ SolvedOpened February 28, 2019by coder-strange3 reactions

Class on different states are not being applied to those states.

Quick answerby NicoEngler2

I have just checked and can confirm that it also works in your example. First add a class to your component, e.g. .text-blue-on-hoverNext, select the state you want to modify, e.g. hoverNow for instance change the color of the text to blue Result: Every time you hover over your component, the text is turned blue. Side...

Read full answer below ↓

Question

I'm trying to apply a class on hover of a component and the class is being applied but not on hover, it applies with normal state. image

Please let me know if I'm looking into right feature or I misunderstood the feature.

PLNKR : https://plnkr.co/edit/Est6AnnGInBa3yvhzCvm?p=preview

I don't see anything in CSS or HTML itself that state that a particular class should be applied on hover or other states.

Please Help!

Thanks, Taufeek

Answers (3)

👍 Most helpfulNicoEnglerFebruary 28, 2019

I have just checked and can confirm that it also works in your example. First add a class to your component, e.g. .text-blue-on-hoverNext, select the state you want to modify, e.g. hoverNow for instance change the color of the text to blue Result: Every time you hover over your component, the text...

coder-strangeFebruary 28, 2019

Now I get that, it works perfectly fine, I just didn't know that how it works.

Thanks @NicoEngler for you this fast reply and clearing me out :)

NicoEnglerFebruary 28, 2019

The class is applied regardless of the components state. Based on that, you can select a state, e.g. hover and style your class in that particular state. Effectively the following css will be created if you select the state hover and color your text red. I hope that clears up the confusion.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.