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

optimise for ternary expressions when excluding unused css #734

Merged
merged 1 commit into from
Jul 30, 2017

Conversation

Rich-Harris
Copy link
Member

Closes #696. This is a bit of a special case, but we're a compiler so we can add all the special cases we like.

In cases like this...

<button class='{{active ? "active" : "inactive"}}'>click me</button>

<style>
  .active {...}
  .inactive {...}
  .irrelevant {...}
</style>

...the irrelevant class will be recognised as unused, and discarded accordingly.

@Rich-Harris Rich-Harris merged commit 26f37c2 into master Jul 30, 2017
@Rich-Harris Rich-Harris deleted the gh-696 branch July 30, 2017 00:13
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