Skip to content

HTMLElement.style API is Incomplete. #880

Open
@zylo94

Description

@zylo94

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions