Bug #21966
closed_CSS_DEFAULT_STYLE
0%
Description
I was just wondering why the following is hardcoded in the source:
public function addCssFile($file, $rel = 'stylesheet', $media = 'screen', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') {
if (!isset($this->cssFiles[$file])) {
$this->cssFiles[$file] = array (
'rel' => $rel,
'media' => $media,
'title' => $title,
'compress' => $compress,
'forceOnTop' => $forceOnTop,
'allWrap' => $allWrap
);
}
}
Everytime I write css through _CSS_DEFAULT_STYLE in my extensions the media is set to screen - I need to set the media to "screen,print" or "all" for my printviews to look nice.
Is the only solution to XCLASS??
(issue imported from #M13252)
Files
Updated by Ralf Hettinger almost 15 years ago
I can confirm this, it has been introduced by #20661 (svn rev 5903; huge commit).
This bug report should imo be set to major (and maybe its title could be a bit more speaking): there is a major change of behaviour introduced by commit 5903 which will break a lot of print views (actually anything other than screen views) relying on CSS after an update to 4.3.
Summary of the change of behaviour: Most CSS styles are now by default only valid for media screen, whereas in TYPO3 4.2 they would've been implicitly valid for all media.
This affects:
- CSS from TYPO3 Core+extensions if TS config.inlineStyle2TempFile is set
- CSS included by TS page.includeCSS and page.stylesheet
There is currently no possible 'undo' of this change if TS config.inlineStyle2TempFile is set.
The attached patch adds the new TS properties as descrbed for page.includeCSS to TS properties page.stylesheet and config.inlineStyle2TempFile and sets the default to media 'all' for the 3 properties.
Updated by Raffi no-lastname-given almost 15 years ago
Same problem encountered here - while for custom CSS, it can be solved by overwriting the default "media=screen" with "media=all", this cannot be set for the automatically generated CSS.
The alternative (besides PHP bugfixing) are the header inline styles, which is not something I'd like to implement -> too much source code.
Is this bug planned to be resolved with the next core version?
Updated by Sebastian Mazza almost 15 years ago
realy mean bug. I updated a site to 4.3.1 everything looks great, print pages too, but i didn't test printing them...
Thanks to Ralf Hettinger for the patch!
Updated by Christian Clemens over 14 years ago
I can confirm: Since 4.3 e.g. images in print view do not longer flow as they did in 4.2.x., because standard CSS of TYPO3 is limited to screen. There should be a possibility to define media for included standard CSS via TS.
Workaround: I set it it hardcoded in typo3_src-4.3.1/t3lib from "screen" to "screen, print" - but this is no solution. Didn't test the patch, but if it works, it should be integrated in core as soon as possible.
Updated by Steffen Kamper over 14 years ago
Committed to svn,
4_3 rev 6959
trunk rev 6960