Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Idea: Replace hand-rolled selector matching with CSS Custom Properties #119

Open
@nathansobo

Description

@nathansobo

We could bind keystrokes to commands via CSS custom properties associated with selectors. We currently do this anyway on a conceptual level but are forced to match selectors manually. Using custom properties might make it faster to match bindings and would probably make troubleshooting bindings much easier due to dev-tools support.

If anyone that's seriously interested in trying this please let me know and I can provide guidance. This relies on upgrading Atom to Electron 0.37.0 which is incomplete at the time of this writing, but will certainly happen. You can test this library in isolation to experiment with the idea.

Example:

body {
  --atom-binding--ctrl-x_ctrl-s: 'core:save'
}

Then in JS we could just read the computed style when dispatching keyboard events instead of matching selectors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions