JS styles (/styles) has been officially rebranded as Emotion styles. While these
styles may still function with Styled Components or other CSS-in-JS solutions, Emotion is the only officially supported
framework moving forward.light-dark()⚠️ Deprecation Notice: Legacy Emotion color variables are officially deprecated and scheduled for removal in the next major release. We recommend migrating to the new functional tokens immediately to ensure your components remain future-proof.
color-schemecolorSchemeStyles, which generates utility classes and includes a polyfill
for browsers that do not yet support light-dark() (see
.scheme-light — Forces light mode..scheme-dark — Forces dark mode..scheme-light-dark — Dynamically follows system/OS settings.main.tsx to initialize the color-scheme utilities.import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';
import { PorscheDesignSystemProvider } from '@porsche-design-system/components-react';
import { App } from './App.tsx';
+ import { colorSchemeStyles } from '@porsche-design-system/components-react/emotion';
+ import { Global } from '@emotion/react';
createRoot(document.getElementById('root')!).render(
<StrictMode>
+ <Global styles={colorSchemeStyles} />
<PorscheDesignSystemProvider>
<App />
</PorscheDesignSystemProvider>
</StrictMode>
);
import styled from '@emotion/styled';
import { colorFrosted, colorPrimary } from '@porsche-design-system/components-react/emotion';
const MyComponent = styled.div({
backgroundColor: colorFrosted,
color: colorPrimary,
});
import { MyComponent } from './MyComponent';
<!-- Defined color-scheme will be applied to all child elements -->
export const App = () => {
return (
<div className="scheme-dark">
<MyComponent></MyComponent>
</div>
);
};
getHoverStyle since it did not work reliable.opts parameter in getSkeletonStyle() including theme (New skeleton style works with light-dark() CSS
color function).- getSkeletonStyle({ theme: 'light|dark' })
+ getSkeletonStyle()
- import { … } from '@porsche-design-system/components-{js|angular|react|vue}/styles';
+ import { … } from '@porsche-design-system/components-{js|angular|react|vue}/emotion';
- ...frostedGlassStyle,
+ backdropFilter: blurFrosted,
- borderRadius: borderRadiusMedium,
+ borderRadius: radiusMd,
- borderRadius: borderRadiusSmall,
+ borderRadius: radiusSm,
- borderRadius: borderRadiusLarge,
+ borderRadius: radiusLg,
- borderWidth: borderWidthBase,
+ borderWidth: 2px,
- borderWidth: borderWidthThin,
+ borderWidth: 1px;
light-dark()- themeLightPrimary
- themeDarkPrimary
+ colorPrimary
- themeLightBackgroundBase
- themeDarkBackgroundBase
+ colorCanvas
- themeLightBackgroundSurface
- themeDarkBackgroundSurface
+ colorSurface
- themeLightBackgroundShading
- themeDarkBackgroundShading
+ colorBackdrop
- themeLightBackgroundFrosted
- themeDarkBackgroundFrosted
+ colorFrosted
- themeLightContrastLow
- themeDarkContrastLow
+ colorContrastLow
- themeLightContrastMedium
- themeDarkContrastMedium
+ colorContrastMedium
- themeLightContrastHigh
- themeDarkContrastHigh
+ colorContrastHigh
- themeLightNotificationSuccess
- themeDarkNotificationSuccess
+ colorSuccess
- themeLightNotificationSuccessSoft
- themeDarkNotificationSuccessSoft
+ colorSuccessFrosted
- themeLightNotificationWarning
- themeDarkNotificationWarning
+ colorWarning
- themeLightNotificationWarningSoft
- themeDarkNotificationWarningSoft
+ colorWarningFrosted
- themeLightNotificationError
- themeDarkNotificationError
+ colorError
- themeLightNotificationErrorSoft
- themeDarkNotificationErrorSoft
+ colorErrorFrosted
- themeLightNotificationInfo
- themeDarkNotificationInfo
+ colorInfo
- themeLightNotificationInfoSoft
- themeDarkNotificationInfoSoft
+ colorInfoFrosted
- themeLightStateHover
- themeDarkStateHover
// Not renamed yet, will be removed in next major release
- themeLightStateActive
- themeDarkStateActive
// Not renamed yet, will be removed in next major release
- themeLightStateFocus
- themeDarkStateFocus
+ colorFocus
- themeLightStateDisabled
- themeDarkStateDisabled
+ colorContrastLower
- ...getFocusStyle(),
+ ...getFocusVisibleStyle(),
- ...gradientToBottomStyle,
+ background: `linear-gradient(to bottom, ${gradientStopsFadeDark});`
- ...gradientToLeftStyle,
+ background: `linear-gradient(to left, ${gradientStopsFadeDark});`
- ...gradientToRightStyle,
+ background: `linear-gradient(to right, ${gradientStopsFadeDark});`
- ...gradientToTopStyle,
+ background: `linear-gradient(to top, ${gradientStopsFadeDark});`
- transitionDuration: motionDurationShort,
+ transitionDuration: durationSm,
- transitionDuration: motionDurationModerate,
+ transitionDuration: durationMd,
- transitionDuration: motionDurationLong,
+ transitionDuration: durationLg,
- transitionDuration: motionDurationVeryLong,
+ transitionDuration: durationXl,
- transitionTimingFunction: motionEasingBase,
+ transitionTimingFunction: easeInOut,
- transitionTimingFunction: motionEasingIn,
+ transitionTimingFunction: easeIn,
- transitionTimingFunction: motionEasingOut,
+ transitionTimingFunction: easeOut,
- ...dropShadowHighStyle,
+ boxShadow: shadowLg,
- ...dropShadowMediumStyle,
+ boxShadow: shadowMd,
- ...dropShadowLowStyle,
+ boxShadow: shadowSm,
- spacingFluidXSmall
+ spacingFluidXs
- spacingFluidSmall
+ spacingFluidSm
- spacingFluidMedium
+ spacingFluidMd
- spacingFluidLarge
+ spacingFluidLg
- spacingFluidXLarge
+ spacingFluidXl
- spacingFluidXXLarge
+ spacingFluid2Xl
- spacingStaticXSmall
+ spacingStaticXs
- spacingStaticSmall
+ spacingStaticSm
- spacingStaticMedium
+ spacingStaticMd
- spacingStaticLarge
+ spacingStaticLg
- spacingStaticXLarge
+ spacingStaticXl
- spacingStaticXXLarge
+ spacingStatic2Xl
- ...displayLargeStyle,
+ ...proseHeading5XlStyle,
- ...displayMediumStyle,
+ ...proseHeading4XlStyle,
- ...displaySmallStyle,
+ ...proseHeading3XlStyle,
- ...headingXXLargeStyle,
+ ...proseHeading2XlStyle,
- ...headingXLargeStyle,
+ ...proseHeadingXlStyle,
- ...headingLargeStyle,
+ ...proseHeadingLgStyle,
- ...headingMediumStyle,
+ ...proseHeadingMdStyle,
- ...headingSmallStyle,
+ ...proseHeadingSmStyle,
- ...textXLargeStyle,
+ ...proseTextXlStyle,
- ...textLargeStyle,
+ ...proseTextLgStyle,
- ...textMediumStyle,
+ ...proseTextMdStyle,
- ...textSmallStyle,
+ ...proseTextSmStyle,
- ...textXSmallStyle,
+ ...proseTextXsStyle,
- ...textXXSmallStyle,
+ ...proseText2XsStyle,
- fontFamily
+ fontPorscheNext
- fontLineHeight
+ leadingNormal
- fontWeightRegular
+ fontWeightNormal
- fontWeightSemiBold
+ fontWeightSemibold
- fontSizeTextXXSmall
+ typescale2Xs
- fontSizeTextXSmall
+ typescaleXs
- fontSizeTextSmall
+ typescaleSm
- fontSizeTextMedium
+ typescaleMd
- fontSizeTextLarge
+ typescaleLg
- fontSizeTextXLarge
+ typescaleXl
- fontSizeHeadingSmall
+ typescaleSm
- fontSizeHeadingMedium
+ typescaleMd
- fontSizeHeadingLarge
+ typescaleLg
- fontSizeHeadingXLarge
+ typescaleXl
- fontSizeHeadingXXLarge
+ typescale2Xl
- fontSizeDisplay.small
+ typescale3Xl
- fontSizeDisplay.medium
+ typescale4Xl
- fontSizeDisplay.large
+ typescale5Xl
