Skip to content

[Question] How to inherit parent style? #122

Description

@horstleung

Let's say we have a Text component and a Card component

<Card>
     <Text variant="body"/> 
<Card />

The body variant has a color: 'black' style.

What is the restyle way to do if we want to have a inverted card variant?

<Card variant="inverted">
     <Text variant="body"/> 
<Card />


// theme
cardVariants: {
    defaults: {
      backgroundColor: 'cardPrimaryBackground',
    },
    inverted: {
      backgroundColor: 'mainForeground',
      color: 'white' // <-- how to make the children text follow this color?
    }
  },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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