Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 7e0c264

Browse files
committed
Updated pattern-states page
This is part of pattern-lab/patternlab-node#70 for version 1.0.0 release prep
1 parent 6c004eb commit 7e0c264

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

patternlabsite/docs/pattern-states.md

+63
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22
layout: docs
33
title: Using Pattern States | Pattern Lab
44
heading: Using Pattern States
5+
languages:
6+
- language: php
7+
- language: node
58
---
69

10+
<!--- start php -->
11+
12+
<div class="tab-panel" id="php">
13+
<h2 class="language-title">php</h2>
14+
15+
{% capture m %}
16+
717
**Note:** *Pattern states were introduced in v0.7.5 of the PHP version of Pattern Lab.*
818

919

@@ -40,3 +50,56 @@ You can use the following as your CSS template for new pattern states:
4050
}
4151

4252
Then add `@newpatternstate` to your patterns to have the new look show up. If you want to add it to the cascade of the default patterns you can modify your `config.ini`. Simply add your new pattern state to the `patternStates` list.
53+
54+
{% endcapture %}
55+
{{ m | markdownify }}
56+
57+
</div>
58+
59+
<!--- end php -->
60+
61+
<!--- start node -->
62+
63+
<div class="tab-panel" id="node">
64+
<h2 class="language-title">node</h2>
65+
66+
{% capture m %}
67+
68+
**Note:** *Rudimentary support for pattern states was introduced in v0.1.3 of the Node version of Pattern Lab. Pattern states do not inherit the lowest state from any partials yet.*
69+
70+
Pattern states provide your team and your client a simple visual of the current state of patterns in Pattern Lab. Pattern states can track progress of a pattern from development, through client review, to completion or they can be used to give certain patterns specific classes.
71+
72+
## The Default Pattern States
73+
74+
The Node version of Pattern Lab comes with the following default pattern states:
75+
76+
* **inprogress**: pattern is in development or being worked upon. a red dot.
77+
* **inreview**: pattern is ready for a client to look at and comment upon. a yellow dot.
78+
* **complete**: pattern is ready to be moved to production. a green dot.
79+
80+
## Giving Patterns a State
81+
82+
In the Node version of Pattern Lab, pattern states are managed centrally from inside `config.json`. Adding the [pattern-type]-[pattern-name] name as the key, followed by the class name will apply the pattern state:
83+
84+
```
85+
"patternStates": {
86+
"homepage-emergency" : "inprogress"
87+
},
88+
```
89+
90+
## Adding Customized States
91+
92+
The three default states included with the Node version of Pattern Lab might not be enough for everyone. To add customized states you should modify your own CSS files. **DO NOT** modify pattern states in `public/styleguide/css/styleguide.css`. You cannot be assured these files won't be overwritten.
93+
94+
You can use the following as your CSS template for new pattern states:
95+
96+
.newpatternstate:before {
97+
color: #B10DC9 !important;
98+
}
99+
100+
{% endcapture %}
101+
{{ m | markdownify }}
102+
103+
</div>
104+
105+
<!--- end node -->

0 commit comments

Comments
 (0)