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

New default theme #57

Open
5 tasks
azu opened this issue Jun 22, 2020 · 8 comments · Fixed by #365
Open
5 tasks

New default theme #57

azu opened this issue Jun 22, 2020 · 8 comments · Fixed by #365
Labels
Type: Theme Theme related

Comments

@azu
Copy link
Member

azu commented Jun 22, 2020

We consider to new default theme.
Probably, @honkit/honkit-plugin-theme-default(current theme) is still existing in the future for compatiblity.

We want to opt-in new default theme.
It is probably a mechanism that is enabled by adding some settings to book.json.

Releated idea: label:"Type: Theme"

Purpose

  • Fast
  • Stable
  • Extensible

Changes from current default theme

TODO

  • Built-in Search
  • Plugin Compatibility
    • It will probably never be fully compatible. It will provide alternative functions.
  • Opt-in Switch
  • Async Loading for INP
  • View Transition API support?

Usage

@azu azu added the Type: Theme Theme related label Jun 22, 2020
@azu
Copy link
Member Author

azu commented Aug 26, 2020

@symbiogenesis
Copy link

Should use the prefers-color-scheme media query to set the default color scheme via CSS

@azu
Copy link
Member Author

azu commented Jul 31, 2023

We have added @honkit/honkit-plugin-theme as experimental.
https://honkit.netlify.app/ it-self use this theme.

This is WIP.
This PR has removed all but what is necessary.
As a results,

  • JS: 50kb + 50kb → 1.6kb
  • CSS: 10kb + 2kb → 4kb+2kb

TODO

  • Search Plugin
  • Use CSS Variables
    • Probably, drop to use less
  • Think plugin systems
    • Import maps will be suitable to this situation, I think
  • Support Async Plugin Loading
  • Island Architecture guideline

@jeffrey-ng
Copy link

Was wondering if you had some pointers on how one could test this theme out on their own honkit setup?

I'm looking to removing the jquery dependency as I'm running into some CSP issues with the default theme.

@azu
Copy link
Member Author

azu commented Aug 28, 2023

@jeffrey-ng Please note that this is still experimental and therefore quite unstable.
(Probably Breaking changes are also made in the PATCH version.)

  1. install theme
npm @honkit/honkit-plugin-theme -D
  1. change plugins in book.json
plugins: ["-theme-default", "-search", "-lunr", "-fontsettings", "@honkit/honkit-plugin-theme"]
  • honkit/book.js

    Line 11 in d058ddf

    plugins: ["-theme-default", "-search", "-lunr", "-fontsettings", "@honkit/honkit-plugin-theme"]

@jeffrey-ng
Copy link

jeffrey-ng commented Aug 28, 2023

Please note that this is still experimental and therefore quite unstable.

100% understand.

Assuming this should be npm install @honkit/honkit-plugin-theme -D?

Had tried this originally but doesn't look like the package is published publicly.

✗ npm install @hontkit/hontkit-plugin-theme -D
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@hontkit%2fhontkit-plugin-theme - Not found
npm ERR! 404
npm ERR! 404  '@hontkit/hontkit-plugin-theme@*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

@azu
Copy link
Member Author

azu commented Aug 28, 2023

Ah, I forgot to publish to npm.

I've published @honkit/honkit-plugin-theme to npm.

https://github.com/honkit/honkit/releases/tag/v5.1.0

@azu azu mentioned this issue Aug 28, 2023
@azu
Copy link
Member Author

azu commented Jan 17, 2024

Pagefind is suitable for new search engine.

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

Successfully merging a pull request may close this issue.

3 participants