7

Styling Forms

One of the most pervasive features of any website is to accept user input through forms. Whether it is the login form or a form to subscribe to a newsletter, making it consistent with the design system of the whole site is mandatory.

In this chapter, we’ll dive into how a form works in Drupal and how to style it.

You’ll learn about render elements and how they are used to provide widgets to be used in a form array.

You’ll also learn which templates to use to style every section and component of a form. We will cover the following topics in this chapter:

  • Understanding forms
  • Styling forms

Understanding forms

Until now, we’ve dealt with URLs that render, in their main content block, a custom render array (/forecast/turin, for ...

Get Modernizing Drupal 10 Theme Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.