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

Update docs on PHP Pattern States #85

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions docs/pattern-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ Any pattern that includes a pattern partial that has a lower pattern state will

## Giving Patterns a State

Giving patterns a state is simply a matter of modifying the file name. If we wanted to give our `molecules-media-block` pattern a state of `inprogress` we'd change the file name from:

source/_patterns/01-molecules/02-blocks/00-media-block.mustache

to:

source/_patterns/01-molecules/02-blocks/[email protected]

Giving patterns a state is accomplished by setting the `state` frontmatter key on any pattern’s companion `.md` file. Consider this media block pattern:

./source/_patterns/molecules/blocks/media-block.mustache

We would create or edit a file in the same location, calling it `media-block.md`:

---
state: inreview
---
The media block consists of...

## Adding Customized States

The three default states included with the PHP version of Pattern Lab might not be enough for everyone. To add customized states you should modify your own CSS files. **DO NOT** modify `states.css` in `public/styleguide/css/`. This is because `states.css` will be overwritten in future upgrades.
Expand Down