Skip to content

Commit 86736e8

Browse files
committed
feat($core): change style convention
'.vuepress/style.styl' -> '.vuepress/styles/index.styl', i '.vuepress/palette.styl' -> '.vuepress/styles/palette.styl'
1 parent 3c430f8 commit 86736e8

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

packages/@vuepress/core/lib/internal-plugins/palette/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = (options, ctx) => ({
2626

2727
const themePalette = ctx.themePalette
2828
const { palette: userPalette } = ctx.siteConfig
29-
const palettePath = path.resolve(sourceDir, '.vuepress/palette.styl')
29+
const palettePath = path.resolve(sourceDir, '.vuepress/styles/palette.styl')
3030

3131
const themePaletteContent = resolvePaletteContent(themePalette)
3232
const userPaletteContent = resolvePaletteContent(userPalette)

packages/@vuepress/core/lib/internal-plugins/style/index.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,13 @@ module.exports = (options, context) => ({
1212
const hasUserOverride = fs.existsSync(overridePath)
1313

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

1818
// style.styl API.
19-
const stylePath = path.resolve(sourceDir, '.vuepress/style.styl')
19+
const stylePath = path.resolve(sourceDir, '.vuepress/styles/index.styl')
2020
const hasUserStyle = fs.existsSync(stylePath)
21-
await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : ``)
22-
23-
// Temporary tip, will be removed at next release.
24-
if (hasUserOverride && !hasUserStyle) {
25-
logger.tip(
26-
`${chalk.magenta('override.styl')} has been split into 2 APIs, we recommend you upgrade to continue.\n` +
27-
` See: ${chalk.magenta('https://vuepress.vuejs.org/default-theme-config/#simple-css-override')}`
28-
)
29-
}
21+
await writeTemp('style.styl', hasUserStyle ? `@import(${JSON.stringify(stylePath)})` : '')
3022
}
3123
})
3224

0 commit comments

Comments
 (0)