You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I select a certain item, the opacity remains the same one as the one specified in the WAVES UI classes (Layer and Shape subclasses). In order to make the selector work, I need to override the element's style in the following way:
.selected {
opacity:0.5!important;
}
Is this what the devs intended to happen? Usually, including !important in CSS stylesheets is considered a bad practise...
The text was updated successfully, but these errors were encountered:
You point a real problem here that we didn't manage to solve properly. I agree that the !important in css is considered as a bad practice and surely it is. But, if we don't want to have to set it this way, our only solution would be to stop styling through JavaScript (which imo is quite handy for most of the use cases) as marking a rule as !important is the only way to override a style created with javascript (because it is set in the DOM and then has the higher priority).
Maybe a more (intellectually) satisfying solution would be to listen to your selection with events, mark your datum as selected and:
override the shape in order to create an accessor for this selected attribute and use it in its update method.
But it leads to write more JavaScript code instead of 3 lines of css (with !important). So, if you reuse this kind of shape everywhere in a large application, it could be a proper solution but probably an overhead in a small one.
I'm sorry I don't have a cleaner answer to propose for that problem, every proposal / idea would be really welcome here !
Greetings!
I'm trying to modify the style attributes using CSS when an item is selected. I have the following code:
and the CSS selector:
When I select a certain item, the opacity remains the same one as the one specified in the WAVES UI classes (Layer and Shape subclasses). In order to make the selector work, I need to override the element's style in the following way:
Is this what the devs intended to happen? Usually, including !important in CSS stylesheets is considered a bad practise...
The text was updated successfully, but these errors were encountered: