Skip to content

Commit 9a1da9c

Browse files
author
nod_
committed
Issue #3512194 by catch, smustgrave, nod_: Move resize CSS into its own library
1 parent 5e74907 commit 9a1da9c

File tree

9 files changed

+34
-7
lines changed

9 files changed

+34
-7
lines changed

core.libraries.yml

+15
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,21 @@ drupal.progress:
647647
- core/jquery
648648
- core/drupalSettings
649649

650+
drupal.textarea-resize:
651+
version: VERSION
652+
css:
653+
component:
654+
misc/components/resize.module.css: { weight: -10 }
655+
moved_files:
656+
system/base:
657+
deprecation_version: 11.2.0
658+
removed_version: 12.0.0
659+
deprecation_link: https://www.drupal.org/node/3432346
660+
css:
661+
component:
662+
css/components/resize.module.css:
663+
component: misc/components/resize.module.css
664+
650665
drupal.states:
651666
version: VERSION
652667
js:

lib/Drupal/Core/Render/Element/Textarea.php

+9
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,21 @@ public function getInfo() {
4444
],
4545
'#pre_render' => [
4646
[static::class, 'preRenderGroup'],
47+
[static::class, 'preRenderAttachments'],
4748
],
4849
'#theme' => 'textarea',
4950
'#theme_wrappers' => ['form_element'],
5051
];
5152
}
5253

54+
/**
55+
* Adds the textarea resize library.
56+
*/
57+
public static function preRenderAttachments($element): array {
58+
$element['#attached']['library'][] = 'core/drupal.textarea-resize';
59+
return $element;
60+
}
61+
5362
/**
5463
* {@inheritdoc}
5564
*/

modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testLogin(): void {
9393
'ScriptCount' => 3,
9494
'ScriptBytes' => 215500,
9595
'StylesheetCount' => 1,
96-
'StylesheetBytes' => 46300,
96+
'StylesheetBytes' => 46000,
9797
];
9898
$this->assertMetrics($expected, $performance_data);
9999

modules/system/system.libraries.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ base:
1313
css/components/nowrap.module.css: { weight: -10 }
1414
css/components/position-container.module.css: { weight: -10 }
1515
css/components/reset-appearance.module.css: { weight: -10 }
16-
css/components/resize.module.css: { weight: -10 }
1716
css/components/tablesort.module.css: { weight: -10 }
1817

1918
admin:

profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testFrontAndRecipesPages(): void {
3030
'ScriptCount' => 1,
3131
'ScriptBytes' => 11700,
3232
'StylesheetCount' => 6,
33-
'StylesheetBytes' => 121000,
33+
'StylesheetBytes' => 120500,
3434
];
3535
$this->assertMetrics($expected, $performance_data);
3636
}

profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function testAnonymous(): void {
191191
['config:user.role.anonymous'],
192192
],
193193
'StylesheetCount' => 1,
194-
'StylesheetBytes' => 2250,
194+
'StylesheetBytes' => 2100,
195195
];
196196
$this->assertMetrics($expected, $performance_data);
197197
$expected_default_cache_cids = [
@@ -275,7 +275,7 @@ protected function testAnonymous(): void {
275275
['config:user.role.anonymous'],
276276
],
277277
'StylesheetCount' => 1,
278-
'StylesheetBytes' => 2250,
278+
'StylesheetBytes' => 2100,
279279
];
280280
$this->assertMetrics($expected, $performance_data);
281281

@@ -312,7 +312,7 @@ protected function testAnonymous(): void {
312312
'CacheTagInvalidationCount' => 0,
313313
'CacheTagLookupQueryCount' => 13,
314314
'StylesheetCount' => 1,
315-
'StylesheetBytes' => 1950,
315+
'StylesheetBytes' => 1800,
316316
];
317317
$this->assertMetrics($expected, $performance_data);
318318
}

themes/stable9/stable9.info.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ libraries-override:
7878
component:
7979
misc/components/progress.module.css: css/core/components/progress.module.css
8080

81+
core/drupal.textarea-resize:
82+
css:
83+
component:
84+
misc/components/resize.module.css: css/core/components/resize.module.css
85+
8186
core/drupal.tabledrag:
8287
css:
8388
component:
@@ -234,7 +239,6 @@ libraries-override:
234239
css/components/nowrap.module.css: css/system/components/nowrap.module.css
235240
css/components/position-container.module.css: css/system/components/position-container.module.css
236241
css/components/reset-appearance.module.css: css/system/components/reset-appearance.module.css
237-
css/components/resize.module.css: css/system/components/resize.module.css
238242
css/components/tablesort.module.css: css/system/components/tablesort.module.css
239243
system/admin:
240244
css:

0 commit comments

Comments
 (0)