Permalink
Browse files

Use decorateConfig

  • Loading branch information...
1 parent b1a8372 commit 5cd5a8fc604eba2fff82b97cda15f2f283dccf08 @jxnblk committed Jul 16, 2016
Showing with 29 additions and 11 deletions.
  1. +29 −11 index.js
View
@@ -2,6 +2,7 @@
const backgroundColor = '#220000'
const foregroundColor = '#ff3300'
const cursorColor = foregroundColor
+const borderColor = 'rgba(255, 0, 0, .25)'
const colors = [
backgroundColor,
@@ -22,16 +23,33 @@ const colors = [
foregroundColor
]
-exports.middleware = (store) => (next) => (action) => {
- switch (action.type) {
- case 'CONFIG_LOAD':
- case 'CONFIG_RELOAD':
- action.config.foregroundColor = foregroundColor
- action.config.backgroundColor = backgroundColor
- action.config.cursorColor = cursorColor
- action.config.colors = colors
- console.log('H Y P E R T E R M I N A T O R')
- }
- next(action)
+exports.decorateConfig = config => {
+ console.log('H Y P E R T E R M I N A T O R')
+
+ return Object.assign({}, config, {
+ foregroundColor,
+ backgroundColor,
+ borderColor,
+ cursorColor,
+ colors,
+ termCSS: `
+ ${config.termCSS || ''}
+ .cursor-node {
+ mix-blend-mode: difference;
+ }
+ `,
+ css: `
+ ${config.css || ''}
+ .tab_tab {
+ color: ${foregroundColor} !important;
+ background-color: ${backgroundColor};
+ }
+ .tab_tab.tab_active {
+ font-weight: bold;
+ color: ${backgroundColor} !important;
+ background-color: ${foregroundColor};
+ }
+ `
+ })
}

0 comments on commit 5cd5a8f

Please sign in to comment.