Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16998

CSS style for BBCodes

    XMLWordPrintable

Details

    • Improvement
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 4.0.0-a1, 3.3.7
    • None
    • BBCode Engine
    • None

    Description

      Following the update of the text-formatter to its latest version in phpBB 3.3.5...
      https://tracker.phpbb.com/browse/PHPBB3-16867
      ...and JoshyPHP's comment regarding the <style> element not allowed any more in BBCodes...
      https://tracker.phpbb.com/browse/PHPBB3-16884?focusedCommentId=64625&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-64625
      ...I have a suggestion.

      Indeed, 3Di's workaround (to move the style code to inline style) works fine in some cases...
      https://tracker.phpbb.com/browse/PHPBB3-16884?focusedCommentId=64626&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-64626
      ...but it can't when the CSS code involves pseudo-elements.
      Another side effect would be to prevent from using classes to shorten the code and ease the maintenance & personalisation.

      So an alternative could be to remove the CSS code from the BBCode and copy/paste it manually into a stylesheet, like common.css, or directly in the header.

      But this is something we all try to avoid nowadays.
      It was all the purpose of moving from Mods to Extensions, to stop modifying phpBB core files.

      Then, the only other alternative is to transform those BBCodes into Extensions.
      But it looks like a bit too much to leave the BBCode engine and the easiness of setting up  BBCodes in the ACP just to fix a CSS code location. It's also a heavy process and I'm not sure all BBCode authors affected by the issue will have the skills and will to do it.

      So here is my suggestion: why not adding a "BBCode CSS style" field in the BBCode setting page?

      BBCode authors would have the possibility to:

      • keep using the ACP and BBCode engine for their BBCodes
      • keep using CSS for pseudo-elements
      • keep using CSS classes in their code to shorten it and ease the maintenance & personalisation
      • they would just need to copy/paste the CSS associated to their BBCode in this new field
      • and this CSS would be automatically loaded by phpBB in the header

      What do you think about this option?
      To me, it looks like the easiest option to fix the consequences of the ban of the <style> element in BBCodes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              -=ET=- -=ET=-
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: