SlideShare a Scribd company logo
Design Systems, Pattern
Libraries & WordPress
Jesse James Arnold and Grant Kinney from Exygy
Design Systems, Pattern Libraries & WordPress
Change is Constant
New challenges require new tools
Responsive Design
Stay flexible.
Our canvas is unknown
We don’t know what the target resolution and screen size are.
We’re not designing pages, we’re
designing systems of components.
Stephen Hay
Components
Each component of an interface needs to be considered independently and then brought together to
form any number of layouts.
Micro Layouts
Each unique section of the page had its own rules based content and device context.
Context Free
Components should be able to adapt to any number of layouts and screen sizes.
We like our components to be fluid by default, allowing the
container to define the width as much as possible.
Interface Inventory
Be more modular
The answer has always been to break your interface into smaller pieces.
header
image
body
block
Building blocks
Object oriented ideas
- Avoid unnecessarily
duplicating styles
- Encourages code reuse
- Easier to track down and
modify the common styles
- Smaller file sizes increase
performance
header
image
body
block
https://www.smashingmagazine.com/2011/12/an-introduction-to-object-oriented-css-oocss/
Atomic Design
Design Systems, Pattern Libraries & WordPress
Design Pattern
A design pattern is an element of an interface that can solve a specific
design problem and repeats across the product in various contexts with a
variety of content.
Benefits
Visual consistency for users impacts user
experience.
Speeds up workflow between design and
engineering.
Creates a shared language that connects
the whole team.
Buttons
Examples
Easy wins for any team getting
started:
Color palette
Font stack
Icon library
No more design handoff
Design is a work in progress, it is never handed off to be built.
<html>
<body>
<h1>My Website is Done</h1>
</body>
</html>
Pattern Library
A place to put all of this stuff.
Team Goals
Should provide the following team benefits:
1. Allows designers to contribute.
2. Allows product owners to qa and review design in browser.
3. Provides documentation for engineers.
Pattern Library: Fabricator
Fabricator: Taxonomy
└── materials
└── components
└── structures
or
└── materials
└── atoms
└── molecules
└── organism
Fabricator: Documentation
---
notes: |
These are notes written in `markdown`
---
<div class="component">My Component</div>
Fabricator: Data
links:
About Us:
- About Us
- Careers
- Media Center
- Legal
{{#each home.links}}
{{#each this}}
<a
href="#">{{this}}</a>
{{/each}}
{{/each}}
<a href="#">About Us</a>
<a href="#">Careers</a>
<a href="#">Media Center</a>
<a href="#">Legal</a>
SF Dahlia Pattern Library
Pattern Library: Fabricator
Pros:
Allows you to create your own materials logic.
Self documenting HTML components.
Navigation automatically generated.
Can feed it real data to test each component.
Pattern Library: Growing Pains
Scaffolding new features may introduce redundancy or code bloat.
Product wants to share core components of one product pattern library with
other product teams.
Visual design updates may share common elements with a feature in
development and cause disruption.
While importing CSS and JS from pattern library is easy, importing HTML
templates is still copy and paste.
Current Workflow
Design
Pattern
Library
CSS
Engineering WebApp
Extra Work and Quickly
Falls Out of Sync
Reproduce
Markup
Plugin that ports fabricator
functionality to work within a custom
WordPress theme.
Pattern library and application share
the same templates.
https://github.com/Exygy/wp-pattern-library
(this could easily be done with other platforms: AngularJS,
React, Ruby on Rails, Django, Laravel, etc)
New strategy: wp-pattern-library
Better Workflow
Design
Pattern
Library
Engineering WebApp
Markup
Templating
wp-pattern-library: directory structure
wp-content/themes/custom-theme/
pattern-library
- materials
- atoms
- buttons
- button.php
- button-icon.php
- button-sizes.php
- lists
- list-unordered.php
- list-ordered.php
- forms
- checkbox.php
- input-text.php
- radio.php
- paragraph.php
- molecules
- nav-menu.php
- tabs.php
- topbar.php
- organisms
- media-grid.php
- story-grid.php
- tile-grid.php
wp-pattern-library: Atoms
text: Submit
classes: hollow
---
<button class="button <?= esc_attr( $classes ) ?>"><?= $text ?></button>
button.php
<a class="primay button" href="#">So Primary</a>
<a class="hollow button" href="#">So Hollow</a>
<a class="secondary button" href="#">So Secondary</a>
<a class="secondary hollow button" href="#">So Hollow</a>
---
text: Submit
classes: hollow
---
<button class="button <?= esc_attr( $classes ) ?>"><?= $text ?></button>
button-colors.php
wp-pattern-library: Molecules
topbar.php
<div data-sticky-container>
<div
class="top-bar<?php if (is_not_pl()) : ?> data-sticky<?php endif ?>”
data-options="marginTop:0; stickyOn: small;"
style="width:100%"
>
<div class="top-bar-title">
<button class="top-bar-menu-icon" type="button" data-toggle="page">
<?php get_icon('menu') ?>
</button>
<div class="top-bar-name">
<span class="top-bar-name-content">
Custom Theme
</span>
</div>
</div>
...
wp-pattern-library: Molecules
block-columns.php---
title: Basic Content
text: This basic content makes an interesting point!
category: Component
image_src: http://placehold.it/768x350
url: #
---
<div class="block-columns">
<a class="block-columns-link" href="<?= esc_url( $url ) ?>">
<div class="block-column">
<div class="block-column-content">
<header class="block-column-header">
<span class="block-column-category"><?= $category ?></span>
<h3 class="block-column-title"><?= $title ?></h3>
</header>
<p class="block-column-text"><?= $text ?></p>
</div>
</div>
<div class="block-column">
<figure class="block-column-figure">
<img src="<?= esc_attr( $image_src ) ?>">
...
wp-pattern-library: Organisms
block-column-list.php
<section class="block-columns-list">
<?php get_pattern('molecule', 'block-columns') ?>
<?php get_pattern('molecule', 'block-columns') ?>
<?php get_pattern('molecule', 'block-columns') ?>
</section>
wp-pattern-library: Code Reuse
Call patterns from within
WordPress templates:
example post loop
<?php while ( have_posts() ) : the_post(); ?>
<div class="block" data-equalizer-watch>
<a class="block-link" href="<?php the_permalink() ?>">
<figure class="block-figure">
<img src="<?= esc_url( get_the_post_thumbnail_url( null, 'component-thumb' ) ) ?>">
</figure>
<div class="block-content">
<h3 class="block-title <?= esc_attr( Harmony::has_item_been_updated( get_the_ID() ) ?
'is-recent' : '' ) ?>">
<?php the_title() ?>
</h3>
<p class="block-text">
<?= wp_trim_words( get_field('description'), 18, '...' ) ?>
</p>
</div>
</a>
</div>
<?php endwhile; ?>
<?php while ( have_posts() ) : the_post();
get_pattern('molecule', 'block', [
'title' => get_the_title(),
'text' => wp_trim_words( get_field('description'), 18, '...' ),
'image' => get_the_post_thumbnail_url(null, 'component-thumb'),
'link' => get_permalink(),
'classes' => Harmony::has_item_been_updated(get_the_ID()) ? 'is-recent'
: '',
'attrs' => 'data-equalizer-watch'
]);
endwhile; ?>
before
after
wp-pattern-library: Code Reuse
Single source of truth for html
markup.
● Map WordPress data to pattern
variables (title, text, etc)
● All markup updates made from
molecules/block.php
● Application and pattern library
are always up to date
<?php while ( have_posts() ) : the_post();
get_pattern('molecule', 'block', [
'title' => get_the_title(),
'text' => wp_trim_words( get_field('description'), 18, '...' ),
'image' => get_the_post_thumbnail_url(null, 'component-thumb'),
'link' => get_permalink(),
'classes' => Harmony::has_item_been_updated(get_the_ID()) ? 'is-recent'
: '',
'attrs' => 'data-equalizer-watch'
]);
endwhile; ?>
Pattern Library: Resources
Fabricator
http://fbrctr.github.io/
Starter Kit with Fabricator and Foundation 6
https://github.com/exygy-design/exygy-patterns-f6
Living Example
https://sf-dahlia-pattern-library.herokuapp.com/
WordPress Plugin
https://github.com/Exygy/wp-pattern-library

More Related Content

PDF
Pattern Library in WordPress projects
Karlis Upitis
 
PDF
Style Guides, Pattern Libraries, Design Systems and other amenities.
Cristiano Rastelli
 
PDF
Front-end Pattern Libraries
PebbleRoad
 
PDF
Front End Best Practices
Holger Bartel
 
PDF
Front-End Frameworks: a quick overview
Diacode
 
PDF
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Rachel Cherry
 
PDF
Web Design Primer Sample - HTML CSS JS
Bootstrap Creative
 
PPTX
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
David Wesst
 
Pattern Library in WordPress projects
Karlis Upitis
 
Style Guides, Pattern Libraries, Design Systems and other amenities.
Cristiano Rastelli
 
Front-end Pattern Libraries
PebbleRoad
 
Front End Best Practices
Holger Bartel
 
Front-End Frameworks: a quick overview
Diacode
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Rachel Cherry
 
Web Design Primer Sample - HTML CSS JS
Bootstrap Creative
 
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
David Wesst
 

What's hot (20)

PDF
DrupalCon Austin 2014 Implement Foundation or Other Front-End Frameworks in Y...
James Moughon
 
PPTX
Theme development essentials columbus oh word camp 2012
Joe Querin
 
PPTX
Обзор Material Design Light (MDL). Александр Кашеверов.
DataArt
 
PPTX
Doing More with LESS for CSS
Todd Anglin
 
PDF
Component Driven Design and Development
Cristina Chumillas
 
PDF
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
Yandex
 
PDF
Slides bootstrap-4
Michael Posso
 
PDF
Bootstrap 3 Basic - Bangkok WordPress Meetup
Woratana Perth Ngarmtrakulchol
 
PDF
Practical tipsmakemobilefaster oscon2016
Doris Chen
 
PDF
HTML5: The Parts You Care About - 4/Nov/13 - PrDC Saskatoon, SK
David Wesst
 
PPT
WordPress Theme Design - Rich Media Institute Workshop
Brendan Sera-Shriar
 
PDF
Understand front end developer
Hsuan Fu Lien
 
PPTX
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
David Wesst
 
PPTX
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
PDF
Using Core Themes in Drupal 8
Suzanne Dergacheva
 
KEY
Why You Need a Front End Developer
Mike Wilcox
 
PDF
WordPress Theme Structure
keithdevon
 
KEY
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
Kathryn Presner
 
PDF
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
Jer Clarke
 
PDF
A Beginner's Guide to WordPress - WordCamp New York City 2012
Kathryn Presner
 
DrupalCon Austin 2014 Implement Foundation or Other Front-End Frameworks in Y...
James Moughon
 
Theme development essentials columbus oh word camp 2012
Joe Querin
 
Обзор Material Design Light (MDL). Александр Кашеверов.
DataArt
 
Doing More with LESS for CSS
Todd Anglin
 
Component Driven Design and Development
Cristina Chumillas
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
Yandex
 
Slides bootstrap-4
Michael Posso
 
Bootstrap 3 Basic - Bangkok WordPress Meetup
Woratana Perth Ngarmtrakulchol
 
Practical tipsmakemobilefaster oscon2016
Doris Chen
 
HTML5: The Parts You Care About - 4/Nov/13 - PrDC Saskatoon, SK
David Wesst
 
WordPress Theme Design - Rich Media Institute Workshop
Brendan Sera-Shriar
 
Understand front end developer
Hsuan Fu Lien
 
5 Reasons Why Your Website Is[n’t] a Native App (PrDC 2015)
David Wesst
 
HTML5 and CSS3 Techniques You Can Use Today
Todd Anglin
 
Using Core Themes in Drupal 8
Suzanne Dergacheva
 
Why You Need a Front End Developer
Mike Wilcox
 
WordPress Theme Structure
keithdevon
 
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
Kathryn Presner
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
Jer Clarke
 
A Beginner's Guide to WordPress - WordCamp New York City 2012
Kathryn Presner
 
Ad

Viewers also liked (6)

DOCX
Generating the research idea lecture 2 isd 554
pfungwa
 
PDF
Microservices pattern language (microxchg microxchg2016)
Chris Richardson
 
PPT
Lecture 2 generating the research idea
Kwabena Sarpong Anning
 
PPT
System Design and Analysis 1
Boeun Tim
 
PPTX
System Analysis and Design
Aamir Abbas
 
PDF
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
 
Generating the research idea lecture 2 isd 554
pfungwa
 
Microservices pattern language (microxchg microxchg2016)
Chris Richardson
 
Lecture 2 generating the research idea
Kwabena Sarpong Anning
 
System Design and Analysis 1
Boeun Tim
 
System Analysis and Design
Aamir Abbas
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
 
Ad

Similar to Design Systems, Pattern Libraries & WordPress (20)

PPT
Css
Sumit Gupta
 
DOCX
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
Roni Banerjee
 
PPTX
Building Potent WordPress Websites
Kyle Cearley
 
PPTX
Bootstrap PPT by Mukesh
Mukesh Kumar
 
PDF
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 
PDF
Bootstrap
Sarvesh Kushwaha
 
PPTX
Customize all the Things! How to customize Windows and Web applications.
Jason Conger
 
PDF
integrasi template admin lte terbaru dengan laravel 7
Adi Nata
 
PPTX
Web technologies part-2
Michael Anthony
 
PDF
Implement rich snippets in your webshop
Arjen Miedema
 
PPTX
Diazo: Bridging Designers and Programmers
TsungWei Hu
 
PDF
Agile Wordpress
Filippo Dino
 
PDF
Highly Maintainable, Efficient, and Optimized CSS
Zoe Gillenwater
 
PPTX
Create Responsive Website Design with Bootstrap 3
Wahyu Putra
 
PDF
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
PDF
Future-proof styling in Drupal (8)
Hajas Tamás
 
PDF
Advanced CSS Troubleshooting & Efficiency
Denise Jacobs
 
PDF
BADCamp 2012 -Beginner Best Practices
meghsweet
 
PDF
ViA Bootstrap 4
imdurgesh
 
PDF
SMACSS Workshop
Tim Hettler
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
Roni Banerjee
 
Building Potent WordPress Websites
Kyle Cearley
 
Bootstrap PPT by Mukesh
Mukesh Kumar
 
HTML5 and the dawn of rich mobile web applications pt 2
James Pearce
 
Bootstrap
Sarvesh Kushwaha
 
Customize all the Things! How to customize Windows and Web applications.
Jason Conger
 
integrasi template admin lte terbaru dengan laravel 7
Adi Nata
 
Web technologies part-2
Michael Anthony
 
Implement rich snippets in your webshop
Arjen Miedema
 
Diazo: Bridging Designers and Programmers
TsungWei Hu
 
Agile Wordpress
Filippo Dino
 
Highly Maintainable, Efficient, and Optimized CSS
Zoe Gillenwater
 
Create Responsive Website Design with Bootstrap 3
Wahyu Putra
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
Future-proof styling in Drupal (8)
Hajas Tamás
 
Advanced CSS Troubleshooting & Efficiency
Denise Jacobs
 
BADCamp 2012 -Beginner Best Practices
meghsweet
 
ViA Bootstrap 4
imdurgesh
 
SMACSS Workshop
Tim Hettler
 

Recently uploaded (20)

PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
This slide provides an overview Technology
mineshkharadi333
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Doc9.....................................
SofiaCollazos
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 

Design Systems, Pattern Libraries & WordPress

  • 1. Design Systems, Pattern Libraries & WordPress Jesse James Arnold and Grant Kinney from Exygy
  • 3. Change is Constant New challenges require new tools
  • 5. Our canvas is unknown We don’t know what the target resolution and screen size are.
  • 6. We’re not designing pages, we’re designing systems of components. Stephen Hay
  • 7. Components Each component of an interface needs to be considered independently and then brought together to form any number of layouts.
  • 8. Micro Layouts Each unique section of the page had its own rules based content and device context.
  • 9. Context Free Components should be able to adapt to any number of layouts and screen sizes. We like our components to be fluid by default, allowing the container to define the width as much as possible.
  • 11. Be more modular The answer has always been to break your interface into smaller pieces. header image body block
  • 12. Building blocks Object oriented ideas - Avoid unnecessarily duplicating styles - Encourages code reuse - Easier to track down and modify the common styles - Smaller file sizes increase performance header image body block https://www.smashingmagazine.com/2011/12/an-introduction-to-object-oriented-css-oocss/
  • 15. Design Pattern A design pattern is an element of an interface that can solve a specific design problem and repeats across the product in various contexts with a variety of content.
  • 16. Benefits Visual consistency for users impacts user experience. Speeds up workflow between design and engineering. Creates a shared language that connects the whole team. Buttons
  • 17. Examples Easy wins for any team getting started: Color palette Font stack Icon library
  • 18. No more design handoff Design is a work in progress, it is never handed off to be built. <html> <body> <h1>My Website is Done</h1> </body> </html>
  • 19. Pattern Library A place to put all of this stuff.
  • 20. Team Goals Should provide the following team benefits: 1. Allows designers to contribute. 2. Allows product owners to qa and review design in browser. 3. Provides documentation for engineers.
  • 22. Fabricator: Taxonomy └── materials └── components └── structures or └── materials └── atoms └── molecules └── organism
  • 23. Fabricator: Documentation --- notes: | These are notes written in `markdown` --- <div class="component">My Component</div>
  • 24. Fabricator: Data links: About Us: - About Us - Careers - Media Center - Legal {{#each home.links}} {{#each this}} <a href="#">{{this}}</a> {{/each}} {{/each}} <a href="#">About Us</a> <a href="#">Careers</a> <a href="#">Media Center</a> <a href="#">Legal</a>
  • 25. SF Dahlia Pattern Library
  • 26. Pattern Library: Fabricator Pros: Allows you to create your own materials logic. Self documenting HTML components. Navigation automatically generated. Can feed it real data to test each component.
  • 27. Pattern Library: Growing Pains Scaffolding new features may introduce redundancy or code bloat. Product wants to share core components of one product pattern library with other product teams. Visual design updates may share common elements with a feature in development and cause disruption. While importing CSS and JS from pattern library is easy, importing HTML templates is still copy and paste.
  • 28. Current Workflow Design Pattern Library CSS Engineering WebApp Extra Work and Quickly Falls Out of Sync Reproduce Markup
  • 29. Plugin that ports fabricator functionality to work within a custom WordPress theme. Pattern library and application share the same templates. https://github.com/Exygy/wp-pattern-library (this could easily be done with other platforms: AngularJS, React, Ruby on Rails, Django, Laravel, etc) New strategy: wp-pattern-library
  • 31. wp-pattern-library: directory structure wp-content/themes/custom-theme/ pattern-library - materials - atoms - buttons - button.php - button-icon.php - button-sizes.php - lists - list-unordered.php - list-ordered.php - forms - checkbox.php - input-text.php - radio.php - paragraph.php - molecules - nav-menu.php - tabs.php - topbar.php - organisms - media-grid.php - story-grid.php - tile-grid.php
  • 32. wp-pattern-library: Atoms text: Submit classes: hollow --- <button class="button <?= esc_attr( $classes ) ?>"><?= $text ?></button> button.php <a class="primay button" href="#">So Primary</a> <a class="hollow button" href="#">So Hollow</a> <a class="secondary button" href="#">So Secondary</a> <a class="secondary hollow button" href="#">So Hollow</a> --- text: Submit classes: hollow --- <button class="button <?= esc_attr( $classes ) ?>"><?= $text ?></button> button-colors.php
  • 33. wp-pattern-library: Molecules topbar.php <div data-sticky-container> <div class="top-bar<?php if (is_not_pl()) : ?> data-sticky<?php endif ?>” data-options="marginTop:0; stickyOn: small;" style="width:100%" > <div class="top-bar-title"> <button class="top-bar-menu-icon" type="button" data-toggle="page"> <?php get_icon('menu') ?> </button> <div class="top-bar-name"> <span class="top-bar-name-content"> Custom Theme </span> </div> </div> ...
  • 34. wp-pattern-library: Molecules block-columns.php--- title: Basic Content text: This basic content makes an interesting point! category: Component image_src: http://placehold.it/768x350 url: # --- <div class="block-columns"> <a class="block-columns-link" href="<?= esc_url( $url ) ?>"> <div class="block-column"> <div class="block-column-content"> <header class="block-column-header"> <span class="block-column-category"><?= $category ?></span> <h3 class="block-column-title"><?= $title ?></h3> </header> <p class="block-column-text"><?= $text ?></p> </div> </div> <div class="block-column"> <figure class="block-column-figure"> <img src="<?= esc_attr( $image_src ) ?>"> ...
  • 35. wp-pattern-library: Organisms block-column-list.php <section class="block-columns-list"> <?php get_pattern('molecule', 'block-columns') ?> <?php get_pattern('molecule', 'block-columns') ?> <?php get_pattern('molecule', 'block-columns') ?> </section>
  • 36. wp-pattern-library: Code Reuse Call patterns from within WordPress templates: example post loop <?php while ( have_posts() ) : the_post(); ?> <div class="block" data-equalizer-watch> <a class="block-link" href="<?php the_permalink() ?>"> <figure class="block-figure"> <img src="<?= esc_url( get_the_post_thumbnail_url( null, 'component-thumb' ) ) ?>"> </figure> <div class="block-content"> <h3 class="block-title <?= esc_attr( Harmony::has_item_been_updated( get_the_ID() ) ? 'is-recent' : '' ) ?>"> <?php the_title() ?> </h3> <p class="block-text"> <?= wp_trim_words( get_field('description'), 18, '...' ) ?> </p> </div> </a> </div> <?php endwhile; ?> <?php while ( have_posts() ) : the_post(); get_pattern('molecule', 'block', [ 'title' => get_the_title(), 'text' => wp_trim_words( get_field('description'), 18, '...' ), 'image' => get_the_post_thumbnail_url(null, 'component-thumb'), 'link' => get_permalink(), 'classes' => Harmony::has_item_been_updated(get_the_ID()) ? 'is-recent' : '', 'attrs' => 'data-equalizer-watch' ]); endwhile; ?> before after
  • 37. wp-pattern-library: Code Reuse Single source of truth for html markup. ● Map WordPress data to pattern variables (title, text, etc) ● All markup updates made from molecules/block.php ● Application and pattern library are always up to date <?php while ( have_posts() ) : the_post(); get_pattern('molecule', 'block', [ 'title' => get_the_title(), 'text' => wp_trim_words( get_field('description'), 18, '...' ), 'image' => get_the_post_thumbnail_url(null, 'component-thumb'), 'link' => get_permalink(), 'classes' => Harmony::has_item_been_updated(get_the_ID()) ? 'is-recent' : '', 'attrs' => 'data-equalizer-watch' ]); endwhile; ?>
  • 38. Pattern Library: Resources Fabricator http://fbrctr.github.io/ Starter Kit with Fabricator and Foundation 6 https://github.com/exygy-design/exygy-patterns-f6 Living Example https://sf-dahlia-pattern-library.herokuapp.com/ WordPress Plugin https://github.com/Exygy/wp-pattern-library