Technical Architect, Acquia
D.O: adam.weingarten
github: aweingarten
linkedin: adam.weingarten
Front End Architect, Acquia
D.O: sarahjean
github: sarahjean
linkedin: sarah-thrasher-2379a61b/
Getting Drupal to look the way you want is hard
Takes time to get Drupal looking they way you want
Good front end developers are hard to find
Front end phase longer and riskier
Client asks for a thing
UX does comps and/or wire frames
Back end Developer builds a bunch of widget
Throws the finished page over the fence to the front-end developer
Front-end developer starts hacking away
Start with visual designs.
Break it apart into visually modular elements
build a small ideal model
don't build a page
to build this
Instead of this
The horrible traumatic markup, etc does not exist.
This is an optimistic methodology.
Create markup to bring design to life
Use classes that make sense
Identify the parts that can change
Put those examples into a JSON file
{
"url": "/",
"logo": "img/logo.jpg",
"alt-text": "Drupal GovCon 2017 Logo",
"title": "Drupal GovCon 2017"
}
// Hero
//
// Hero styling
//
// Markup: hero.twig
//
// Style guide: components.hero
.hero__wrapper {
}
.hero__logo {
}
.hero__title {
}
.hero__button {
&:link {
}
&:visited {
}
&:hover {
}
}
Get Drupal to print markup that is consistent with your model.
{% embed "@components/hero/hero.twig" with {
'url': content.url,
'logo': content.logo,
'title': site_title
} %}
{% endembed %}
This is where D8 and Twig shines
Now we have a styled widget in Drupal
And it's powered by your style guide
Have a beer
And then you are done!
Make changes to the style guide.
Recompile all the things.
Until the next change request.....
Style guide by itself is a simple static site
It's generated via templates and sample data
Code is shared between it and your actual site, it isn't just used as a reference
This has referred to mainly the CSS in the past, but with D8 and Twig, your actual template files can be used as well, keeping markup patterns in sync.
// ----- KSS Node ----- //
styleGuide: {
source: [
paths.styles.source
],
destination: 'styleguide/',
css: [
path.relative(paths.styleGuide, paths.styles.destination + 'styles.css'),
path.relative(paths.styleGuide, paths.styles.destination + 'style-guide-only/kss-only.css')
],
js: [],
builder: 'builder/twig',
namespace: 'components:sass',
'extend-drupal8': true,
homepage: 'style-guide-only/homepage.md',
title: 'Our Awesome Style Guide'
}
There are a number of different tools that can be used to generate
the style guide so you will probably want to do a bit of research
Style Guide Generator Roundup - Susan Robertson
Also a build tool, such as grunt, gulp, npm scripts, etc...
Validates clients' business requirements
Increases accuracy of estimation
Speeds up development
Increases the quality of deliverables
Builds confidence with change requests
Accelerating the delivery velocity
Building a bigger pool of developers
Integration becomes easier
Preview styling and markup without a backend
Get feedback
Fix the nitpicks
You don't need a Drupal for styling
Increased separation of concerns
Project phases can proceed independently
Splitting up tasks by components as opposed to pages reduces inconsistencies.
More tasks that are smaller sized makes it easier to keep tickets moving.
Easier to test and QA.
By decomposing large tasks into smaller tickets
(Smaller chunks are easier to estimate)
Splits styling and theming into discrete tasks
By separating task you do each better
Change the model and Drupal changes with it
Tradish front end non-Drupalists can help build the style guide
Twig in D8 or Handlebars in headless more familiar to front enders.
Style guide can be even be created before the main dev team comes on-board
Still need a Drupalist for theming.
Make Aggressive Front-end Changes without fear
Avoid Visual regressions
Style in more testable chunks
Reduce rework now that you have a record of available design components.
Your style guide can also document usages and options that might not be as obvious from the content creation form.
It will be a useful reference for on-boarding new contributors to your project.
Getting Drupal to look exactly the way you want can be hard.
Now you have some tools to help!
Component based approaches to theming
Living style guide
Friday sprint reminder slide
DA asked us to include this.