MyBB Community Forums

Full Version: How to allow colours in codebox?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have solved almost all my problems in this thread : https://community.mybb.com/thread-237225.html

Now my new question comes is how can I allow colour to be added to the codebox?

Like by default it is not allowing me to add colour to the context inside the code box so How am I suppose to do that? Or is there a way to change the colour of the code text to a brighter one like globally and change the dafault low-brightness colour of my codebox texts>?

Thanks in advance
(2022-12-23, 03:17 PM)Taylor M Wrote: [ -> ]Auto based on code type: https://community.mybb.com/mods.php?acti...w&pid=1067

Any other way to do it? I don't wish to add another plugin
(2022-12-24, 07:20 PM)expertful Wrote: [ -> ]
(2022-12-23, 03:17 PM)Taylor M Wrote: [ -> ]Auto based on code type: https://community.mybb.com/mods.php?acti...w&pid=1067

Any other way to do it? I don't wish to add another plugin
A serious plugin like this one is nothing you have to be afraid for.
All the [code] tag does it wrap the contents in a <code> HTML tag, so there's no way to style that without additional code to tell it how to style it.
(2022-12-24, 07:36 PM)SvePu Wrote: [ -> ]
(2022-12-24, 07:20 PM)expertful Wrote: [ -> ]
(2022-12-23, 03:17 PM)Taylor M Wrote: [ -> ]Auto based on code type: https://community.mybb.com/mods.php?acti...w&pid=1067

Any other way to do it? I don't wish to add another plugin
A serious plugin like this one is nothing you have to be afraid for.

I know that but I just don't wish to add more plugins to the board. Already a lot of them..

(2022-12-24, 08:17 PM)Matt Wrote: [ -> ]All the [code] tag does it wrap the contents in a <code> HTML tag, so there's no way to style that without additional code to tell it how to style it.

I meant isn't there a way to add a line to the global.css to change the text colour of the codebox?
Oh, for a single colour, then yes just add whatever CSS you want for the code tag

code {
    background: #333;
    color: #fff;
}
Works for normal code tags as Matt said, but thing about that codes in php tag are inline styled by class_parser.php.