Review main Merged

76542[TASK] Deprecate _CSS_PAGE_STYLE and config.removePageCss

Christian Kuhn CR +2 V +2 Normal +87 −5 updated 11/10/22, 15:40

Commit message

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".

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Froemken +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Froemken +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1317

  1. Christian Kuhn uploaded patch set 1 11/10/22, 13:22

  2. Christian Kuhn voted on patch set 1 CR -1 11/10/22, 13:22

  3. core-ci voted on patch set 1 V +1 11/10/22, 13:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33493

  4. Christian Kuhn uploaded patch set 2 11/10/22, 14:21

  5. core-ci voted on patch set 2 V +1 11/10/22, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33496

  6. Stefan Froemken voted on patch set 2 V +1 CR +1 11/10/22, 14:33

  7. Christian Kuhn uploaded patch set 3 11/10/22, 14:33

  8. core-ci voted on patch set 3 V +1 11/10/22, 14:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33497

  9. Stefan Froemken commented on patch set 3 V +1 CR +1 11/10/22, 15:14

    Deprecation entry will be logged, yes, but because of PHP 8 using _CSS_PAGE_STYLE the implode function will throw an Argument exception. That's not a problem with THIS patch. It's a problem since over 3 years. IMO _CSS_PAGE_STYLE is broken for a very long time as implode will return NULL, if 2nd Argument is string. So, removing that feature is also an option for me.
  10. Christian Kuhn uploaded patch set 4 11/10/22, 15:16

  11. Christian Kuhn commented on patch set 4 11/10/22, 15:18

    Reply

    yeah. just figured this as well. i fixed the warning in v12 now but skipped a v11 backport on this ... in case anyone runs into this, we can still have a dedicated v11 fix for this.
  12. core-ci voted on patch set 4 V +1 11/10/22, 15:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33506

  13. Benni Mack voted on patch set 4 V +1 CR +1 11/10/22, 15:38

  14. Stefan Froemken commented on patch set 4 11/10/22, 15:38

    If just config.removePageCss is 1 (without any _CSS_PAGE_STYLE) no deprecation log will be written. But that's OK for me.
  15. Stefan Froemken voted on patch set 4 V +1 CR +1 11/10/22, 15:38

  16. Christian Kuhn voted on patch set 4 V +2 CR +2 11/10/22, 15:40

  17. Christian Kuhn merged patch set 5 11/10/22, 15:40