Skip to Content Skip to Menu

CB activity dark mode

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
2 years 11 months ago #326959 by activha
CB activity dark mode was created by activha
Hello

Is there a way to quickly shift to a dark template for cb activity ?

We would like to use it on a dark page in a module position and have a dark display with white text. I was wondering whether there would be a way to quickly display it in dark mode, something like bg-dark with bootstrap 5 ?

Thanks for the hint

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • OFFLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
2 years 11 months ago #326966 by beat
Replied by beat on topic CB activity dark mode
I'm not aware of such a feature, but CB Activity will follow your page template, if bootstrap 4.

Not sure if that could be of any help:
Maybe CB Template changer could help you for this:
www.joomlapolis.com/addons/cb-template-changer

It has a built-in bootstrap template builder:
www.joomlapolis.com/news/18798-cb-template-changer-4-0-with-built-in-bootstrap-template-builder

And support for bootstrap 4 variables:
www.joomlapolis.com/news/18844-cb-template-changer-5-0-with-themes-improvements

Would combining such a variable with your custom dark styling make sense ?

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
2 years 11 months ago #326992 by activha
Replied by activha on topic CB activity dark mode
Hi Beat

The issue is that all of our website is white while some pages are black.
CB Activity is nicely set to fit in the white pages with bootstrap 5 and our own template adaptations. On the black pages we would only need a way to tell CB Activity that it's dark.

I think that what you're suggesting is building a dark CB template, then use auto action to set this template to our dark pages ?

I was thinking at a bootstrap way to only add a bg-dark or something like this to cb_template. Do you know if that's feasible ?

Thanks anyway

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • OFFLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
2 years 11 months ago #326995 by beat
Replied by beat on topic CB activity dark mode
Actually your idea (building a dark CB template, then use auto action to set this template to our dark pages) could probably work too.

My suggestion was to use CB Template changer to build the CB template CSS using one or few variables (like myblacktheme, or myforegroundcolor and mybackgroundcolor). Then just integrate the result in your site template (or use the generated CB template).

Not sure what's the easiest here. As far as I know, unfortunately, browsers don't have yet a common standard for dark mode.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 11 months ago #327083 by krileon
Replied by krileon on topic CB activity dark mode
Best way to do that is to write the necessary CSS to override the colors where needed. There is no dark mode out of the box and no way to easily switch to dark mode. I recommend just using purely CSS for this. So for example you'd have a parent CSS class on the page like "page-dark" and check for that in your CSS. Example as follows.

Code:
.page-dark .cb_template { color: #fff; } .page-dark .cb_template .card { background-color: #000; } .page-dark .cb_template .text-muted { background-color: #cdcdcd !important; }

I'm guessing it'll be around 30ish lines of CSS to get things overridden to your needs.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
2 years 11 months ago #327132 by activha
Replied by activha on topic CB activity dark mode
Excellent suggestion 👍
And as we use css variables that’s great!
Thanks a lot

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum