Skip to content

Pseudo-Classes and the Theme Specification #11

Description

@pjaws

Just want to start out by saying thank you for developing this, as it's made my life much easier as a developer.

I'm wondering if there is current, undocumented functionality for pseudo-classes or if plans exist to implement this?

For example:

// theme.js
{
  buttons: {
    bg: 'blue',
    color: 'white',
    hover: {
      bg: 'white',
      color: 'blue',
    }
  }
}

Without this ability, the variants feature really loses a lot of its usefulness, since I can't entirely define variant styles inside the theme and have them "just work". Instead, I have to do something like: background: ${({ theme, variant }) => theme.buttons[variant].hoverBg} for all of my styles.

Hopefully this makes sense. I'm still figuring out how to use this theme spec and styled-system to their fullest, so let me know if I am missing something!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions