extrasmall class is added to all dropbuttons
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3188529. -->
Reported by: [paul121](https://www.drupal.org/user/3624919)
Related to !36
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When trying to render a dropbutton with <code>'#dropbutton_type' => 'small'</code> an <code>extrasmall</code> dropbutton is always rendered. I see this is being done in <code>gin_preprocess_dropbutton_wrapper()</code>. I believe this is overriding the <code>dropbutton--small</code> class which Gin provides as well. Am I doing something wrong? Is there something else I can do to render a small dropbutton? I'm also curious how to render a "standard" dropbutton, without the <code>small</code> or <code>extrasmall</code> classes. Seems like this should be possible without any custom css.</p>
<p>It seems like the intention is to default to the <code>extrasmall</code> dropbutton when no specific size is set? I think this is the case for dropbuttons used on the Block structure page.</p>
<p>The preprocess hook is also appending the <code>dropbutton--multiple</code> and <code>dropbutton__item</code> classes a which are already present in the ul and li elements.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Render a dropbutton such as: </p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> $button </span><span style="color: #007700">= [<br> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'dropbutton'</span><span style="color: #007700">,<br> </span><span style="color: #DD0000">'#dropbutton_type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'small'</span><span style="color: #007700">,<br> </span><span style="color: #DD0000">'#links' </span><span style="color: #007700">=> [ ... ],<br> ];<br></span><span style="color: #0000BB">?></span></span></pre></div>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Not sure if this is the best solution, but maybe we can check if a <code>dropbutton--size</code> is provided, and if so, skip the preprocess replacement? I made an attempt at this but unsure if it is the best approach.</p>
issue