ionic-team / ionic-docs

https://ionicframework.com/docs
Apache License 2.0
584 stars 3k forks source link

Docusaurus customizations #2295

Open slorber opened 2 years ago

slorber commented 2 years ago

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:

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: https://github.com/facebook/docusaurus/discussions/5468

jaredcbaum commented 2 years ago

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 commented 2 years ago

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

jaredcbaum commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

@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!