Skip to content

Commit

Permalink
feat($core): change style convention
Browse files Browse the repository at this point in the history
'.vuepress/style.styl' ->  '.vuepress/styles/index.styl', i
'.vuepress/palette.styl' -> '.vuepress/styles/palette.styl'
  • Loading branch information
ulivz committed Sep 29, 2018
1 parent 3c430f8 commit 86736e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = (options, ctx) => ({

const themePalette = ctx.themePalette
const { palette: userPalette } = ctx.siteConfig
const palettePath = path.resolve(sourceDir, '.vuepress/palette.styl')
const palettePath = path.resolve(sourceDir, '.vuepress/styles/palette.styl')

const themePaletteContent = resolvePaletteContent(themePalette)
const userPaletteContent = resolvePaletteContent(userPalette)
Expand Down
14 changes: 3 additions & 11 deletions packages/@vuepress/core/lib/internal-plugins/style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@ module.exports = (options, context) => ({
const hasUserOverride = fs.existsSync(overridePath)

if (hasUserOverride) {
logger.tip(`${chalk.magenta('override.styl')} has been deprecated from v1.0.0, using ${chalk.cyan('config.palette')} instead.\n`)
logger.tip(`${chalk.magenta('override.styl')} has been deprecated from v1.0.0, using ${chalk.cyan('.vuepress/style/palette.styl')} instead.\n`)
}

// style.styl API.
const stylePath = path.resolve(sourceDir, '.vuepress/style.styl')
const stylePath = path.resolve(sourceDir, '.vuepress/styles/index.styl')
const hasUserStyle = fs.existsSync(stylePath)
await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : ``)

// Temporary tip, will be removed at next release.
if (hasUserOverride && !hasUserStyle) {
logger.tip(
`${chalk.magenta('override.styl')} has been split into 2 APIs, we recommend you upgrade to continue.\n` +
` See: ${chalk.magenta('https://vuepress.vuejs.org/default-theme-config/#simple-css-override')}`
)
}
await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : '')
}
})

0 comments on commit 86736e8

Please sign in to comment.