color-schemelight-dark()
(see color-scheme: only light, which prevents browsers with an automatic
dark mode from recoloring your application. To enable automatic theme switching based on system settings, add the
.scheme-light-dark CSS class to the <html> element or any HTML element. This applies the selected theme to all child
elements. For pages or sections that support one theme only, use .scheme-only-light or .scheme-only-dark.@porsche-design-system/components-react/ssr is a specialized build of the Porsche Design System
components that renders different markup on the server compared to the browser. While this deviates from traditional
SSR/SSG rules (where browser and server markup should be identical), it's necessary to enable SSR/SSG with web
components and Shadow DOM.process.browser flag, which is replaced with a boolean value at build time.
In the browser, the components behave like the standard React components from @porsche-design-system/components-react.prefix property of PorscheDesignSystemProvider.// root.tsx
import { PorscheDesignSystemProvider } from '@porsche-design-system/components-react/ssr';
export default function App() {
return (
<PorscheDesignSystemProvider prefix="sample-prefix">
<Outlet />
</PorscheDesignSystemProvider>
);
}
PHeading component will render as <sample-prefix-p-heading>.// routes/home.tsx
import { PHeading } from '@porsche-design-system/components-react/ssr';
export default function Home() {
return <PHeading>Some heading</PHeading>;
}
