跳转到主要内容
sbxlm 提交于 7 July 2015
原文:Using Classy as a base theme

Classy是Drupal 8核心中的一个主题,用主Bartik和Seven的子主题。它的目的是在标记中提供许多类,以帮助注释和描述在页面上渲染的标记元素。过去,Drupal在对元素如此进行注释方面所做的额外辅助,有的人认为是有益的,而其他人则认为是有害的。在Drupal 8中,您现在可以选择是否包含此种额外辅助。如果您想在您的元素上包含Drupal类,就把Classy定义为您的基主题。更多信息请阅读:学习如何创建子主题。 如果您想您的主题含有尽可能少的类,那么就不要用Classy作为基主题。当您不想Drupal定义的类与您的主题正在使用的CSS和JavaScript框架冲突时,不使用Classy是一个好主意。不包含Classy可让您完全负责您的主题拥有的类。

更多信息(More information)


以下是英文原文,可参照阅读:

Last updated November 7, 2014. Created on October 9, 2014. Edited by richgilbert, batigolix, cosmicdreams, lieb. You can edit this page, too.

Classy is a theme in Drupal 8 core that is used as a base theme for Bartik and Seven. Its purpose is to provide many classes throughout the markup that help annotate and describe markup elements that render on the page. In the past, the extra effort that Drupal applies to elements in annotating them this way has been viewed as helpful by some and a hindrance by others. In Drupal 8, you now have the option of either including or excluding this extra help. If you want your theme to include Drupal's classes on your elements, define Classy as your base theme. Read more here: Learn how to create a sub theme. If you want your theme to have the minimum amount of classes, then do not use Classy as a base theme. Not using Classy is a great idea when you don't want the classes defined by Drupal to conflict with CSS and JavaScript frameworks being used by your theme. Excluding Classy gives you full responsibility over the classes your theme has.

More information