Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Reusable theme scalability support #901

Open
linbudu599 opened this issue Apr 3, 2024 · 2 comments
Open

[Feature]: Reusable theme scalability support #901

linbudu599 opened this issue Apr 3, 2024 · 2 comments

Comments

@linbudu599
Copy link
Contributor

linbudu599 commented Apr 3, 2024

What problem does this feature solve?

Currently (from the documentation) rspress only supports extensions that create theme folders in the current directory, and does not support loading theme extensions from npm packages, which prevents the community from sharing theme packages such as rspress-theme-xxx for the rspress ecosystem.

What does the proposed API look like?

The intended API should consist of two parts:

  • New theme configuration items.
  • support for loading theme components from npm packages.
import * as path from 'path';
import { defineConfig } from 'rspress/config';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  theme: 'rspress-theme-blog',
  // should support extending types from theme package
  themeConfig: { },
});

Some additional things: Themes should normally be a superset of plugins, so plugins in the theme should also be able to be loaded properly.

@sanyuan0704
Copy link
Collaborator

Nice features! That's what we are going to support. Thanks your feedback. We will design the theme npm package exports and support loading theme package in this month.

@Timeless0911
Copy link
Collaborator

It's a big feature and we should also implement theme inheritance
like https://vuepress.vuejs.org/theme/inheritance.html#theme-inheritance do.

May be it will be implemented in 2.0 refactor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants