light-dark()⚠️ Deprecation Notice: Legacy Vanilla Extract 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.app.css.ts to initialize the color-scheme utilities.// app.css.ts
+ import { colorSchemeStyles } from '@porsche-design-system/components-react/vanilla-extract';
+ import { type GlobalStyleRule, globalStyle } from '@vanilla-extract/css';
+ for (const { selector, rule } of colorSchemeStyles) {
+ globalStyle(selector, rule as GlobalStyleRule);
+ }
import { colorFrosted, colorPrimary } from '@porsche-design-system/components-react/vanilla-extract';
import { style } from '@vanilla-extract/css';
export const myComponent = style({
backgroundColor: colorFrosted,
color: colorPrimary,
});
import { myComponent } from './myComponent.css';
<!-- Defined color-scheme will be applied to all child elements -->
export const App = () => {
return (
<div className="scheme-dark">
<div className={myComponent}></div>
</div>
);
};
getHoverStyle since it did not work reliable.opts parameter in getSkeletonStyle() including theme (New skeleton style works with light-dark() CSS
color function)const skeletonAnimation = keyframes(skeletonKeyframes);
- const Skeleton = style(getSkeletonStyle(skeletonAnimation, { theme: 'light|dark' }));
+ const Skeleton = style(getSkeletonStyle(skeletonAnimation));
- import { … } from '@porsche-design-system/components-{js|angular|react|vue}/styles/vanilla-extract';
+ import { … } from '@porsche-design-system/components-{js|angular|react|vue}/vanilla-extract';
- ...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
