Skip to content

Custom css not loaded the same way with yarn start and yarn build #4231

@ArtFlag

Description

@ArtFlag

🐛 Bug Report

I have a simple setup using the classic theme in which I've modified the admonition styling.

In my case, I have only overridden the admonition class and admonition-tip|note|important classes. I didn't touch the alert class which is also used in the admonitions.

  • When I build my output with yarn start I get this, which I what I expect:

Screenshot 2021-02-17 at 08 30 08

Screenshot 2021-02-17 at 08 30 16

  • When I build my output with yarn build I get this, which is unexpected:

Screenshot 2021-02-17 at 08 30 23

Screenshot 2021-02-17 at 08 30 27

Somehow, the classes are not in the same order, which might be the reason (??).

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Add some admonition classes to custom.css
  2. Build with yarn start
  3. Build with yarn build
  4. Compare

Expected behavior

I should get the same visual output.

Actual Behavior

I do not get the same visual output.

Your Environment

  • Docusaurus version used:
 "dependencies": {
    "@docusaurus/core": "2.0.0-alpha.70",
    "@docusaurus/preset-classic": "2.0.0-alpha.70",
    "@docusaurus/theme-search-algolia": "^2.0.0-alpha.70",
    "@mdx-js/react": "^1.6.21",
    "antd": "^4.9.4",
    "clsx": "^1.1.1",
    "core-js": "^3.8.1",
    "docusaurus-plugin-sass": "^0.1.11",
    "mobx": "^6.0.4",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "redoc": "^2.0.0-rc.45",
    "redocusaurus": "^0.2.2",
    "styled-components": "^5.2.1"
  },
  • Environment name and version: Node v15.3.0. FF 85.0.2. Chrome 88.0.4324.150
  • Operating system and version:MacOs 10.15.7

Reproducible Demo

See codesandbox but obviously that's not going to help build the packaged app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions