All files / hyper-materialshell index.js

100% Statements 13/13
77.78% Branches 7/9
100% Functions 2/2
100% Lines 13/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371x 1x 1x   1x 4x 4x 1x 1x 2x         1x 1x   1x                             1x        
const colors = require('./colorschemes/colors.js')
const oceanicTheme = require('./colorschemes/oceanic.js')
const darkTheme = require('./colorschemes/dark.js')
 
const getColorScheme = (cfg) => {
  Eif (cfg.materialshell) {
    switch (cfg.materialshell.theme) {
      case 'oceanic': return oceanicTheme
      case 'dark': return darkTheme
      default: return darkTheme
    }
  }
}
 
const decorateConfig = (config) => {
  const theme = getColorScheme(config) || darkTheme
 
  return Object.assign({}, config, {
    cursorColor: theme.palette.red,
    cursorShape: 'UNDERLINE',
    foregroundColor: colors.foregroundColor,
    backgroundColor: theme.background,
    borderColor: colors.black,
    css: `${config.css || ''}
        .tab_tab:before {border-left: 1px solid;}
        .tab_active {background: rgba(255,255,255,0.05);}
        .tab_active:before {border-color: ${theme.palette.red};}
    `,
    colors: theme.palette
  })
}
 
module.exports = {
  decorateConfig,
  getColorScheme
}