Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In Drupal 7, drupal_add_css(), drupal_add_js() and drupal_add_library() could be used to add JS and CSS to a page. In Drupal 8, these functions have been removed. Instead, you must use #attached in a render array. #attached was already available in Drupal 7, and was widely used, but now it'll be the only way to attach assets.

Read the Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 module documentation to find code samples.

Impacts: 
Site builders, administrators, editors
Module developers
Themers