On Github ckrina / component-driven-dd
aa
Designer and frontend developer at Ymbra
aa
Lifetime of a project
Clients wants PS because they’re used to it.
Any pre-defined object usable across multiple pages (widgets or modules)
<!-- Last News component --> <div class="last-news"> <h2 class="last-news__title"> Últimas noticias </h2> <ul class="last-news__list"> <li class="last-news__item">(...)</li> <li class="last-news__item">(...)</li> </ul> <a class="last-news__more">Ver más</a> </div>
Independent entity with its own meaning
For a system to be modular, it must have interchangeable parts.
Make system modular with components
NO tools 4 authors design > provide library of reusable components
--Stephen Hay
--Mark Otto, FOWA 2013
Everything.
Typography, layouts and grids, colors, icons, components, coding conventions...
Reusable work - COMPONENTS
More efficient projects
Large-scale ready code
Everybody knows how everything works
Integrates multi-disciplinary workflow
Static wireframes vs HTML Wireframes
Static delirables vs HTML delirables-prototypes
When should we introduce it in our workflow.OOCSS, BEM, SMACSS
Methodologies for scalable maintainable frontend code
/* Media Object */ .media {} .media .img {} .media .img img {} .media .imgExt {}
.site-search {} /* Block */ .site-search__field {} /* Element */ .site-search--full {} /* Modifier */
underscore / dash
<div class="block-name__wrapper"> <div class="block-name"> <h2 class="block-name__title">Block title</h2> <p class="block-name__text">Block text</p> </div> </div>
<div class="block-name--big"> <h2 class="block-name__title">Block title</h2> <p class="block-name__text">Block text</p> </div>
Documentation of a Design System
At the begining: PDF Today:Visualizes your code and represents it as a UI component toolkitOut of date Style Guides are useless.
Style guides that are generated directly from the style definition sources
Separation of UX-Design-Frontend-Backend. Developing UI separately in a styleguide.
Separating the UI and backend tasks > start at the same time & plug-and-play directly
// Pager // // Markup: pager.hbs // // Style guide: components.navigation.pager .pager, %pager { clear: both; margin: 0; padding: 0; text-align: center; // A page item in the pager list. &__item { @include adjust-font-size-to(12px); display: inline; padding: 0 .5em; border-right: solid 1px color(grey-dark); list-style-type: none; background-image: none; color: color(grey-dark); } // The current page's list item. &__current-item { @extend %pager__item; } }
// Pager <ul class="pager {{modifier_class}}"> <li class="pager__item"> <a title="Go to page 1" href="/admin/content">1</a> </li> <li class="pager__item"> <a title="Go to page 2" href="/admin/content?page=1">2</a> </li> <li class="pager__current-item">3</li> <li class="pager__item"> <a title="Go to page 4" href="/admin/content?page=3">4</a> </li> <li class="pager__item"> <a title="Go to page 5" href="/admin/content?page=4">5</a> </li> </ul>
Articles, Books, Podcasts, Talks, Tools, Examples, etc.
View modes
Field templates (Display Suite extras)
<?php $plugin = array( 'single' => TRUE, 'title' => t('Menu shortcuts to the themes'), 'category' => t('MSF ES: Themes'), 'render callback' => 'jumpmenu_themes_render', 'admin info' => 'jumpmenu_themes_admin_info', ); /** * The 'admin info' callback for panel pane. */ function jumpmenu_themes_admin_info($subtype, $conf, $contexts) { (...) } /** * Render callback function. */ function jumpmenu_themes_render($subtype, $conf, $args, $contexts) { (...) }
/** * Implements hook_preprocess_panels_pane(). */ function mymodule_preprocess_panels_pane(&$variables) { switch ($variables['pane']->subtype) { case 'my-pane-name': $variables['template_files'][] = 'panels-pane-test'; break; } }
/** * Implements hook_preprocess_panels_pane(). */ function mymodule_preprocess_panels_pane(&$variables) { switch ($variables['pane']->subtype) { case 'my-pane-name': $classes = 'my-custum-class'; $variables['classes_array'][] = $classes; break; } }