Skip to content
Snippets Groups Projects
Commit 049cbda1 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Deprecate _CSS_PAGE_STYLE and config.removePageCss

Plugins can instruct the Frontend to add CSS using the
property "plugin.tx_myPlugin._CSS_DEFAULT_STYLE". This
often kicks in as soon as an extension is loaded if
this TypoScript is added by the extension as default
TypoScript. Doing this has a drawback though: If the
Frontend renders no HTML but something else - for
instance json, this default CSS can destroy the output.
In these cases, or when a Frontend integration does
not want to have the default styles applied, property
"config.removeDefaultCss" can be used to avoid loading
these plugin styles.

While "_CSS_DEFAULT_STYLE" is still widely used - for
instance by ext:fluid_styled_content and lots of TER
extensions, the sister property "_CSS_PAGE_STYLE" is
much less well known: It has the same characteristics
as "_CSS_DEFAULT_STYLE", but is meant to be used by
integrators to add additional styles on plugin level.
It's inclusion in Frontend can be suppressed using
"config.removePageCss". However, there are more elegant
ways to include CSS to the Frontend, typically using
the PAGE object properties "includeCSS" or "cssInline".

The documenation of property "_CSS_PAGE_STYLE" is also
misleading since it states the styles are only applied
when such a plugin is actively used on a page. But
this is not true.

The patch deprecates "_CSS_PAGE_STYLE" together with
its toggle-off property "config.removePageCss".

Resolves: #99050
Releases: main
Change-Id: I9863d552f7c068a053fb5d32973b46e7b9fa9219
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76542


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Froemken <froemken@gmail.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Froemken <froemken@gmail.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent f34ad54d
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment