1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 11:22:40 +01:00
phorge-phorge/src/infrastructure/celerity
epriestley 87ccca32b6 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`.

Reviewers: chad, btrahan

Reviewed By: chad

CC: chad, aran

Maniphest Tasks: T2146

Differential Revision: https://secure.phabricator.com/D7363
2013-10-19 14:23:19 -07:00
..
__tests__ Add printable support to CSS 2013-10-19 14:23:19 -07:00
api.php Delete license headers from files 2012-11-05 11:16:51 -08:00
CelerityAPI.php Delete license headers from files 2012-11-05 11:16:51 -08:00
CelerityPhabricatorResourceController.php Refactor developer options to specific developer-mode option. 2013-02-01 10:12:17 -08:00
CelerityResourceController.php Consolidate HTTP header access 2013-02-09 15:01:57 -08:00
CelerityResourceGraph.php Delete license headers from files 2012-11-05 11:16:51 -08:00
CelerityResourceMap.php Delete license headers from files 2012-11-05 11:16:51 -08:00
CelerityResourceTransformer.php Add printable support to CSS 2013-10-19 14:23:19 -07:00
CeleritySpriteGenerator.php Add an icon+background selector for project images 2013-10-17 09:32:34 -07:00
CelerityStaticResourceResponse.php Disallow <! in <script> 2013-10-16 09:28:37 -07:00
map.php Delete license headers from files 2012-11-05 11:16:51 -08:00