Page MenuHomePhabricator

Skin custom CSS for <ul> tag leads to problems with "tokens" input type
Closed, DeclinedPublic

Description

Some form elements (input type=tokens) are encapsulated within <ul> tags, while some are not. The inconsistency leads to problems when used with MediaWiki skins and other UI customizations through CSS. Form elements which apparently are encapsulated in UL tags:

  • pfTokens

those that are not:

  • pfComboBox
  • standard label
  • radioButtonItem

Those that depend on other attributes:

  • createboxInput

Possibly the problem is ONLY with the pfTokens class. But I haven't tested all input possibilities

Event Timeline

I'm not sure if this is something that can be changed: for the "tokens" input type, the JavaScript involved generates and/or uses a <ul> tag, while for most input type a <ul> tag wouldn't make sense. It seems like the issue is that CSS styling shouldn't be applied to just all <ul> tags, but rather should involve a class name or something. Where is the problematic CSS coming from?

The CSS directive to indent all UL elements comes from a skin. The makers of the skin say this is intended. They pointed to forms as the source of the problem. A definitive answer either way from you/the community would help here.

I fixed it with the following code in Common.css. Is there anyway to customize the module with this CSS ?

#content #bodyContent div.pfTokens ul {
	margin-left:0;
}

I do see your point about UL being generated. Here is the rendered HTML pesudo code (some fields excluded):

<tr><th>Field name</th>
<td>
  <span class="inputSpan mandatoryFieldSpan">
     <div class="select2-container select2-container-multi pfTokens mw-ui-input pf-select2-container" style="min-width: 600px;">
        <ul class="select2-choices ui-sortable">
           <li class="select2-search-choice">
                <div>Some token</div>
                <a href="#" onclick="return false;" class="select2-search-choice-close" tabindex="-1"></a>
           </li>
           <li class="select2-search-field">
              <label class="select2-offscreen">
              <input type="text" autocomplete="off" ... class="select2-input" id="...">
            </li>
        </ul>
      </div>
      <input ... class="pfTokens select2-offscren mw-ui-input"
Yaron_Koren renamed this task from In generated form input elements, inconsistent use of the <ul> tag to Skin custom CSS for <ul> tag leads to problems with "tokens" input type.Jul 25 2022, 1:29 PM
Yaron_Koren closed this task as Declined.

I'm marking this as "Declined" - I don't think anything can be done about this problem, within Page Forms.