4 ms·
That’s not a very elegant solution in any front-end JS framework. Calling directly to css/element styles is generally strongly discouraged.
by Aeolun 5y ago
That’s not a very elegant solution in any front-end JS framework. Calling directly to css/element styles is generally strongly discouraged.
- runarberg 5y agoAny insight into why that is discouraged? Also I explain on a sibling thread that there is a fundamental difference between setting a custom property (like I do here) and setting a specific style value. While I do see how the latter can be problematic as there are no hints to the changed style in the CSS file, the former does not have that issue, particularly if you name the property with a hint to the dynamic nature if it.