facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.23k stars 8.44k forks source link

Restrict CSS from static folder to css folder #1732

Closed rhythnic closed 5 years ago

rhythnic commented 5 years ago

šŸ› Bug Report

The CSS bundle, main.css, seems to include all css files from the static folder. It should only include CSS from the css folder. My use case is that I would like to put a complete static site into a folder within the static folder, and then render it into an iFrame on a custom page. The problem is that the css is getting bundled into the main CSS file and causing the Docusaurus site to render incorrectly.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Create a folder /website/static/foo
  2. Create a .css file within /website/static/foo
  3. Start the development server
  4. Confirm that the CSS bundle contains the css content from /website/static/foo

Expected behavior

I expected that only CSS files from the css folder would be included in the CSS bundle.

Actual Behavior

The CSS bundle includes all CSS files within the static folder. In my case, the Bootstrap CSS file was included.

UI CSS Glitch

ui-bug

CSS File

css-bootstrap

Reproducible Demo

https://gitlab.com/rhythnic/lpwan-site-revamp

endiliey commented 5 years ago

use https://docusaurus.io/docs/en/site-config#separatecss-array

rhythnic commented 5 years ago

Thank you. There's a discrepancy in the Docusaurus docs. The API reference page uses separateCSS, but the correct propery, referenced in the Custom Pages documentation, is separateCss.