Step 0: Build development site first

Before making your website publicly available on the Internet, you probably will want to build and test it in an offline development environment. When it is working to your satisfaction in the development environment, you can then upload it to a Web host for serving online. To install Drupal on your own computer for a local development environment, see the article, Local server setup.

CSS file organization (for Drupal 8)

Note: This document describes a file organization and aggregation strategy that has not yet been implemented in Drupal 8. See this core issue for that on-going work:

File Structure

Rulesets should be grouped into logical files that enforce the separation of concerns within the CSS, that can be aggregated efficiently and that can be easily overridden by themers.

Drupal 8 follows a SMACSS-style categorization of its CSS rules:

CSS architecture (for Drupal 8)

Note: This document aims to apply emerging best-practices for CSS to Drupal 8. As we implement these ideas in Drupal 8, this document may need to be updated.

Skip to best practices

Goals #

The goals of good CSS should not be so different from those of good software engineering. Well-architected CSS, like PHP or JavaScript, should be:

CSS coding standards

To minimize friction when contributing to CSS, the front-end developers of the Drupal community have reached consensus about our coding standards for:

  • Formatting CSS code.
  • CSS architecture, including goals, pitfalls and best practices.
  • Grouping rulesets into files.

Despite our natural range of working styles and coding preferences, we value collaboration and ease of development, so we have attempted to explain our standards clearly in the following documents.

Agile Unit Testing

What You Should Know

This book page is not for developers new to application testing; therefore, it does not describe unit testing concepts and techniques. The following list describes the level of experience or knowledge required to understand this book:

  • Familiarity with unit tests, programming on PHP 5.x with the corresponding development tools for that platform, and the process of writing tests in general.
  • A general understanding of the structure and concept of xUnit testing frameworks; the object model; dependency management (composition, inheritance patterns) including database mocking.

Agile testing combines engineering with testing activities into one activity and can be expressed by following Test Driven Development where a developer would write tests first. In particular, this book page focuses on unit testing where units represent objects or single architectural layers in contrast to functional testing (customer tests) where a unit represents the complete application (many architectural layers). Functional testing is also vitally important to Drupal but the focus of a separate book page.

Why to Isolate - Focus on Unit Tests

Accessibility best practices

This page gives a short list of things to be aware of when developing Drupal modules, related to Accessibility.


Subscribe with RSS Subscribe to RSS - best practices