Off-canvas style resets are overriding styles (especially SVGs) resulting in display issues

Created on 4 April 2018, about 6 years ago
Updated 20 October 2023, 8 months ago

Problem/Motivation

CSS selectors from 'off-canvas.reset.css' are targetting elements in Safari and setting properties to their initial values. This is overriding styles from 'off-canvas.base.css' and causing display issues as well as making overrides difficult.

This can be seen in layout builder's off-canvas dialog. Styles are overridden such that svgs are not visible, divs with labels are the wrong color, etc. See 'safari.png'. A 1px red border was added to show elements selected in Safari.

The rule set responsible:

#drupal-off-canvas *:not(div),
#drupal-off-canvas *:not(svg *) {
  all: initial;
}

Proposed resolution

Instead of targeting all elements that should be reset with an asterisk and excluding elements that shouldn't be targeted by using a negation selector, explicitly list all elements that should be reset. This can be changed back to an asterisk after all supported browsers support CSS selectors with multiple excluded elements in the negation selector.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

8.9 ⚰️

Component
CSSΒ  β†’

Last updated 12 days ago

Created by

πŸ‡¨πŸ‡¦Canada doublealpha

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024