You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,12 +148,26 @@ You can set the state of a pattern by including it in `patternlab-config.json` t
148
148
Pattern states should be lowercase and use hyphens where spaces are present.
149
149
```
150
150
"patternStates": {
151
-
"colors" : "inprogress",
152
-
"fonts" : "inreview",
153
-
"three-up" : "complete"
151
+
"atoms-colors" : "complete",
152
+
"molecules-primary-nav" : "inreview",
153
+
"organisms-header" : "inprogress"
154
154
}
155
155
```
156
156
157
+
Note that patterns inherit the lowest common denominator pattern state of their lineage.
158
+
Consider:
159
+
```
160
+
"patternStates": {
161
+
"molecules-single-comment" : "complete",
162
+
"organisms-sticky-comment" : "inreview",
163
+
"templates-article" : "complete"
164
+
}
165
+
```
166
+
In this case, two things are of note:
167
+
168
+
* templates-article will display inreview since it inherits `organisms-sticky-comment`
169
+
* pages-article will not display any pattern state, as it does not define one
170
+
157
171
##### Pattern Export
158
172
`patternlab-config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory.
console.log('Found a lower common denominator pattern state: '+pattern.patternState+' on '+pattern.key+'. Setting reverse lineage pattern '+lineageRPattern.key+' from '+lineageRPattern.patternState);
0 commit comments