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

Production styling differs from development styling #40

Closed
clairefro opened this issue Jan 24, 2021 · 2 comments
Closed

Production styling differs from development styling #40

clairefro opened this issue Jan 24, 2021 · 2 comments

Comments

@clairefro
Copy link
Collaborator

clairefro commented Jan 24, 2021

Some of our custom styles have been appearing differently in production vs development, such as font size, code block colors, footer colors, etc.

It may have to do with how Docusaurus is using webpack for production build - custom.css appears not to be the "last word" when it comes to styling. A workaround is to use !important for our custom styles.

facebook/docusaurus#3678

@clairefro
Copy link
Collaborator Author

clairefro commented Jan 24, 2021

facebook/docusaurus#3879 (comment)

A better solution is to use substring matching selectors for those long complicated classes with @docusaurus in them

We are using CSS modules, so this class names like .docTitle_node_modules-@docusaurus-theme-classic-lib-theme-DocItem- will not work in a production build. For this to work, you need to use substring matching selector:

[class^="docTitle"] {
     font-size: 2rem;
}

"Swizzling" (❓) was another suggested solution but I don't really get what that is, and Docusaurus' own docs discourage its use at them moment

@clairefro
Copy link
Collaborator Author

Resolved by #41

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

No branches or pull requests

1 participant