Skip to content

Commit

Permalink
Clean up themes
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Jan 2, 2019
1 parent aa9e354 commit 47a9e54
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/themes/data/material.js
Expand Up @@ -6,7 +6,7 @@ const files = fs.readdirSync(path.resolve(__dirname, './material'))
files.map(f => {
const absp = path.resolve(__dirname, './material', f)

const newf = f.replace(/^Material-Theme-/, '')
const newf = f.replace(/^Material-Theme/, 'Material-Theme-')
const newp = path.resolve(__dirname, './material', newf)
fs.renameSync(absp, newp)
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions packages/themes/src/index.ts
Expand Up @@ -21,16 +21,16 @@ const vscThemes = [
]

export const materialThemes = [
'Darker-High-Contrast',
'Darker',
'Default-High-Contrast',
'Default',
'Lighter-High-Contrast',
'Lighter',
'Ocean-High-Contrast',
'Ocean',
'Palenight-High-Contrast',
'Palenight',
'Material-Theme-Darker-High-Contrast',
'Material-Theme-Darker',
'Material-Theme-Default-High-Contrast',
'Material-Theme-Default',
'Material-Theme-Lighter-High-Contrast',
'Material-Theme-Lighter',
'Material-Theme-Ocean-High-Contrast',
'Material-Theme-Ocean',
'Material-Theme-Palenight-High-Contrast',
'Material-Theme-Palenight',
]

export const niceThemes = [
Expand Down
5 changes: 3 additions & 2 deletions packages/themes/src/loadTheme.ts
Expand Up @@ -47,9 +47,10 @@ export function loadTheme(themePath: string): IShikiTheme {
const shikiTheme = toShikiTheme(theme)

if (shikiTheme.include) {
const includedThemePath = path.resolve(themePath, shikiTheme.include)
const includedThemePath = path.resolve(themePath, '..', shikiTheme.include)
const includedTheme = loadTheme(includedThemePath)
;(<any>shikiTheme).settings = theme.settings.concat(includedTheme.settings)
shikiTheme.settings = theme.settings.concat(includedTheme.settings)
shikiTheme.bg = getThemeBg(shikiTheme)
}

return shikiTheme
Expand Down
20 changes: 10 additions & 10 deletions packages/themes/src/types.ts
Expand Up @@ -14,16 +14,16 @@ export type TVSCode =
| 'solarized_light'

export type TMaterial =
| 'Darker-High-Contrast'
| 'Darker'
| 'Default-High-Contrast'
| 'Default'
| 'Lighter-High-Contrast'
| 'Lighter'
| 'Ocean-High-Contrast'
| 'Ocean'
| 'Palenight-High-Contrast'
| 'Palenight'
| 'Material-Theme-Darker-High-Contrast'
| 'Material-Theme-Darker'
| 'Material-Theme-Default-High-Contrast'
| 'Material-Theme-Default'
| 'Material-Theme-Lighter-High-Contrast'
| 'Material-Theme-Lighter'
| 'Material-Theme-Ocean-High-Contrast'
| 'Material-Theme-Ocean'
| 'Material-Theme-Palenight-High-Contrast'
| 'Material-Theme-Palenight'

export type TNice =
| 'nord'
Expand Down

0 comments on commit 47a9e54

Please sign in to comment.