Skip to content

lrenhrda/patternlab-php

 
 

Repository files navigation

Shoptology Updated Pattern Lab

  • Uses grunt to serve website up (use 'grunt serve')
  • Handlebars templating
  • Accessible by mobile devices (just type in the computer's ip)
  • Grunt watch and BrowserSync keeps all devices in sync with changes
  • Sass / Less Processing
  • Clear excess css with uncss
  • Minify CSS, JS, SVG's and other images
  • Create responsive images or spritesheets on the fly

Getting Started

  • Clone the repo
  • Run 'npm install'
  • Run 'npm run generate' to build the patternlab demo content
  • Run 'grunt serve' to bring up the demo view
  • Edit your files and the view should update automatically on all devices!
  • Run 'grunt test' to lint, find duplicates, and get metrics on your css
  • Run 'grunt html-inspector' to lint your processed html files
  • Run 'grunt wraith' to run visual regression testing between your style guide and live site (Config your site url in tests/wraith/configs)
  • Run 'grunt build' to process images, minify, uncss, and other things
  • Enjoy!

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

Shoptology's version of Pattern Lab

Resources

License

Stars

Watchers

Forks

Packages

No packages published