Add Shiki's defaultColor
option to <Code />
component
#11391
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Adds Shiki's
defaultColor
option to the<Code />
componentNote
Because most of the work has been done by #11341, this PR is a partial implementation and depends on #11341 to work properly. Therefore this PR should be merged together with #11341, or alternatively let #11341 inherit this PR's changes and close this PR. (Pinging @madcampos for the heads up)
This PR comes from withastro/roadmap#897
Testing
Not sure how to make automated tests
I've published a testing branch. The tests are located at examples/component-code. They test all possible values of
defaultColor
How to run the example:
pnpm install
pnpm run dev
pnpm --filter @example/component-code run dev
in a new shellDocs
/cc @withastro/maintainers-docs for feedback!
The docs certainly needs to be updated as this exposes a new option of
<Code />
component for users to play with.I also would like some feedback on the overall tone and structure of JSDocs on the
defaultColor
option in<Code />
component