Skip to content

Framework agnostic sx prop? #1874

Answered by hasparus
ghost asked this question in Ideas
Jul 28, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Getting jsx pragma working with Preact should be possible, but if you're not using React-like library or you want to whip up your own sx prop @theme-ui/css should give you everything you need.

The layers of Theme UI libraries look more or less like this:

  • @theme-ui/css contains all "core logic".
  • @theme-ui/core introduces jsx function for React and a simple ThemeProvider.
    @theme-ui/theme-provideruses@theme-ui/color-modesand@mdx-js/react` to add color modes and styling MDX
  • theme-ui reexports everything you need from aforementioned libraries and @theme-ui/components for a batteries-included experience.

If you're interested in zero-runtime / low-JavaScript solutions, you should be able to use

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ghost
Comment options

@hasparus
Comment options

@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant