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

Smarter CSS encapsulation with concatenated classes #1698

Closed
Rich-Harris opened this issue Aug 27, 2018 · 0 comments · Fixed by #3825
Closed

Smarter CSS encapsulation with concatenated classes #1698

Rich-Harris opened this issue Aug 27, 2018 · 0 comments · Fixed by #3825

Comments

@Rich-Harris
Copy link
Member

In a case like this...

<div class="thing {active ? 'active' : ''}">
  some stuff
</div>

<style>
  .thing {...}
  .active {...}
  .thing.active {...}

  .unused {...}
</style>

...Svelte bails out of trying to figure out which classes could apply to the div, and ends up including all the classes in the <style> block, including the unused one. It should definitely be able to figure out that only the first three could exist in the markup.

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

Successfully merging a pull request may close this issue.

2 participants