Skip to content

Modal component is relying too much on Javascript #458

@Atmos4

Description

@Atmos4

Currently there is a strong dependency on Javascript with the modal component, especially with animations and disabling scroll. Both can be done with pure CSS instead.

  1. Animations can be done with CSS transitions

  2. Disabling scroll can be achieved with CSS :has pseudo-class.

:has is relatively new in terms of browser support, but it seems to be used in the codebase already so it's probably not a concern.

Here is a link to the demo on CodePen.

Let me know what you think. If you like the idea, I can submit a PR.

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