Page MenuHomePhabricator

Add printable support to CSS
ClosedPublic

Authored by epriestley on Oct 19 2013, 8:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 1:53 AM
Unknown Object (File)
Tue, Apr 16, 5:50 PM
Unknown Object (File)
Sat, Apr 6, 7:21 AM
Unknown Object (File)
Mar 19 2024, 1:43 AM
Unknown Object (File)
Mar 12 2024, 12:55 AM
Unknown Object (File)
Mar 12 2024, 12:55 AM
Unknown Object (File)
Mar 12 2024, 12:54 AM
Unknown Object (File)
Mar 12 2024, 12:54 AM
Subscribers

Details

Reviewers
btrahan
chad
Maniphest Tasks
Restricted Maniphest Task
Commits
Restricted Diffusion Commit
rP87ccca32b66f: Add printable support to CSS
Summary

Fixes T2146. This is a really simple approach, you just do:

!print .rule {
  whatever: blah;
}

And it transforms it into:

.printable .rule {
  whatever: blah;
}

@media print {
  .rule {
    whatever: blah;
  }
}

So we end up with these rules twice, but they should compress well and we shouldn't need that many of them, and this fix is way way simpler than all the nonsense I discussed in T2146.

Test Plan
  • Added a unit test.
  • Added a simple rule to throw away the menubar when printing.
  • Checked the latter with /?__print__=1.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped