Make "class" attribute an array
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3199777. --> Reported by: [yannickoo](https://www.drupal.org/user/531118) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Since we are using strings there are issues especially with merging <code>class</code> attributes, so we need to transform values into arrays. When checking Drupal's <a href="https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/lib/Drupal/Core/Template/Attribute.php#L124-126"><code>Attribute</code></a> class you can see that core forces arrays for <code>class</code> attribute.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Make sure <code>class</code> attributes are stored as array</li> </ul> <h3 id="summary-proposed-resolution">Remaining tasks</h3> <ul> <li>Write update hook which makes all <code>class</code> attributes arrays</li> </ul> <h3 id="summary-data-model-changes">Data model changes</h3> <ul> <li><code>class</code> values will be stored as array instead of string</li> </ul> <hr>
issue