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

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

$
0
0

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


Viewing all articles
Browse latest Browse all 295991

Trending Articles



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