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

Docusaurus customizations #2295

Open
slorber opened this issue Apr 28, 2022 · 5 comments
Open

Docusaurus customizations #2295

slorber opened this issue Apr 28, 2022 · 5 comments
Labels
structural Technical upgrades and changes to the docs platform itself

Comments

@slorber
Copy link

slorber commented Apr 28, 2022

Hi there, I'm the Docusaurus maintainer.

Your site has interesting customizations, and I'd like to discuss those.

In particular, noticed the custom theme components implemented by @jaredcbaum here: https://github.com/ionic-team/ionic-docs/blob/main/src/theme/

Unfortunately, this requires the ejection of a bit too much internal code.

We are trying to make such customizations simpler over time, with less code to manage on your side, and would like to discuss such opportunities with you.

Note that for the next version, we refactored a few theme components. Many large components have been split into smaller ones, so that you can more easily intersperse your own components before/after the default ones.

Please take a look and let us know if any of your use-cases now become simpler to implement, and if some further refactors could help you.


Some random bits:

  • We really want to provide a system for custom navbar item types, but your workaround seem to work fine until then (Theming: use custom components as navbar/sidebar/footer items facebook/docusaurus#7227)

  • We could refactor DocPage to allow you to more easily add your custom doc navbar

  • We could refactor DocItem more to allow you to more easily change the layout and plug your demo sandbox

  • We could add the doc meta to a React context and provide the hook so that things like editUrl in TOC do not require an extra prop

Those are just examples, open to anything as long as it's not too specific to your site and reusable by others.

Also open to knowing better which custom CSS rules are fragile and for which we could provide more stable class names

Note that we have a dedicated issue to report customization use-cases: facebook/docusaurus#5468

@jaredcbaum
Copy link
Contributor

Thanks for the message slorber! I've only looked at the new Docusaurus versions briefly, but they seem to address the majority of problems I faced when customizing the ionic docs site.

In the coming days I plan on doing a deeper dive into the latest Docusaurus beta version and I will post any related comments or concerns here or in the dedicated customization thread.

@slorber
Copy link
Author

slorber commented Apr 29, 2022

Thanks @jaredcbaum , let me know if I can help in any way ;)

@jaredcbaum
Copy link
Contributor

@slorber I left some comments on the main customization thread echoing some of the items that you mentioned here. Many of the changes that have been made already will help us going forward, thanks for all the hard work!

Also open to knowing better which custom CSS rules are fragile and for which we could provide more stable class names

I didn't mention this one in the thread because I'll need to go back through and redo many of the styles when updating to the latest Docusaurus version. I have a feeling that the better swizzling customization that has been implemented so far will eliminate the need for some styles.

We really want to provide a system for custom navbar item types

Excited for this!

This is also something that is a problem for us, but seems it's on your radar. Our current workaround includes increasing the specificity.

Definitely let me know when you need help with testing changes and whatnot, I think we'll be waiting a bit for the components api to solidify more before making changes to our current Ionic docs.

@slorber
Copy link
Author

slorber commented Jul 14, 2022

Thanks @jaredcbaum

For the last CSS insertion order, I think we'll try to use cascade layers in the future. Apparently there's already polyfill support and it works with CSS loader + postCSS so we can try using it today

Let me know if anything we can do comes to mind

@jaredcbaum
Copy link
Contributor

@slorber Just want to say I've been very impressed with the new release candidate, and haven't run into any issues using it so far! Nice work!

@ionic-team ionic-team deleted a comment from linkdao Jul 26, 2022
@liamdebeasi liamdebeasi added the triage New issues label Sep 20, 2022
@brandyscarney brandyscarney added the structural Technical upgrades and changes to the docs platform itself label Oct 11, 2022
@ionitron-bot ionitron-bot bot removed the triage New issues label Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
structural Technical upgrades and changes to the docs platform itself
Projects
None yet
Development

No branches or pull requests

4 participants