Inline css should be combined per media type.

Comments

casey’s picture

StatusFileSize
new2.32 KB

Wrong patch.

Status: Needs review » Needs work

The last submitted patch failed testing.

casey’s picture

StatusFileSize
new1.74 KB

grmbl

casey’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch failed testing.

casey’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB
rfay’s picture

Please add more information so that everybody will understand the whole context. Give an example of the problem and explain what you expect, what happens, and why what happens is wrong.

Subscribing, thanks.

casey’s picture

$css = <<<EOS
body {
  background: drupalblue;
}
EOS;

drupal_add_css($css, 'inline');

$css = <<<EOS
body {
  background: #fff;
}
EOS;

drupal_add_css($css, array('type' => 'inline', 'media' => 'print');

Currently this results in:

<style type="text/css">
body {
  background: drupalblue;
}
body {
  background: #fff;
}
</style>

But it should be:

<style type="text/css">
body {
  background: drupalblue;
}
</style>
<style type="text/css" media="print">
body {
  background: #fff;
}
</style>
casey’s picture

StatusFileSize
new3.31 KB

Patch with test.

Issue tags: -CSS aggregation

Re-test of cssinlinemedia.patch from comment #9 was requested by casey.

casey’s picture

#9: cssinlinemedia.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +CSS aggregation

The last submitted patch, cssinlinemedia.patch, failed testing.

casey’s picture

Status: Needs work » Fixed

Looks like we group inline css on their media type since #228818: IE: Stylesheets ignored after 31 link/style tags.

Status: Fixed » Closed (fixed)
Issue tags: -CSS aggregation

Automatically closed -- issue fixed for 2 weeks with no activity.