Change categorization of style.css file in global-styling library

Created on 18 January 2023, over 1 year ago
Updated 22 March 2023, over 1 year ago

In bootstrap4.libraries.yml, the "global-styling" library is defined and includes the style.css file with the category of "theme":

global-styling:
  css:
    theme:
      css/style.css: {}

This causes the style.css file to be outputted in the html after any other css files that are categorized at a lower level (e.g. base, layout, component). Considering the nature of the style.css file, I feel like it would be better suited in the "layout" or "component" category.

See this page for the category definitions: https://www.drupal.org/docs/develop/standards/css/css-file-organization-...

From a practical standpoint, I think it makes sense that the style.css file is loaded before most other files that might be added by a module or subtheme.

Feature request
Status

Closed: works as designed

Version

2.1

Component

Code

Created by

🇺🇸United States davedg629

Live updates comments and jobs are added and updated live.
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.

  • Status changed to Closed: works as designed over 1 year ago
  • 🇦🇺Australia jannakha Brisbane!

    from https://www.drupal.org/docs/develop/standards/css/css-file-organization-...

    "5. Theme — purely visual styling (“look-and-feel”) for a component."

    Bootstrap styling contains styling as for layout, components and look and feel, but mostly it's used to unify look and feel of the whole web application (core and any modules and custom modules).

    Bootstrap theme is designed to override look and feel of any components which follow bootstrap class convention, so it's supposed to be loaded under "theme" in global-styling of libraries.yml

    If you're using sub-theme (example theme/custom/my-bootstrap4/) derived from Bootstrap4 - sub-theme should override theme/contrib/bootstrap4/style.css with its own - Drupal should not be loading both style.css from contrib and custom as sub-theme is self-contained, fully re-compiled customised styling.

  • 🇺🇸United States davedg629

    Thanks for looking at this and providing a detailed response.

Production build 0.69.0 2024