Giter Club home page Giter Club logo

Comments (25)

david1602 avatar david1602 commented on May 19, 2024 74

@stevenlordiam
this is what the bottom of my ssb-interop.js file looks like:

// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {

   // Then get its webviews
   let webviews = document.querySelectorAll(".TeamView webview");

   // Fetch our CSS in parallel ahead of time
   const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';
   let cssPromise = fetch(cssPath).then(response => response.text());

   let customCustomCSS = `
   :root {
      /* Modify these to change your theme colors: */
      --primary: #09F;
      --text: #CCC;
      --background: #080808;
      --background-elevated: #222;
   }
   div.c-message.c-message--light.c-message--hover
	{
	color: #fff !important;
	background-color: #222 !important;
	}

	span.c-message__body,
	a.c-message__sender_link,
	span.c-message_attachment__media_trigger.c-message_attachment__media_trigger--caption,
	div.p-message_pane__foreword__description span
	{
			color: #afafaf !important;
	}

	pre.special_formatting{
		background-color: #222 !important;
		color: #8f8f8f !important;
		border: solid;
		border-width: 1 px !important;
		
	}
   `

   // Insert a style tag into the wrapper view
   cssPromise.then(css => {
      let s = document.createElement('style');
      s.type = 'text/css';
      s.innerHTML = css + customCustomCSS;
      document.head.appendChild(s);
   });

   // Wait for each webview to load
   webviews.forEach(webview => {
      webview.addEventListener('ipc-message', message => {
         if (message.channel == 'didFinishLoading')
            // Finally add the CSS into the webview
            cssPromise.then(css => {
               let script = `
                     let s = document.createElement('style');
                     s.type = 'text/css';
                     s.id = 'slack-custom-css';
                     s.innerHTML = \`${css + customCustomCSS}\`;
                     document.head.appendChild(s);
                     `
               webview.executeJavaScript(script);
            })
      });
   });
});

from slack-black-theme.

Bterrell721 avatar Bterrell721 commented on May 19, 2024 3

Same issue as @kivan-mih.

david1602's fix does resolve the issue with impossible to read text and highlight issue, but the text color in the main message pane is reverted to grey and doesn't respect my color choices in the "root" section.

Any fix for that @david1602 ?

from slack-black-theme.

Arezhik avatar Arezhik commented on May 19, 2024 2

Myself and others I work with are experiencing it too.

I added the following to the let customCustomCSS to at least make it readable @david1602

` div.c-message.c-message--light.c-message--hover
{
color: #fff !important;
background-color: #222 !important;
}

span.c-message__body,
a.c-message__sender_link,
span.c-message_attachment__media_trigger.c-message_attachment__media_trigger--caption,
div.p-message_pane__foreword__description span
{
		color: #8f8f8f !important;
}

pre.special_formatting{
	background-color: #222 !important;
	color: #8f8f8f !important;
	border: solid;
	border-width: 1 px !important;
	
}`

from slack-black-theme.

david1602 avatar david1602 commented on May 19, 2024 2

@Arezhik I appreciate the effort, but you have to fix your formatting 😄

from slack-black-theme.

david1602 avatar david1602 commented on May 19, 2024

I tried but I failed badly trying to do the same thing, that helps a lot! I think an improvement label for the documentation would be appropriate.

from slack-black-theme.

stevenlordiam avatar stevenlordiam commented on May 19, 2024

Hi I had the same issue, where should I add your customCustomCSS to? @Arezhik

from slack-black-theme.

stevenlordiam avatar stevenlordiam commented on May 19, 2024

@david1602 it works for me, thank you!

from slack-black-theme.

david1602 avatar david1602 commented on May 19, 2024

@stevenlordiam you're welcome!

from slack-black-theme.

Arezhik avatar Arezhik commented on May 19, 2024

Welcome guys. I do have a my own repo based off of this CSS, you are welcome to pull from it for your cssPath variable in the same file. @david1602 @stevenlordiam

`
// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {

// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");

// Fetch our CSS in parallel ahead of time
const cssPath = "https://cdn.rawgit.com/Arezhik/slackCustomCSS/85e49edd/custom.css"
let cssPromise = fetch(cssPath).then(response => response.text());

let customCustomCSS = `
:root{
/*Modifythesetochangeyourthemecolors: */
--primary: #09F;
--text: #CCC;
--background: #080808;
--background-elevated: #222;
}`

// Insert a style tag into the wrapper view
cssPromise.then(css => {
let s = document.createElement('style');
s.type = 'text/css';
s.innerHTML = css + customCustomCSS;
document.head.appendChild(s);
});

// Wait for each webview to load
webviews.forEach(webview => {
webview.addEventListener('ipc-message', message => {
if (message.channel == 'didFinishLoading')
// Finally add the CSS into the webview
cssPromise.then(css => {
let script = let s = document.createElement('style'); s.type = 'text/css'; s.id = 'slack-custom-css'; s.innerHTML = \${css + customCustomCSS}`;
document.head.appendChild(s);
webview.executeJavaScript(script); }) }); }); });

from slack-black-theme.

Arezhik avatar Arezhik commented on May 19, 2024

Work in progress, the theme was broken for me to begin with unfortunately and didn’t work well with slack 3.0.0.

If you feel the need you can create an issue on my repository for it, so I can look into it.

from slack-black-theme.

Zoooook avatar Zoooook commented on May 19, 2024

None of those solutions worked for me, no matter whose CSS I use none of my own colors apply to anything except the far left workspace-switcher sidebar. And then I upgraded to Slack 3.0 and the whole thing is busted, back to white background. :(

from slack-black-theme.

kivan-mih avatar kivan-mih commented on May 19, 2024

Solution by david1602 works, but with two problems:

  1. Color is not applied to shared message text
  2. When scrolling message history some jittering occur.
    I have slack 3.0.5 on linux mint 18

from slack-black-theme.

Jyosua avatar Jyosua commented on May 19, 2024

I'm also experiencing the same thing as @Bterrell721 as of last night.

from slack-black-theme.

laurencee avatar laurencee commented on May 19, 2024

Slight modification to fix bot link text.

Change this

	span.c-message__body,
	a.c-message__sender_link,
	span.c-message_attachment__media_trigger.c-message_attachment__media_trigger--caption,
	div.p-message_pane__foreword__description span
	{
		color: #afafaf !important;
	}

So you end up with

	span.c-message__body,	
	a.c-message__sender_link,
	span.c-message_attachment__text,
	.c-message_attachment__field_value,
	span.c-message_attachment__media_trigger.c-message_attachment__media_trigger--caption,
	div.p-message_pane__foreword__description span
	{
		color: #afafaf !important;
	}

	.c-message_attachment__field_title
	{
		font-weight: bold;
		color: #afafaf !important;
	}

from slack-black-theme.

me21 avatar me21 commented on May 19, 2024

Another issue is that "Add reaction" button is invisible until you hover mouse cursor over it, and "View thread" link is on white background when hover. And bot messages are with light backgroud until hover.

from slack-black-theme.

kivan-mih avatar kivan-mih commented on May 19, 2024

Hmmm... since today all background became white? Does anyone has this problem?

from slack-black-theme.

laurencee avatar laurencee commented on May 19, 2024

@kivan-mih Everytime there's a new version of slack you'll have to reapply the js changes to the files in the new version folder.

from slack-black-theme.

seanpianka avatar seanpianka commented on May 19, 2024

@laurencee Applying the original changes to the "new version folder"/index.js and/or ssb-interop.js does not seem to function properly (the background of the chat is still white w/ white text).

from slack-black-theme.

laurencee avatar laurencee commented on May 19, 2024

I just started getting this too with the white background, will have to check what changed. Guess my update was delayed.

from slack-black-theme.

quietconundrum avatar quietconundrum commented on May 19, 2024

can confirm on mac, above modifications suggested for index.js and ssb-interop.js have no effect after latest update. white background has returned once again.

from slack-black-theme.

laurencee avatar laurencee commented on May 19, 2024

Well the above fixes were just mean to fix a few different styles that had been introduced/renamed. The main script is still https://github.com/widget-/slack-black-theme/blob/master/custom.css and that hasn't been updated since the repo owner disappeared.

from slack-black-theme.

d-fay avatar d-fay commented on May 19, 2024

Been trying to keep a fork of this up-to-date with latest fixes:

https://github.com/d-fay/slack-black-theme#installing-into-slack

Will soon be making more modifications and adding a bash script to automatically append the custom CSS when things break after an update.

from slack-black-theme.

Arezhik avatar Arezhik commented on May 19, 2024

div.c-virtual_list__item{
background-color: #000 !important;
}

This is the css item you can apply the color to fix the main message window color.

from slack-black-theme.

Arezhik avatar Arezhik commented on May 19, 2024

Not perfect, but here is a repo for the most recent update change. Feel free to add issues for me to fix.

https://github.com/Arezhik/slackCustomCSS

from slack-black-theme.

wickkidd avatar wickkidd commented on May 19, 2024

v3.3.1 breaks the message window styling. The sidebar styling still works.

re: https://github.com/widget-/slack-black-theme/issues/39#issuecomment-356698404

from slack-black-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.