Problem/Motivation
Drupal’s new CSS coding standards recommend a naming convention for classes which requires the use of double-underscores as separators in certain cases. However, Drupal currently processes some classes internally using drupal_clean_css_identifier(), which replaces all underscores with dashes.
Proposed resolution
Allow double underscores to pass through drupal_clean_css_identifier untouched. Because many modules rely on the current behavior of this function in order to generate standard dash-separated class names from php strings such as field_name
(and this doesn’t need to change), we should for the time being retain the existing behaviour for single underscores. #1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes exists to discuss altering the treatment of single underscores.
Remaining tasks
Update drupal_clean_css_identifier to allow double underscores.
User interface changes
None.
API changes
None.
Related Issues
#1995272: [Meta] Refactor module CSS files to use component-style selectors
#1109854: Overly aggressive transliteration in drupal_clean_css_identifier removes underscores from classes