Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16998

CSS style for BBCodes



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


      Following the update of the text-formatter to its latest version in phpBB 3.3.5...
      ...and JoshyPHP's comment regarding the <style> element not allowed any more in BBCodes...
      ...I have a suggestion.

      Indeed, 3Di's workaround (to move the style code to inline style) works fine in some cases...
      ...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.


        Issue Links



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