Skip to content

plugin system #84

@souporserious

Description

@souporserious

Since you've moved away from glamor, I was curious if you would be willing to support a plugin system similar to theirs?

I do something similar to your styled-system library with glamor's plugin system right now:

const designSystemPlugins = [
  flex,
  position,
  size,
  space,
  border,
  typography,
  color,
  elevation,
  misc,
  fixVerticalRhythm,
]

designSystemPlugins.forEach(func => {
  glamor.plugins.add(({ selector, style }) => ({
    selector,
    style: func(style),
  }))
})

It would be awesome if we could do something like this with CXS, where any value I pass like cxs({ elevation: 2 }) would know how to get resolved. This would be similar to something like PostCSS where you can parse styles in one spot and not have to import them every time. I think this could also help with vendor prefixing and being able to handle this in one spot as well.

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