Closed ericras closed 4 years ago
It looks like we have two options:
DisplayPluginBase
class, orDisplayPluginBase
and submit an issue on Drupal.orgOption 1 isn't possible.
The "correct" way to solve this would be to 1) modify Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm
to check css classes with \Drupal\Component\Utility\Html::cleanCssIdentifier
, which 2) in turn would need to be modified to accept escaped unicode characters. There's an issue on Drupal.org for the second issue:
Html::cleanCssIdentifier Strips Valid Escaped Characters
This change is supported by the official CSS specs: https://www.w3.org/TR/CSS21/syndata.html#characters.
Tests would need to be updated, and then both changes would need to be committed to Drupal core.
A much easier alternative would be to simply patch Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm
with a local patch.
The issue with \Drupal\Component\Utility\Html::cleanCssIdentifier
may continue to cause problems with DCF, so we may be forced to revisit this.
Patch solution is coming.
Third option:
Yeah, so I only read option 1 and then repeated option 2. Whatever
Adding a CSS class of "dcf-grid-halves@md" to a view gives:
CSS classes must be alphanumeric or dashes only.
Adding @ won't hurt anything in /web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php