color-schemelight-dark()
(see .scheme-light, .scheme-dark or .scheme-light-dark CSS class to the <html> element or any HTML
element. This applies the selected theme to all child elements.@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>;
}
