Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Skins and themes support

Open Sing-Li opened this issue 11 years ago • 53 comments

Make it possible to 'white label' Rocket.Chat.

Should not need to know Meteor or JavaScript to become a skin/theme artist.

Embrace a mini-industry of Rocket.Chat themes and skins creators.

TEST for success: When we see a themed Rocket.Chat in the wild, but we're not certain if it is really Rocket.Chat :)

Sing-Li avatar Jul 07 '15 17:07 Sing-Li

Depends on RocketChat/Rocket.Chat#222

engelgabriel avatar Jul 07 '15 20:07 engelgabriel

Please somehow add the following:

RocketChat.theme.setPublicColor "primary-background-color", "#000000"

When creating a theme package it is not possible to override these settings (w/o having to go into the admin console itself), I understand the need to adjust this @ runtime via the admin panel but it would be nice to just be able to setX on the themes as well via a custom package @ startup.

jonbaer avatar Nov 18 '15 20:11 jonbaer

@jonbaer you can do this:

RocketChat.settings.add("theme-color-primary-background-color", "#04436a");

On you package, but must be added BEFORE the theme package.

Or even set that as an environment variable or Meteor.settings.

See /packages/rocketchat-lib/server/functions/settings.coffee for reference:

RocketChat.settings.add = (_id, value, options = {}) ->
    # console.log '[functions] RocketChat.settings.add -> '.green, 'arguments:', arguments

    if not _id or not value?
        return false

    options.packageValue = value
    options.valueSource = 'packageValue'
    options.ts = new Date
    options.hidden = false

    if process?.env?[_id]?
        value = process.env[_id]
        options.processEnvValue = value
        options.valueSource = 'processEnvValue'

    else if Meteor.settings?[_id]?
        value = Meteor.settings[_id]
        options.meteorSettingsValue = value
        options.valueSource = 'meteorSettingsValue'

    if not options.i18nLabel?
        options.i18nLabel = _id

    # Default description i18n key will be the setting name + "_Description" (eg: LDAP_Enable -> LDAP_Enable_Description)
    if not options.i18nDescription?
        options.i18nDescription = "#{_id}_Description"

    return RocketChat.models.Settings.upsert { _id: _id },
        $set: options
        $setOnInsert:
            value: value
            createdAt: new Date

engelgabriel avatar Dec 04 '15 12:12 engelgabriel

I understand this, but what I was trying to avoid was having to rename "rocketchat:theme" and add my own values and instead have it to where I could keep "rocketchat:theme" package and (somehow) have my own "mycompany:theme" package which would override the setting values. It would be great to have a way to let the official rocketchat packages load first + then have secondary packages overlay but I understand this is not possible in Meteor(?) ...

jonbaer avatar Dec 04 '15 16:12 jonbaer

You can set the variable later too.. but that way, you will reset it to your package value everytime you restart the app... what may be acceptable in some cases.

RocketChat.settings.updateById("theme-color-primary-background-color", "#04436a");

engelgabriel avatar Dec 04 '15 18:12 engelgabriel

Re-opening in the light of recent discovery that our existing implementation of theme is completely different than the community's view of what a user-loadable theme should be.

Reference RocketChat/Rocket.Chat#2102 and RocketChat/feature-requests#635

Also - see themes for

Sing-Li avatar Feb 04 '16 18:02 Sing-Li

I think those are two separate things. How to skin (CSS) and how to theme (change HTML).

I think Rocket.Chat should just provide skinning, but theming can be done later. For now one could use things like template extension package to override themes.

Or would you provide something like autoform where are templates can be configured?

mitar avatar Feb 04 '16 18:02 mitar

(Maybe time to move to Blaze Components.)

mitar avatar Feb 04 '16 18:02 mitar

:smile_cat: If we take a look at the thriving marketplace eco-systems for Wordpress, Ghost, and Drupal themes ... the industry's term for changing the look of a system seems to be generic 'theme' - I'd suggest regardless of technical correctness.

It would be good to get input from some in-the-trench theme design/modification folks from the other systems. Like on the other linked issues.

Sing-Li avatar Feb 04 '16 19:02 Sing-Li

I think there's even another subset... Slack calls changing the sidebar colors a "theme":

image

The color swaps are nice, but very limited; you can't customize the looks of anything else. This only affects the sidebar.


I can see three main ways to allow styling:

  • Allow Slack-esque color swaps in the base style, perhaps with a few built-in themes; easy for general users to tinker with things. I would not call this a theme; maybe "color scheme"?
  • Allow custom CSS skinning like @mitar mentioned; this allows for incredible style overhauls, especially when the markup is well-organized and classes make sense. I'd call this "theme". Perhaps themes could have multiple color schemes to choose from, if the author created multiple versions, but I don't think I'd allow general users to edit the colors in a theme, only choose from available color scheme options. Writing CSS in a way that you could easily color-swap could work with some layouts but is limiting.
  • Changing the markup itself could be a "template"; this would be the ultimate for white labeling, but also require the most work to set up. Each template would need a template-specific theme, since with changed markup, we can't rely on the same structures and nesting for CSS and themes for other templates will likely break.

CSS theming alone make font, color, and layout easy to change. I've worked on several systems with awful, awful markup that couldn't be edited, and you'd be surprised how much you can accomplish with CSS alone.

stephymiehle avatar Feb 04 '16 21:02 stephymiehle

CSS theming alone make font, color, and layout easy to change. I've worked on several systems with awful, awful markup that couldn't be edited, and you'd be surprised how much you can accomplish with CSS alone.

And as an open source project people can always make pull request to add classes and other CSS related stuff to the theme if needed.

mitar avatar Feb 05 '16 07:02 mitar

As @Sing-Li said it will open whole new mini marketplace for RC themes.

I really cant wait to see that coming out, but I guess its pretty early yet to working on theme engine.

Anyway, when this happen, I would be glad to create unqiue theme for RC and share with community.

Peace,

shtefcs avatar Apr 14 '16 20:04 shtefcs

Is there any chance this will also skin the chat window background? I'd like to eventually create a dark theme for the whole window, not just the sidebar

jseadragon avatar Apr 25 '16 15:04 jseadragon

Yes, 100% of the colours used on the UI will be configurable.

engelgabriel avatar Apr 25 '16 16:04 engelgabriel

for those that do not want to wait for this and would like a night theme, you could use this css and javascript to add a button to the flex tab bar which turns on a night theme: CSS: https://gist.github.com/lucasvanhalst/1aff04d33a826afd2600696332c1c5ee JS: https://gist.github.com/lucasvanhalst/35dcffa5cbfd704825debc4e83a2e30f It's far from perfect but it's usable for now :stuck_out_tongue: It's also assuming the sidebar is set to a dark-ish colour It looks like this: https://i.imgur.com/10YW5ou.png

lucasvanhalst avatar Apr 26 '16 17:04 lucasvanhalst

This is really nice :). gj

shtefcs avatar Apr 26 '16 19:04 shtefcs

Is there any update on how to modify the theme, for example changing default logos and background-color?

freeredpill avatar May 16 '16 00:05 freeredpill

@freeredpill you can change most colours via the admin panel.

engelgabriel avatar May 19 '16 05:05 engelgabriel

@engelgabriel I'm not confident the admin panel colour approach works. See RocketChat/Rocket.Chat#2347. There's inconsistent implementation of the settings within less files, so you can override some, but others are fixed, so its impossible to do more than minor tweaks that way, definitely can't produce any kind of overall "skin".

I've been hacking theme system through my own custom meteor package, adding less assets and replacing some templates using another meteor template package.

I'm working toward a theme framework approach that could maintain a path where child-theme folders can be added, to dynamically load a set a of less files, template replacements and execute some custom hooks, the way Wordpress theme functions.php works. My current version is very hacky but I'd be happy to share my approach with anyone else working on this.

Maybe some others would like to set up a working group to discuss further and share resources? I'd also suggest consolidating the other issues around this into this one. Includes: RocketChat/Rocket.Chat#2347, RocketChat/Rocket.Chat#1944, RocketChat/Rocket.Chat#2102.

timkinnane avatar May 31 '16 02:05 timkinnane

+1 for @timkinnane suggestion for theme/skin framework. Tim, would love to learn more, participate and share resources

bjoseph1 avatar Jun 08 '16 02:06 bjoseph1