Twig | Modules Unraveled

119 The Classy Base Theme for Drupal 8 with Scott Reeves and David Hernandez - Modules Unraveled Podcast

Photo of Scott Reeves and David Hernandez

Consensus Banana

  • How did this all get started? and where does the “banana” come from.
    • From Morten: 2 years ago at BadCamp John Albin was holding a plastic sword from the pirate fest the day before. It was known as the sword of consensus. At DrupalCon Austin Morten had a banana that he was using to point to people and ask “So can we agree on X?”. That is how it became the banana of consensus. It was basically a pointing stick.
  • Technically, what is the change.
    • Moving classes from core to a base theme called Classy.
    • Multi-phased approach.
    • Phase 1, move classes out of preprocess functions and into the core templates.
    • Create the Classy base theme.
    • Phase 2, copy the core template with classes to Classy, remove the classes from core.
  • Why do themers need this.
    • Better options
    • Not everyone wants the same markup (themer survey)
    • Avoiding php
    • No time wasted undoing core.
  • What work has been done, what is left.
    • Preprocess changes (phase 1) far along.
    • Classy is RTBC, waiting for Dries to approve.
    • Phase 2 to start at or just after Amsterdam (don’t need to wait until phase 1 is 100% complete)
  • Chance of failure?
    • Changes have to be in by RC1.
  • Who to thank?
    • joelpittet, mdrummond, crowdcg, lauriii, alexpott!
  • Are there any other theme layer changes to look forward to that have come about because of the banana consensus?
    • addClass/removeClass is in, what about setAttribute/removeAttribute? Similarities to jQuery make this (hopefully) more approachable for frontend developers.
  • Any other theming changes not related to banana?
    • Improved menu theming - menu.html.twig using a Twig macro

Use Cases

  • What it means for themers. What it means for developers.
    • Preprocess is still there so contrib can add classes if necessary - but is it necessary? Could it be done as a data- attribute?

106 All things Drupal 8 and Twig with Mortendk - Modules Unraveled Podcast

Photo of Morten DK

D8 Theming

  • What were the results of the theming survey?
    • People use Sass
    • Themes people are using

Twig

  • For anyone who’s been hiding under a rock, quickly explain what Twig is.
  • drupaltwig.org
  • drupaltwig

  • What do you know of that’s going on at DrupalCon Austin?

  • slack.com

Frontend United copenhagen 29-31 august
4 weeks before Drupalcon Amsterdam

Questions from Twitter

  • Marc Drummond
    You should ask @mortendk if he will write a Viking Edda hailing his love of divs and classes in Drupal's default markup.
  • Marek Sotak
    I thought DK in your nickname stands for Denmark, now I know - Morten DivKiller? :D