Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
ExamplesUsageAPI
Color Table of Contents The Porsche Design System Tailwind theme customizes Tailwind variables such as --color-*, which affect multiple Tailwind classes including bg-*, text-*, border-* and others. By default, color tokens use the light theme. To enable the dark theme or automatic theme switching based on system settings, add the .dark or .auto CSS class to the <html> element or any HTML element. This applies the selected theme to all child elements. Instead of dynamic colors like .text-primary or .bg-surface, you can also use fixed theme variants such as .text-primary-light, .bg-surface-light, .text-primary-dark, or .bg-surface-dark, which remain constant regardless of theme. Text Color
  • .text-primary
  • .text-contrast-medium
  • .text-contrast-high
  • .text-success
  • .text-error
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<ul class="grid gap-fluid-sm prose-text-sm">
  <li class="text-primary">
    .text-primary
  </li>
  <li class="text-contrast-medium">
    .text-contrast-medium
  </li>
  <li class="text-contrast-high">
    .text-contrast-high
  </li>
  <li class="text-success">
    .text-success
  </li>
  <li class="text-error">
    .text-error
  </li>
</ul>
<script>

</script>
</body>
</html>
Background Color
  • .bg-base
  • .bg-surface
  • .bg-shading
  • .bg-frosted
  • .bg-success-soft
  • .bg-warning-soft
  • .bg-error-soft
  • .bg-info-soft
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<ul class="grid gap-fluid-sm prose-text-sm">
  <li class="flex items-center gap-static-md">
    <div class="bg-base w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-base
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-surface w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-surface
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-shading w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-shading
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-frosted w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-frosted
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-success-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-success-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-warning-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-warning-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-error-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-error-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-info-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-info-soft
  </li>
</ul>
<script>

</script>
</body>
</html>
Border Color
  • .border-contrast-low
  • .border-contrast-medium
  • .border-contrast-high
Open in Stackblitz
<!doctype html>
<html lang="en" class="auto">
<head>
  <title></title>
</head>
<body class="bg-base">

<ul class="grid gap-fluid-sm prose-text-sm">
  <li class="flex items-center gap-static-md">
    <div class="border-contrast-low w-10 h-10 rounded-md border"></div>
    .border-contrast-low
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-contrast-medium w-10 h-10 rounded-md border"></div>
    .border-contrast-medium
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-contrast-high w-10 h-10 rounded-md border"></div>
    .border-contrast-high
  </li>
</ul>
<script>

</script>
</body>
</html>
Global settingsThemeChanges the theme of the application and any Porsche Design System component. It's possible to choose between forced theme light and dark. It's also possible to use auto, which applies light or dark theme depending on the operating system settings automatically.LightDarkAuto (sync with operating system)DirectionThe dir global attribute in HTML changes the direction of text and other content within an element. It's most often used on the <html> tag to set the entire page's direction, which is crucial for supporting languages that are written from right to left (RTL), such as Arabic and Hebrew. For example, using <html dir="rtl"> makes the entire page display from right to left, adjusting the layout and text flow accordingly.LTR (left-to-right)RTL (right-to-left)Text ZoomTo ensure accessibility and comply with WCAG 2.2 AA standards, it is mandatory for web content to support text resizing up to at least 200% without loss of content or functionality. Using relative units like rem is a best practice for achieving this, as they allow the text to scale uniformly based on the user's browser settings.100%130%150%200%