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

@modular-css/svelte errors when classes get more descriptive through page #780

Closed
tanishalfelven opened this issue Aug 26, 2020 · 2 comments

Comments

@tanishalfelven
Copy link
Contributor

https://github.com/tivac/modular-css/blob/main/packages/svelte/svelte.js#L207
if you have a class that is similar to a different css class occuring after the original in markup then there is a big explosion.
Fine:

<div class="{css.someclass}"/>
<div class="{css.some}"/>

Error:

<div class="{css.some}"/>
<div class="{css.someclass}"/>
@tivac
Copy link
Owner

tivac commented Sep 3, 2020

Tried to add a test to reproduce this against main, but having trouble.

Here's the template file:

<style>
.some { color: red; }
.someclass { color: blue; }
</style>
<div class="{css.some}"></div>
<div class="{css.someclass}"></div>

Here's the regexes it creates:

/([^$]){css\.(some|someclass)}/gm

and

/(\b)css\.(some|someclass)(\b)/gm

which based on some quick testing I can't get to fail, there must be another component to this that I'm not aware of.

tanishalfelven added a commit to tanishalfelven/modular-css that referenced this issue Oct 15, 2020
When a class is undefined and also more specific than another undefined class a collision occurs. This fixes that.
tivac pushed a commit that referenced this issue Oct 15, 2020
When a class is undefined and also more specific than another undefined class a collision occurs. This fixes that.
@tivac
Copy link
Owner

tivac commented Oct 19, 2020

Fixed by 1ac9af5!

@tivac tivac closed this as completed Oct 19, 2020
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

No branches or pull requests

2 participants