mui / mui/material-ui

[material-ui] Difficult to find correct info on theming with Pigment CSS in Vite

Open
#44,261 2 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

docs package: pigment-css support: docs-feedback
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Related page

https://mui.com/material-ui/experimental-api/pigment-css/#themes

Kind of issue

Missing information

Issue description

Docs are great but the Theming section doesn't provide an example for Vite. I've looked around, including at the examples and the quick start video, however, these resources either assume the project is using Nextjs or they have conflicting code/information from the docs themselves. The docs are also insufficient as the pigmentConfig in the docs doesn't actually work as written (e.g. pigment(): expects 1 argument but got 0) and the example further down also doesn't supply enough code to actually run.

Anyway, I finally found the solution I needed buried here in the mui migrating to pigmentcss guide. I didn't realize this was the correct implementation though because of all the conflicting information.

Hopefully this can be remedied either by linking to the migration guide or refreshing the other documentation to follow it.

Thanks in advance for any help!

Context

I'm trying to upgrade my Vite projects to MUI v6 and pigment css. I want the Vite config to run properly and also give me access to my custom theme (or css variables if they are intended to replace the old way of theming, which I'm not 100% clear on).

Search keywords: vite, theming, cssvariables

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.