For years now, frontend developers have ranted and whined about Drupal's divitis, a disease that's been greatly eradicated in Drupal 8 with the introduction of smarter templates and the use of Twig.
But a secondary problem often crops up for Drupal frontenders -- all the CSS classes, and corresponding styles, that Drupal stuffs into every element that's left. For some themes, Drupal's default classes give a nice starting point. For others, they provide hours of delightful fun learning about style cascades and specificity issues. In other words, they can be awful.
Drupal themers can be an ornery bunch, and for awhile now they've been arguing about which approach is better, like historical browser war re-enactors set loose on the Drupal issue queues.
No longer. A consensus has emerged, beginning relatively recently in Drupal 8 development, that allows themers to choose between including Drupal's default classes, and using none at all. Its name is Classy. Come hear about this brave new world, with such base themes in it!
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Beating the Class out of Drupal 8: An intro to the Classy core theme
1. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Beating the
Class
out of Drupal 8
2. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal’s pushy
classes
It looks like you've got a
Drupal site there.
!
Would you like me to
insert some classes?
Insert 18 classes on
this node's <div>
!
Insert 18 classes on
this node's <div> and
23 classes on this
page's <body>
Throw some more
fun classes on any
fields I can find too.
3. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitisBartik output, Drupal 7
4. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Bartik node.tpl.php & template.php, Drupal 7
5. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Bartik, Drupal 7theme.inc, Drupal 7
12. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Enter the banana
13. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
The birth of consensus
Drupalcon Austin, June 2014
14. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
drupal.org/node/2289511
15. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13node.html.twig, Drupal 8 alpha 13
16. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13node.html.twig, Drupal 8 beta 3
17. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13node.module, Drupal 8 alpha 13
18. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13node.module, Drupal 8 alpha 13
19. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13node.html.twig, Drupal 8 beta 3
20. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Classy
21. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Classy
22. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Chose your banana
23. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
drupal.org/node/2289511
bartik.info.yml, Drupal 8 beta 3
24. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13Bartik node.html.twig, Drupal 8 beta 3
25. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13Bartik node.html.twig, Drupal 8 beta 3
26. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Drupal and divitis
Drupal 7
Bartik, Drupal 8 alpha 13Bartik node.html.twig, Drupal 8 beta 3
27. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
ResourcesControlling CSS Classes with the Classy Theme
https://drupalize.me/blog/201411/controlling-css-classes-classy-theme-drupal-8
Drupal 8 Theming Update [video]
http://www.mediacurrent.com/blog/drupal-8-theming-update
Modules Unraveled #119: Consensus Banana
https://modulesunraveled.com/podcast/119-classy-base-theme-drupal-8-scott-
reeves-and-david-hernandez-modules-unraveled-podcast
Sqndr’s Drupal 8 Theming Guide: Classy
https://github.com/sqndr/d8-theming-guide/blob/master/core-themes/classy.md
28. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Issues
[meta] Results of Drupalcon Austin's
Consensus Banana
https://www.drupal.org/node/2289511
[meta] Consensus Banana Phase 1
https://www.drupal.org/node/2322163
[meta] Consensus Banana Phase 2
https://www.drupal.org/node/2348543
29. Rootwork.org
Powering grassroots networks from the bottom up
twitter.com/rootwork
slideshare.net/rootwork
gplus.to/ivanb
Portland Drupal Frontend — November 2014
Documentation
Using Classy as a base theme
https://www.drupal.org/theme-guide/8/classy
Added a new base theme to core called Classy
https://www.drupal.org/node/2337467
Add classy.info.yml to core
https://www.drupal.org/node/2329501
Theme system overview
https://api.drupal.org/api/drupal/core!modules!system!theme.api.php/