@use '@porsche-design-system/components-{js|angular|react|vue}/scss' as pds;
@mixin color-scheme() in your global styles to enable the color scheme utilities and add a polyfill for
browsers that don’t yet support light-dark(). See the // global styles
@use '@porsche-design-system/components-{js|angular|react|vue}/scss' as pds;
@include pds.color-scheme();
html, body {…}
color-scheme@mixin color-scheme(), which generates utility classes and includes a polyfill for
browsers that do not yet support light-dark() (see
light-dark().scheme-light — Forces light mode..scheme-dark — Forces dark mode..scheme-light-dark — Dynamically follows system/OS settings.// global styles
@use '@porsche-design-system/components-js/scss' as pds;
@include pds.color-scheme();
html, body {…}
// custom component styles
@use '@porsche-design-system/components-{js\|angular\|react\|vue}/scss' as pds;
.my-component {
// Use light-dark() color variables
background-color: pds.$color-frosted;
color: pds.$color-primary;
}
<!-- Defined theme will be applied to all child elements -->
<html class="scheme-dark">
<head></head>
<body>
<!-- Will be rendered in dark mode -->
<div class="my-component"></div>
</body>
</html>
