Skip to content

Nested modifiers #30

Description

@jpbelo

EXPECTED BEHAVIOR

Being able to write nested modifiers to reduce duplicated code.

const MODIFIER_CONFIG = {
  asButton: () => {
    css`
      border: 1px solid grey;
      padding: 10px 20px;
      font-size: 15px;
    `,
    primary: () => {
      css`
        background-color: red;
      `
    },
    secondary: () => {
      css`
        background-color: blue;
      `
    }
  },
  asText: () => {
    css`
      font-size: 12px;
    `,
    primary: ...
    secondary: ...
  },
};

<Component modifiers="asButton.secondary" />

ACTUAL BEHAVIOR

Have to either use multiple modifiers or duplicate the shared code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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