松弛变量可以为负吗

Slack still doesn’t have a dark mode. They have dark themes, but those only let you customize the sidebar colors, leaving the main window white. With the release of system-wide dark modes on macOS Mojave and Windows 10, Slack feels very out of place.

Slack仍然没有暗模式。 它们具有深色主题,但这些主题仅允许您自定义侧边栏颜色,而使主窗口保持白色。 随着在macOS Mojave和Windows 10上发布的系统范围内的暗模式,Slack感觉很不合适。

This method is unofficial and involves digging around in the source files for Slack. It’s fairly easy to do, but since it will be overwritten every time you update, you will have to do this multiple times.

此方法是非官方的,涉及在Slack的源文件中进行挖掘。 这很容易做到,但是由于每次更新都会被覆盖,因此您必须多次执行此操作。

下载主题 (Downloading a Theme)

Since Slack runs on Electron, a framework for developing desktop Node.js apps, you can edit the styles for it like you’d edit the CSS of a website. But the CSS files for Slack are buried in the source, so you’ll have to load your own themes.

由于Slack在Electron(用于开发桌面Node.js应用程序的框架)上运行,因此您可以像编辑网站CSS一样为其编辑样式。 但是SlackCSS文件被隐藏在源代码中,因此您必须加载自己的主题。

The most popular true dark mode theme is slack-black-theme by Widget. And since Electron shares code across platforms, this theme will work on Windows and Linux as well. We found there were some issues with the theme on macOS Mojave though, so if it doesn’t work then you can try this fork, which says it works on macOS only but may work for Windows users as well.

最受欢迎的真正黑暗模式主题是Widget的“ slack-black-theme” 。 由于Electron跨平台共享代码,因此该主题也将在Windows和Linux上运行。 我们发现macOS Mojave上的主题存在一些问题,因此,如果该主题不起作用,则可以尝试使用fork ,它说它仅适用于macOS,但也可能适用于Windows用户。

修补松弛 (Patching Slack)

This part, you’ll have to do again every time Slack updates. On macOS, you can get to Slack’s source directory by right-clicking on the app itself and selecting “Show Package Contents”. On Windows, you’ll find it at ~\AppData\Local\slack\ .

这部分,每次Slack更新时,您都必须再次执行。 在macOS上,您可以通过右键单击应用程序本身并选择“显示软件包内容”来进入Slack的源目录。 在Windows上,您可以在~\AppData\Local\slack\找到它。

Then, navigate a few folders down to resources/app.asar.unpacked/src/static/ . You’re going to want to find the ssb-interop.js file, where you’ll edit the code. Make sure Slack is closed, open that file in your favorite text editor, and scroll to the bottom:

然后,将几个文件夹导航到resources/app.asar.unpacked/src/static/ 。 您将要找到ssb-interop.js文件,您将在其中编辑代码。 确保关闭了Slack,在您喜欢的文本编辑器中打开该文件,然后滚动到底部:

Copy and paste the following code at the very end of the ssb-interop.js file:

将以下代码复制并粘贴到ssb-interop.js文件的末尾:

// 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;
}
`
// 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);
})
});
});
});

You’ll probably want to duplicate this file and save it in a different location, so you don’t have to edit the code every time. This way, you can just drag it into the directory to overwrite the newest version:

您可能需要复制此文件并将其保存在其他位置,因此您不必每次都编辑代码。 这样,您可以将其拖到目录中以覆盖最新版本:

After you’re done, reopen Slack, and after a few seconds the dark mode should kick in. The loading screen will still be white, but the main app window will blend in much better with the rest of your system:

完成后,重新打开Slack,几秒钟后,将进入黑暗模式。加载屏幕仍为白色,但主应用程序窗口将与系统的其余部分更好地融合在一起:

添加自己的主题 (Adding Your Own Themes)

If you don’t like the look of it, you can edit the CSS with any styles you want. All this code does is load custom styles from https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css; you can download that file, edit it with your changes, and replace the URL with your own code. Save, relaunch Slack, and your changes will be visible. If you don’t know CSS, or just want to make a minor change, there are four color variables defined before loading the CSS, so you can just edit those with your own colors.

如果您不喜欢它的外观,则可以使用所需的任何样式来编辑CSS。 这些代码所做的只是从https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css加载自定义样式; 您可以下载该文件,进行更改后进行编辑,然后将URL替换为自己的代码。 保存并重新启动Slack,您的更改将可见。 如果您不了解CSS,或者只是想作一些小的更改,则在加载CSS之前定义了四个颜色变量,因此您可以使用自己的颜色进行编辑。

翻译自: https://www.howtogeek.com/368976/how-to-install-the-unofficial-dark-mode-for-slack/

松弛变量可以为负吗

松弛变量可以为负吗_如何为松弛安装(非官方)暗模式相关推荐

  1. hexo博客添加暗色模式_我如何向网站添加暗模式

    hexo博客添加暗色模式 同一个网站,两种不同的配色方案 (Same website, two different color schemes) Last year I made it a point ...

  2. ios单应用模式_如何为iOS 13暗模式设置应用

    ios单应用模式 Apple launched the much-awaited iOS 13 updates globally on September 19 across all iPhones ...

  3. 全库模式 用户模式 表模式_暗模式,亮模式和用户的故事

    全库模式 用户模式 表模式 I have been working on designing a UI for an app that has individuals over the age of ...

  4. python进行数据分析需要安装哪两个库_对Python进行数据分析_关于Package的安装问题...

    一.为什么要使用Python进行数据分析? python拥有一个巨大的活跃的科学计算社区,拥有不断改良的库,能够轻松的集成C,C++,Fortran代码(Cython项目),可以同时用于研究和原型的构 ...

  5. kodi树莓派_树莓派Raspberry Pi 安装XBMC(Kodi)方法及使用教程

    树莓派Raspberry Pi 安装XBMC(Kodi)方法及使用教程4 C  i9 E$ h! o' Z) j1 w7 Y* S( } p3 _( y" h, V/ C4 P. K& ...

  6. 如何使用爱奇艺下载视频_爱奇艺怎么设置青少年模式

    很多人都使用爱奇艺,播放器家园网小编给大家分享一下如何使用爱奇艺下载视频_爱奇艺怎么设置青少年模式相关内容.爱奇艺上看视频.请好友助力.每日签到-超多互动都可以得金币!更妙的是,金币可以兑换VIP影片 ...

  7. FANUC协作机器人CRX系列_规格特点和安装调试(一)

    FANUC协作机器人CRX系列_规格特点和安装调试(一) CRX系列协作机器人目前有2种型号:CRX-10iA和CRX-10iA/L, CRX-10iA型: 该型号为标准版协作机器人,运动半径可达12 ...

  8. 什么是负边沿触发_晶闸管的导通条件是什么 晶闸管(可控硅)检测方法

    可控硅(SCR)国际通用名称为Thyyistoy,中文简称晶闸管.它能在高电压.大电流条件下工作,具有耐压高.容量大.体积小等优点.它是大功率开关型半导体器件,广泛应用在电力.电子线路中. 之前讲过了 ...

  9. yolov4负样本_了解各种挂件--帮助读懂YOLOV4

    YOLOV4在V3的基础上引进了很多挂机,了解这些挂件们,会有助于真正了解这篇文章.所以我就先从挂件开始介绍吧. Weighted-Residual-Connections 文章 weighted-r ...

最新文章

  1. 电子表单系列谈之表单数据处理
  2. 另一个小程序 返回的支付结果如何得到_所以,你想用 $8 的价格修一个bug吗?...
  3. linux区分个系统脚本
  4. Redis(1) 简介以及linux环境下的安装
  5. 陕理工高级语言程序设计实验 (C)答案,陕理工高级语言程序计实验 (C)模板.doc
  6. Java语言中提供了三个日期类_Java语言学习(5)-Java中基础封装类(日期、时间类)...
  7. linux qt5.9交叉编译,QT5.9移植
  8. vue_ form表单 v-model
  9. 企业上公有云的 10 种驱动力
  10. 【个人笔记】OpenCV4 C++ 图像处理与视频分析 08课
  11. linux集群之LVS入门和企业级实战(续一)
  12. Hadoop Hive概念学习系列之hive里的扩展接口(CLI、Beeline、JDBC)(十六)
  13. nginx 配合jersey+netty的奇怪问题
  14. Ucos操作系统任务优先级分配原则
  15. Intel 80286工作模式
  16. bpmn-js所有事件
  17. 心情是一盏温茶的宁静
  18. MAC修改印象笔记背景色
  19. Python爬取股票数据存入mysql数据库,获取股票(最新、最高、今开、成交量、成交额、量比、换手率、涨幅等)支持多线程+数据库连接池
  20. MATLAB 制作抖音同款 立体人物文字海报

热门文章

  1. 扩展屏的鼠标左右移动
  2. 跟随鼠标的弹性小球代码
  3. HDFS增加副本减少副本
  4. spring boot网上商品定制系统 毕业设计-附源码180915
  5. CREO:CREO软件之草绘【草绘】之设置、获取数据、操作、基准、草绘、编辑、约束、尺寸、检查、构造模式的使用方法之详细攻略
  6. java a201游戏_OPPO手机A201 为何下载游戏没这个机型?
  7. 【实时渲染】3DCAT实时渲染云助力游戏上云!
  8. 电脑蓝屏重启后,js文件损坏或断电重启后文件损坏
  9. js 加密与解密汇总
  10. 在线直播源码搭建直播平台的后端