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
My web application has some buttons and inputs with the same styles, but with peculiarities that make them the same. And instead of writing the css in each element and when it is necessary to change something having to practically redo the whole process in each button, we could store the value of these repetitive styles in a variable of the type ScopedCSSRules and join in the functioncss
css(rules): string {letstyles: ScopedCSSRules={};if((rulesasany).length){(rulesasScopedCSSRules[]).forEach((rule: ScopedCSSRules)=>{styles=Object.assign(styles,rule);});}else{styles=rulesasScopedCSSRules;}// The leading white space character gets removedreturndecomposeToClassNames(styles,'','').slice(1);},
I am using this code separately from otion, and in my opinion it would be a very desired feature since there are several codes that are repeated in the css style and in some cases it would be very nice to be able to overwrite some styles before generating the class.
I tried to create a pull request, but I still haven't been able to normalize the typing then getting the error:
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'ScopedCSSRules'.
No index signature with a parameter of type 'string' was found on type 'ScopedCSSRules'.ts(7053)
The text was updated successfully, but these errors were encountered:
Thank you for this submission! I left my review at #30, suggesting to join the ongoing discussion at #3, so that we can think about this deeper before experimenting with implementations. I'm closing this issue for now to focus the discourse to a single place.
Motivation
My web application has some buttons and inputs with the same styles, but with peculiarities that make them the same. And instead of writing the css in each element and when it is necessary to change something having to practically redo the whole process in each button, we could store the value of these repetitive styles in a variable of the type
ScopedCSSRules
and join in the functioncss
Basic example
Allow:
and
This example is extremely basic, but represents an override of styles that are considered a good feature.
Steps to implementation
I am using this code separately from otion, and in my opinion it would be a very desired feature since there are several codes that are repeated in the css style and in some cases it would be very nice to be able to overwrite some styles before generating the class.
I tried to create a pull request, but I still haven't been able to normalize the typing then getting the error:
The text was updated successfully, but these errors were encountered: