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

The styleModifier variabile keeps previous values #444

Closed
dharmastyle opened this issue Aug 22, 2016 · 6 comments
Closed

The styleModifier variabile keeps previous values #444

dharmastyle opened this issue Aug 22, 2016 · 6 comments

Comments

@dharmastyle
Copy link

I am using Pattern Lab Node v2.3.0 on Mac, with Node v6.2.2, using the Gulp Edition.

Expected Behavior

When looking at a single pattern, the styleModifier should be empty (or ignored).

Actual Behavior

When styleModifier is used in a page to modify an included pattern, the single pattern inherits that styleModifier instead of being clean.

Steps to Reproduce
  1. create a pattern #1 with a styleModifier
  2. include it in a new pattern #2 and set a styleModifier for the #1 pattern
  3. compile
  4. browse to the single pattern #1
  5. it will have the styleModifier set in #2 instead of being clean
@bmuenzenmeyer bmuenzenmeyer self-assigned this Aug 25, 2016
@bmuenzenmeyer bmuenzenmeyer added this to the 2.5.0 milestone Aug 25, 2016
@bmuenzenmeyer
Copy link
Member

I've uploaded my test case which shows this functionality working as designed.
Please tell me if I have you reproduction wrong, or (better) supply your own.
_patterns.zip

image

@gfnool
Copy link

gfnool commented Aug 30, 2016

Hi,

@bmuenzenmeyer, to see the bug in action you should put the modified pattern as the last of the patterns that use that particular include.

I'm having the same problem and to see the bug in action I created these patterns:

01-button.mustache
<div class="button {{styleModifier}}">Button</div>

02-include-mod.mustache
<p>This is a pattern with a modified pattern included</p> {{> atoms-button:button--mod}}

But then, if you add a third pattern without modification the bug disappears

03-include.mustache
<p>This is a pattern with a pattern included</p> {{> atoms-button}}

In your example you should put the modified button in "Zzanother" to see the bug.

BUG

schermata 2016-08-30 alle 09 42 31

NO BUG

schermata 2016-08-30 alle 09 44 53

@maddesigns
Copy link

I can confirm this bug - mods going down to atoms.

@bmuenzenmeyer
Copy link
Member

@gfnool thanks for the additional steps - I've reproduced now. Should be easy enough to catch with a unit test and then fix.

@bmuenzenmeyer
Copy link
Member

I've pushed this to dev with a unit test, a fix, and confirmed fix against our test patterns.

You can update your package.json to patternlab-node#dev and run npm update to confirm the fix.

If I get some positive vibes from you all, I will start version build.

@bmuenzenmeyer bmuenzenmeyer removed their assignment Aug 31, 2016
@gfnool
Copy link

gfnool commented Aug 31, 2016

I confirm the fix, using #dev 2.5.0.
Thanks!

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

No branches or pull requests

4 participants