Skip to content
This repository has been 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 opened this issue Mar 25, 2016 · 0 comments
Open

Comments

@nathansobo
Copy link
Contributor

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.

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

No branches or pull requests

1 participant