-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
💅🚧 [WIP] Docusaurus Theming #422
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
1d1d511
to
a6b18f8
Compare
a6b18f8
to
7084e30
Compare
@albinotonnina Hi. This is a big undertaking :) Adding multiple, out-of-the-box themes is a big feature that we wanted to add as part of a major upgrade to Docusaurus. I would be very happy and grateful if you wanted to help in this quest. A couple of things:
|
this.siteConfig.colors.primaryColor || | ||
this.siteConfig.colors.secondaryColor | ||
) { | ||
console.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning to inform the user about the deprecated config
Hello @JoelMarcey About your questions:
I hope you like what I have in mind and I'll be waiting for your opinions on this. PS. My first real world project with Docusaurus is a rewrite of the new blazing fast 🚀 web application bundler Parcel 📦. Goal was to have it looks pretty much like the original one. |
The way to probably do it with the custom colours is to create a default sass variable file using them, which can be supplied to the compiler and rolled into the output CSS. Not sure how to preCSS/postCss that though. I'm really not up to speed on PreCSS and PostCSS, but there have been very few times that Sass has been unable to do what I need. To make themes using these technologies, does it require any previous knowledge, or will copy and pasted CSS work fine? I'm not a big fan of Frank either, but ultimately a replacement would have to fit what exists already, I would have to say it doesn't really match the branding imagery, which is pastel colored rounded rectangles. Whilst this isn't exactly a fancy SaaS startup, I still feel that consistent imagery is important. |
I'm here people. I'm gonna continue this at some point 😃 |
@albinotonnina I added cssnano in #569. It's a bit of a hack now so feel free to move it to somewhere more appropriate. Also, it would be better to break up the PR into smaller ones so that progress can be tracked in smaller milestones (also easier to review). |
@albinotonnina hello, I would love to lend a hand. I can split main.css into a module that follows a methodology like ITSCSS and or BEM ... etc |
@yangshun @ahmadalfy Should this PR be closed in favor of smaller bite-sized ones? Or will we just use this PR as a starting point for some changes? |
I think it will be good to close this and have smaller ones. This PR is too large to review and merge as it stands now. |
Let’s make an action plan and do more manageable PRs, shall we? Do we all agree we will start implementing theming? Also, speaking of styling, this is the year of CSS-in-JS. I’m more and more fond of it, what do you think? Wirk with styled components, emotion, or glamorous? |
I don't think the current code base is ready for theming. There's quite a bit of cleaning up to do in terms of the assets pipeline and CSS structure. I'm afraid we'll have to hold off till then. Let's revisit this in future. Apologies! |
Motivation
I found the current style configuration lacking just a bit of love 💅❤️
At the moment it is super easy to bootstrap Docusaurus.
Less straightforward/clean is to do deeper customizations. Eg.: to change a
9px
padding value hardcoded in main.css we need to override that value.It would be nice to give users much more control over the styling of Docusaurus, keeping the 'zero configuration' paradigm intact.
Test Plan
Add/Fix tests TBD
Related PRs
#389
Plan
We start by implementing processing with postcss and precss
What do you think?
Extra: the Docusaurus default mascotte
What do you think about this illustration I put together?
Docusaurus
Docusaurus icon
They would replace: