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

what's the most robust way of importing the default CSS from an html static page? #3661

Closed
elipapa opened this issue Oct 30, 2020 · 3 comments
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@elipapa
Copy link

elipapa commented Oct 30, 2020

📚 Documentation

It's unclear what would be the preferred way of importing the default CSS from an html static page.

I have the need to host static .html pages in the /static folder and would like to style them like the rest of the docusarus website.
In docusaurus v1 it was possible to access it at ${baseUrl}css/main.css.

How should it be done in v2?

Have you read the Contributing Guidelines on issues?

yes

@elipapa elipapa added documentation The issue is related to the documentation of Docusaurus status: needs triage This issue has not been triaged by maintainers labels Oct 30, 2020
@slorber
Copy link
Collaborator

slorber commented Oct 30, 2020

Hi,

Everything you put in /static will be hosted

So if you have /static/myPage.html, and /static/css/myCss.css

You can load "/${baseUrl}/css/myCss.css", or preferably using a relative path like "css/myCss.css" (more easy to change your baseUrl, as HTML files are static)

We don't process anything from this folder, content is published as-is, Docusaurus does not really have anything to do with that

@slorber slorber closed this as completed Oct 30, 2020
@elipapa
Copy link
Author

elipapa commented Oct 31, 2020

thanks for the reply @slorber
i was not referring to custom css, but rather the default css from @docusaurus/theme-classic

@slorber
Copy link
Collaborator

slorber commented Oct 31, 2020

The CSS file loaded by the classic theme is infima/dist/css/default/default.css (in node_modules)
For the docusaurus website, it is loaded through webpack css loader.
You could just put this file in /static and load it in HTML pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

3 participants