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

How can I custom a theme with NX+Next.js? #83

Open
JenniferGoijman opened this issue May 13, 2024 · 1 comment · May be fixed by #114
Open

How can I custom a theme with NX+Next.js? #83

JenniferGoijman opened this issue May 13, 2024 · 1 comment · May be fixed by #114
Assignees
Labels
enhancement This is not a bug, nor a new feature support: docs-feedback Feedback from documentation page support: question Community support but can be turned into an improvement

Comments

@JenniferGoijman
Copy link

JenniferGoijman commented May 13, 2024

Related page

https://github.com/mui/pigment-css?tab=readme-ov-file#start-with-nextjs

Kind of issue

Missing information

Issue description

This is my next.config.jsfile that I have configured PigmentCSS in a Nx+Next.js repo:

//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');
const { withPigment } = require('@pigment-css/nextjs-plugin');

/**
 * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    // Set this to true if you would like to to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: false,
  },
};

const plugins = [
  // Add more Next.js plugins to this list if needed.
  withNx,
  withPigment
];

module.exports = composePlugins(...plugins)(nextConfig);

How can I custom a theme with NX+Next.js?

Context

@pigment-css/react: 0.0.11
next: 14.0.4
react: 18.2.0
react-dom: 18.2.0
@nx/next: 18.0.2
@pigment-css/nextjs-plugin: 0.0.11
nx: 18.0.2

Search keywords: NX, Next.js

@JenniferGoijman JenniferGoijman added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels May 13, 2024
@zannager zannager added the support: question Community support but can be turned into an improvement label May 27, 2024
@brijeshb42
Copy link
Contributor

brijeshb42 commented May 30, 2024

This requires a change in the api of withPigment to take in it's config from the nextConfig object itself instead of taking it as a 2nd argument.
This will be a breaking change but makes sense if majority of other plugins are already following this approach.

@brijeshb42 brijeshb42 added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 30, 2024
brijeshb42 added a commit to brijeshb42/pigment-css that referenced this issue May 30, 2024
through `pigment` key from the nextConfig object itself instead of as a
2nd argument to the call. This is a standard approach followed by other
nextjs plugins

Fixes: mui#83
@brijeshb42 brijeshb42 linked a pull request May 30, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature support: docs-feedback Feedback from documentation page support: question Community support but can be turned into an improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants