Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295300

Replace the .region-content ul/ol selector with text-formatted to refactor code + fix visual bugs.

$
0
0

Follow-up to #2539860: Add a class to field that contain user-generated formatted text

Problem/Motivation

It's common to provide styling for base elements, elements that don't have classes. This styling is used in situations where a user can enter formatted HTML text. This can often introduce conflicts with UI components, if they are using the elements that have styling applied.

Some themes get around this by prefixing the base selectors with a wrapper class a indicates they are free text, not a UI component.

Bartik has an attempt to do this:

.region-content ul,
.region-content ol {
  margin: 1em 0;
  padding: 0 0 0.25em 15px; /* LTR */
}

The logic of this selector is flawed because anything can go inside the content region, not just free text. Any UI component placed in .region-content that includes ul could inherit this styling by mistake.

Proposed resolution

In #2539860: Add a class to field that contain user-generated formatted text we added a class called 'text-formatted' that only applies to fields that include free text. This reduces the scope of the selector.

Remaining tasks

Patch
Test for visual regressions

User interface changes

None

API changes

None

Data model changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue categoryTask because it's improves code quality
Issue priorityNot critical because it's code quality
Unfrozen changesUnfrozen because it only changes CSS

Viewing all articles
Browse latest Browse all 295300

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>