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

HTMLElement.style API is Incomplete. #880

Open
zylo94 opened this issue Mar 4, 2025 · 1 comment
Open

HTMLElement.style API is Incomplete. #880

zylo94 opened this issue Mar 4, 2025 · 1 comment

Comments

@zylo94
Copy link

zylo94 commented Mar 4, 2025

The facades for dom.HTMLElement.style is missing several
CSS counterparts. Here are some I've noticed:

  • justify-content (only justifyText)
  • text-decoration-color text-decoration-line text-direction-style text-direction-thickness
    (only textDecoration which doesn't allow setting multiple decorations at once)

And in my use case I need to programmatically set these styles (not defined a .css file). I could reset the entire style.cssText = "..." file, but this would reset all other styles previously set. I could try style.cssText += "...", but this risks repeatedly appending the same style to the cssText if done in a loop without carefully checking if that style has not already been occurred.

Really, the API should just be complete, no workarounds required.

We should document all known missing style member counterparts in this issue thread with the goal of 1-to-1 completeness.

I assume implementing these missing style setters is trivial, I'm willing to contribute them myself if someone can tell me where in the codebase I need to go to do it.

@sjrd sjrd transferred this issue from scala-js/scala-js Mar 4, 2025
@sjrd
Copy link
Member

sjrd commented Mar 4, 2025

Transferred to scala-js/scala-js-dom, which is the repo that defines the scalajs-dom API.

Feel free to read https://github.com/scala-js/scala-js-dom/blob/main/CONTRIBUTING.md for information on how to contribute.

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