Open isshesure opened 5 months ago
Allow the styles import to be customised, so that component libraries can abstract away the underlying styling solution.
const { withPigment } = require('@pigment-css/nextjs-plugin'); module.exports = withPigment({ importName: '@mycompany/styles.css' })(nextJsConfig);
Then:
import type { Metadata } from 'next'; +import '@mycompany/styles.css'; export const metadata: Metadata = { title: 'Create Next App', description: 'Generated by create next app', }; export default function RootLayout(props: { children: React.ReactNode }) { return ( <html lang="en"> <body>{props.children}</body> </html> ); }
Then libraries can export their own plugin:
export const withMyCompanyLibrary = withPigment({ importName: '@mycompany/styles.css' })
Avoid exposing Pigment CSS usage as the styling mechanism for those libraries that do not use other Pigment CSS consumer facing features.
Search keywords: import customisation
Sounds like a nice addition to the current options. I'll mark this to be taken into consideration before our stable release.
Summary
Allow the styles import to be customised, so that component libraries can abstract away the underlying styling solution.
Examples
Then:
Then libraries can export their own plugin:
Motivation
Avoid exposing Pigment CSS usage as the styling mechanism for those libraries that do not use other Pigment CSS consumer facing features.
Search keywords: import customisation