Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Playground sometimes gets confused #165

Closed
topaxi opened this issue Jun 24, 2015 · 8 comments
Closed

Playground sometimes gets confused #165

topaxi opened this issue Jun 24, 2015 · 8 comments

Comments

@topaxi
Copy link

topaxi commented Jun 24, 2015

I'm not really sure when it happens, but sometimes the playground does weird things.

All I can say, I'm deleting the initial stuff and pasting in the new css.

Here side by side comparison:
playground-bug

Tested in Firefox 41.0a1

@topaxi
Copy link
Author

topaxi commented Jun 24, 2015

In the first tab I got this console warning: Warning: The selector ':--fizzbuzz' is undefined in CSS!

But even if I repaste the same snippet, it's compiled wrong and a new warning appears, works fine in a fresh tab though...

@MoOx
Copy link
Owner

MoOx commented Jun 24, 2015

It might be related to the plugin. Maybe a memory issue. This is weird.

@topaxi
Copy link
Author

topaxi commented Jun 24, 2015

Yeah, maybe I shouldn't browse with nightlies...

I'll try to use a plain stable Firefox with a new profile for the playground for the next days and report if I can reproduce this.

@topaxi
Copy link
Author

topaxi commented Jun 26, 2015

Okay I reproduced this now with the following code:

@custom-selector :--foo .foo;

:--foo {
  color: bar;
}

After that, I type a new @custom-selector:

@custom-selector :--foo .foo;
@custom-selector :--bar .bar;

:--foo {
  color: bar;
}

If I now use :--bar it will be "undefined" and the following happens:

Input:

@custom-selector :--foo .foo;
@custom-selector :--bar .bar;

:--foo :--bar {
  color: bar;
}

Output:

.foo {
  color: bar;
}

Tested in Firefox 38 and a completely new profile (no addons etc.)
Tested in Chrome Version 43.0.2357.130 (64-bit)

@MoOx
Copy link
Owner

MoOx commented Jun 29, 2015

I cannot reproduce :/

screen shot 2015-06-29 at 06 36 36

Note: I respected the order you described

@topaxi
Copy link
Author

topaxi commented Jun 29, 2015

Mh weird, I'll try on other machines later this day. I can still reproduce this on my notebook on either Firefox or Chrome.

Note: I can't reproduce this if I copy&paste the second custom-selector, if there is some debouncing, maybe I'm typing slower than you..?

@MoOx
Copy link
Owner

MoOx commented Jun 29, 2015

Ok I totally reproduced it. It seems the module that handle custom selectors have a weird memory management.

@MoOx
Copy link
Owner

MoOx commented Jun 29, 2015

Closing since the appropriate issue is opened on the right module csstools/postcss-custom-selectors#19
It seems related to this part https://github.com/postcss/postcss-custom-selectors/blob/e020e3220644d1975b4dc7102d1acb1e0bec38a0/index.js#L21 which does not reset the list for each plugin executions

@MoOx MoOx closed this as completed Jun 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants