Skip to content

jpmclaughlin/pp-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

864 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pp-patterns

Forked from patternlab-php-grunt which integrates Grunt with Pattern Lab. This version completely overhauls the patterns.

Getting Started

Tech Pre-requisites

Installation

  • Fork this repo.
  • Clone the forked repo to your local machine.
  • cd into the directory of your cloned repo.
  • Run npm install -g grunt-cli to install Grunt.
  • Run npm install to install dependencies.
  • Run grunt to generate all the necessary files.
  • Run grunt dev to start watching for file changes and run a local web server on port 9001 http://localhost:9001
  • (Optional but recommended) Install LiveReload and the browser extension to see your changes applied live.

About Pattern Lab

The PHP version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the Mustache-based patterns and the JavaScript-based viewer, with a PHP-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, Pattern Lab strongly separates patterns, data, and presentation from build logic.

Demo

You can play with a demo of the front-end of Pattern Lab at demo.patternlab.io.

Getting Started

Working with Patterns

Patterns are the core element of Pattern Lab. Understanding how they work is the key to getting the most out of the system. Patterns use Mustache so please read Mustache's docs as well.

Creating & Working With Dynamic Data for a Pattern

The PHP version of Pattern Lab utilizes Mustache as the template language for patterns. In addition to allowing for the inclusion of one pattern within another it also gives pattern developers the ability to include variables. This means that attributes like image sources can be centralized in one file for easy modification across one or more patterns. The PHP version of Pattern Lab uses a JSON file, source/_data/data.json, to centralize many of these attributes.

Using Pattern Lab's Advanced Features

By default, the Pattern Lab assets can be manually generated and the Pattern Lab site manually refreshed but who wants to waste time doing that? Here are some ways that Pattern Lab can make your development workflow a little smoother:

About

Patternlab, grunt, overhauled patterns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 13