Skip to content

Ensure DEFAULT is taken into account for matchVariant#9603

Merged
RobinMalfait merged 1 commit intomasterfrom
feat/handle-default-in-matchvariant
Oct 18, 2022
Merged

Ensure DEFAULT is taken into account for matchVariant#9603
RobinMalfait merged 1 commit intomasterfrom
feat/handle-default-in-matchvariant

Conversation

@RobinMalfait
Copy link
Member

This means that if you define your matchVariant as:

matchVariant('foo', (value) => '.foo-${value} &')

Then you can't use foo:underline, if you want to be able to use
foo:underline then you have to define a DEFAULT value:

matchVariant('foo', (value) => '.foo-${value} &', {
  values: {
    DEFAULT: 'bar'
  }
})

Now foo:underline will generate .foo-bar & as a selector!

This means that if you define your `matchVariant` as:

```js
matchVariant('foo', (value) => '.foo-${value} &')
```

Then you can't use `foo:underline`, if you want to be able to use
`foo:underline` then you have to define a `DEFAULT` value:

```js
matchVariant('foo', (value) => '.foo-${value} &', {
  values: {
    DEFAULT: 'bar'
  }
})
```

Now `foo:underline` will generate `.foo-bar &` as a selector!
@RobinMalfait RobinMalfait merged commit ddb9b4d into master Oct 18, 2022
@RobinMalfait RobinMalfait deleted the feat/handle-default-in-matchvariant branch October 18, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments