css-element-queries icon indicating copy to clipboard operation
css-element-queries copied to clipboard

Disable certain block

Open ahmadalfy opened this issue 6 years ago • 2 comments

The plugin is working perfectly thank you for the great effort. I have a problem with the :hover state of the block where I change its dimension. The performance become very sluggish and it's noticeable.

I believe the plugin tries to parse the selector:

.selector[max-width~="200"] {
  height: 200px;
}
.selector[max-width~="200"]:hover {
  height: 400px;
}

Since the class is already added to the element, is there a way to disable parsing CSS for the hover state? Luckily I am handling one case which is width less than 200 so I overcame that by using .selector[max-width="200"]:hover instead of the ~=.

Thank you again.

ahmadalfy avatar Jul 11 '18 11:07 ahmadalfy

Mh, I'm not sure what the issue here is. .selector[max-width~="200"]:hover looks to me like a perfectly fine selector.

The performance become very sluggish and it's noticeable Can you provide a jsfiddle?

is there a way to disable parsing CSS for the hover state?

What do you mean with disable? Removing it disables it, so why don't you remove the entire rule if not needed?

marcj avatar Jul 23 '18 17:07 marcj

The problem is that I am transitioning the height. During the transition the height change gradually causing the JS plugin to recalculate extensively. Is that clear?

ahmadalfy avatar Jul 25 '18 21:07 ahmadalfy