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

Aggregate and compress CSS files removes some essential whitespace

$
0
0

I'm running into an issue with Drupal's CSS compression method and an attribute selector I've created for images. This is a sample of my CSSselector:

img[align="right"],
img[style*="float: right"],
img[style*="float:right"]{
padding-left:5px;
}

All this is doing is simply adding some left padding onto images aligned to the right side of the screen. As you can see, I have two selectors for floated images, one with a space after the colon and one without. This space is essential for the selector to match. For example, if I have an image on a page like the example below only my selector with a space will match it:

<img src="/my-image.jpg" style="width: 200px; height: 150px; float: right;" />

However, after I run my CSS file through the CSS compression in Drupal, this is what my style ends up looking like:

img[align="right"],img[style*="float:right"],img[style*="float:right"]{padding-left:5px}

As you can see the compressor has removed the space from my selector. I would think that because the space was inside quote marks it would have been preserved but that is not the case. Any chance this could be easily fixed?


Viewing all articles
Browse latest Browse all 291123

Trending Articles



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