Verified Commit fae1be90 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3512236 by catch, smustgrave: Move fieldgroup CSS to its own library

parent 7257036e
Loading
Loading
Loading
Loading
Loading
+15 −0
Changes for core/core.libraries.yml: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -589,6 +589,21 @@ drupal.entity-form:
  dependencies:
    - core/drupal.form

drupal.fieldgroup:
  version: VERSION
  css:
    component:
      misc/components/fieldgroup.module.css: { weight: -10 }
  moved_files:
    system/base:
      deprecation_version: 11.2.0
      removed_version: 12.0.0
      deprecation_link: https://www.drupal.org/node/3432346
      css:
        component:
          css/components/fieldgroup.module.css:
            base: core/misc/components/fieldgroup.module.css

drupal.form:
  version: VERSION
  js:
+12 −3
Changes for core/lib/Drupal/Core/Render/Element/Fieldgroup.php: 12 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -20,9 +20,18 @@
class Fieldgroup extends Fieldset {

  public function getInfo() {
    return [
      '#attributes' => ['class' => ['fieldgroup']],
    ] + parent::getInfo();
    $info = parent::getInfo();
    $info['#attributes']['class'] = ['fieldgroup'];
    $info['#pre_render'][] = [static::class, 'preRenderAttachments'];
    return $info;
  }

  /**
   * Adds the fieldgroup library.
   */
  public static function preRenderAttachments($element): array {
    $element['#attached']['library'][] = 'core/drupal.fieldgroup';
    return $element;
  }

}
+0 −1
Changes for core/modules/system/system.libraries.yml: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ base:
    # Adjust the weights to load these early.
    component:
      css/components/align.module.css: { weight: -10 }
      css/components/fieldgroup.module.css: { weight: -10 }
      css/components/container-inline.module.css: { weight: -10 }
      css/components/clearfix.module.css: { weight: -10 }
      css/components/details.module.css: { weight: -10 }
Loading