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

broken styles after build #10113

Closed
5 tasks done
lumi2021 opened this issue May 8, 2024 · 4 comments
Closed
5 tasks done

broken styles after build #10113

lumi2021 opened this issue May 8, 2024 · 4 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@lumi2021
Copy link

lumi2021 commented May 8, 2024

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

I'm working on the new Silk.NET presentation and documentation website where i was requested to use docusaurus to do it. The library never shows any error during the debugging process and the development goes well until i need to build the website, when i noticed the problem.

Most of the styles and media queries are being broken by the CSS Minimizer plugin. It logs don't help to solve any problem because the minimize is done after all the compilation, so my CSS code is unrecognizable after this.

Steps to reproduce

  1. clone the website repo
  2. execute npm run build
  3. execute npm run serve

behavior

The styles should be exactly what it is during the debug (npm run start)

One of the best examples, the first section of the main page that is being rendered as the follow in debug:
image

It's being rendering as it after the build process:
image

environment

@lumi2021 lumi2021 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 8, 2024
@lumi2021
Copy link
Author

lumi2021 commented May 8, 2024

I and a moderator of the Discord server discovered the problem. Some of my styles use nested CSS, what is a new feature in default CSS and already implemented in SCSS. the problem is: the default CSS minimizer don't have support to nested CSS, so I'm installing the scss plugin to solve my problem.

As i still think this is a problem, i will let the issue open for some mod review and give the verdict.

@slorber
Copy link
Collaborator

slorber commented May 9, 2024

Agree with have a bug, already tracked in #9303

Note CSS nesting is not yet "widely" supported.

CleanShot 2024-05-09 at 12 07 41@2x

Only 81% full support, that's maybe a bit too soon to emit CSS nesting, but maybe we could at least support it as an authoring format and emit non-nested CSS (similar to what SCSS does).

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label May 9, 2024
@lumi2021
Copy link
Author

lumi2021 commented May 9, 2024

Only 81% full support, that's maybe a bit too soon to emit CSS nesting, but maybe we could at least support it as an authoring format and emit non-nested CSS (similar to what SCSS does).

the idea of emit non nested CSS looks really good for me, but isn't so much work for docusaurus team? Like an entire css parser and etc...

@slorber
Copy link
Collaborator

slorber commented May 10, 2024

Forgot to close as duplicate

the idea of emit non nested CSS looks really good for me, but isn't so much work for docusaurus team? Like an entire css parser and etc...

We wouldn't do this on our own but likely use PostCSS for that.

https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting

Since postcss-preset-env supports browserslist, we should probably use that in the future

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@slorber slorber added closed: duplicate This issue or pull request already exists in another issue or pull request and removed bug An error in the Docusaurus core causing instability or issues with its execution labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants