diff options
| author | 2013-11-25 21:31:00 +0100 | |
|---|---|---|
| committer | 2013-11-25 21:31:00 +0100 | |
| commit | c8a7913f79955e284288468ef88adc90aa788c50 (patch) | |
| tree | 2e0e23131f267f188c266e697494081bf97e7e36 | |
| parent | 03081fe9a21a3746ba3dac689f449b7ff3254f95 (diff) | |
Page Speed : bouge le style 'print' dans la CSS principale
Bouge le petit style dédié à l'impression dans la CSS principale, pour
de meilleures performances, et aussi pour permettre aux thèmes de
changer le rendu à l'impression.
Au passage, ajout de `@charset "UTF-8";` en tête de CSS
| -rw-r--r-- | app/App_FrontController.php | 1 | ||||
| -rwxr-xr-x | lib/minz/View.php | 5 | ||||
| -rw-r--r-- | public/themes/default/freshrss.css | 39 | ||||
| -rw-r--r-- | public/themes/default/global.css | 2 | ||||
| -rw-r--r-- | public/themes/flat-design/freshrss.css | 39 | ||||
| -rw-r--r-- | public/themes/flat-design/global.css | 2 | ||||
| -rw-r--r-- | public/themes/printer/style.css | 34 |
7 files changed, 85 insertions, 37 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 1f270c0b1..40e31f549 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -65,7 +65,6 @@ class App_FrontController extends FrontController { View::appendStyle (Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file))); } } - View::appendStyle (Url::display ('/themes/printer/style.css?' . @filemtime(PUBLIC_PATH . '/themes/printer/style.css')), 'print'); if (login_is_conf ($this->conf)) { View::appendScript ('https://login.persona.org/include.js'); diff --git a/lib/minz/View.php b/lib/minz/View.php index fd92762b3..12202542f 100755 --- a/lib/minz/View.php +++ b/lib/minz/View.php @@ -150,8 +150,9 @@ class View { $styles .= '<!--[if ' . $cond . ']>'; } - $styles .= '<link rel="stylesheet" media="' . $style['media'] - . '" href="' . $style['url'] . '" />'; + $styles .= '<link rel="stylesheet" ' . + ($style['media'] === 'all' ? '' : 'media="' . $style['media'] . '" ') . + 'href="' . $style['url'] . '" />'; if ($cond) { $styles .= '<![endif]-->'; diff --git a/public/themes/default/freshrss.css b/public/themes/default/freshrss.css index 7d30c1806..468f18dc8 100644 --- a/public/themes/default/freshrss.css +++ b/public/themes/default/freshrss.css @@ -1,3 +1,5 @@ +@charset "UTF-8"; + /* STRUCTURE */ .header { display: table; @@ -820,3 +822,40 @@ -ms-transition: width 200ms linear; } } + +@media print { + .header, + .aside, + .nav_menu, + .day, + .flux_header, + .flux_content .bottom, + .pagination { + display: none; + } + + html, body { + background: #fff; + color: #000; + font-family: Serif; + font-size: 12pt; + } + + #global, + .flux_content { + display: block !important; + } + + .flux_content .content { + width: 100% !important; + text-align: justify; + } + + .flux_content .content a { + color: #000; + } + .flux_content .content a:after { + content: " (" attr(href) ") "; + text-decoration: underline; + } +} diff --git a/public/themes/default/global.css b/public/themes/default/global.css index 2004a1936..1c554d2dc 100644 --- a/public/themes/default/global.css +++ b/public/themes/default/global.css @@ -1,3 +1,5 @@ +@charset "UTF-8"; + /* FONTS */ @font-face { font-family: "OpenSans"; diff --git a/public/themes/flat-design/freshrss.css b/public/themes/flat-design/freshrss.css index 04c61085b..c2e824c22 100644 --- a/public/themes/flat-design/freshrss.css +++ b/public/themes/flat-design/freshrss.css @@ -1,3 +1,5 @@ +@charset "UTF-8"; + /* STRUCTURE */ body { background: #fafafa; @@ -752,3 +754,40 @@ body { -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); } + +@media print { + .header, + .aside, + .nav_menu, + .day, + .flux_header, + .flux_content .bottom, + .pagination { + display: none; + } + + html, body { + background: #fff; + color: #000; + font-family: Serif; + font-size: 12pt; + } + + #global, + .flux_content { + display: block !important; + } + + .flux_content .content { + width: 100% !important; + text-align: justify; + } + + .flux_content .content a { + color: #000; + } + .flux_content .content a:after { + content: " (" attr(href) ") "; + text-decoration: underline; + } +} diff --git a/public/themes/flat-design/global.css b/public/themes/flat-design/global.css index c53ec863c..8cf6412b3 100644 --- a/public/themes/flat-design/global.css +++ b/public/themes/flat-design/global.css @@ -1,3 +1,5 @@ +@charset "UTF-8"; + /* FONTS */ @font-face { font-family: "OpenSans"; diff --git a/public/themes/printer/style.css b/public/themes/printer/style.css deleted file mode 100644 index 87d019c58..000000000 --- a/public/themes/printer/style.css +++ /dev/null @@ -1,34 +0,0 @@ -.header, -.aside, -.nav_menu, -.day, -.flux_header, -.flux_content .bottom, -.pagination { - display: none; -} - -html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; -} - -#global, -.flux_content { - display: block !important; -} - -.flux_content .content { - width: 100% !important; - text-align: justify; -} - -.flux_content .content a { - color: #000; -} -.flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; -}
\ No newline at end of file |
