Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSSStyleSheet.insertRule returning undefined if index argument not provided #257

Open
paul-go opened this issue Jan 12, 2024 · 3 comments
Open

Comments

@paul-go
Copy link

paul-go commented Jan 12, 2024

Suggested fix:

CSSStyleSheet.js:39

CSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index = this.cssRules.length) {
@WebReflection
Copy link
Owner

PR? code is in the esm folder, thanks!

@paul-go
Copy link
Author

paul-go commented Jan 15, 2024

Looks like I was a little too quick on the report. CSSStyleSheet.js is a file in cssom, which is unmaintained. I could submit a PR over there, but I doubt that will be fruitful. How does your project deal with these situations? Are you willing to run off a forked version of the dependency? Or should I monkey-patch CSSOM.CSSStyleSheet.prototype from within LinkeDOM? (ugh)

@WebReflection
Copy link
Owner

To be honest I don't personally have use cases around CSS API ... for SSR that's not common (but for SSR only I am also moving to uhtml/dom) but time-wise I have no idea and I haven't asked myself that question. If there is a CSSOM alternative (usually when one is dead another one comes up?) I would rather consider that alternative and call it a day ... otherwise monkey patching always worked in the JS world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants