Add a CSS preprocessor library to core

Created on 15 October 2011, over 13 years ago
Updated 9 February 2023, about 2 years ago

Updated: Comment #138

Problem/Motivation

Many front-end designers and developers are learning CSS preprocessors. Because of the improved reusability with mixins and variables, etc, these systems make writing large, complex CSS much easier and simpler. CSS developers are starting to say things like "you're doing it wrong" to people developing without a preprocessor.

Proposed resolution

Make Drupal compatible out of the box with SASS and/or LESS.

The SASS or LESS source files would be added using Drupal's standard .info syntax and drupal_add_css(). If the source files end with .scss or .less, they will run through their designated pre-processor.

Modules are already providing this functionality:
- Sassy (PHPSass library)
- LESS (lessphp library)

Possible advantages

- Avoiding WET programming (write everything twice): Easy reusability thanks to variables, mixins, extends and functions
- Maintainability: Easier grouping of related properties, central point for change (see point on WET)
- Readability: Nested syntax makes it easier to quickly see within what context a selector applies

Related Issues

  1. #352951: Make JS & CSS Preprocessing Pluggable
  2. #1784774: Remove Assetic component from core

User interface changes

None.

API changes

None.

Feature request
Status

Closed: outdated

Version

10.1

Component
CSS 

Last updated 10 days ago

Created by

🇹🇼Taiwan johnalbin Taipei, Taiwan

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024