Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sibling variant #198

Merged
merged 1 commit into from
Nov 25, 2020
Merged

Add sibling variant #198

merged 1 commit into from
Nov 25, 2020

Conversation

ben-rogerson
Copy link
Owner

@ben-rogerson ben-rogerson commented Nov 21, 2020

This PR adds a new sibling variant discussed in #191.

You can use it to select the other siblings of the element it's added to.

tw`sibling:block`;

// ↓ ↓ ↓ ↓ ↓ ↓

({
  "~ *": {
    "display": "block"
  }
});

This is a great variant to use for styling checkboxes:

<label>
  <input
    tw="hidden checked:sibling:(bg-green-500 text-white)"
    type="checkbox"
  />
  <div tw="text-black bg-black rounded"></div>
</label>

@ben-rogerson ben-rogerson merged commit de3699a into master Nov 25, 2020
@ben-rogerson ben-rogerson deleted the feature/sibling-variant branch November 25, 2020 20:30
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