Porsche Design System
You are currently viewing an earlier release of the Porsche Design System.Switch to the latest Porsche Design System documentation.
SearchNavigate 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. The colors use the light-dark() CSS color function. To change the theme, use the utility classes .scheme-light, .scheme-dark or .scheme-light-dark. Learn more in the Color Scheme section. Text Color
  • .text-primary
  • .text-contrast-higher
  • .text-contrast-high
  • .text-contrast-medium
  • .text-success
  • .text-warning
  • .text-error
  • .text-info
Open in Stackblitz
<!doctype html>
<html lang="en" class="scheme-light-dark">
<head>
  <title></title>
</head>
<body class="bg-canvas">

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

</script>
</body>
</html>
Background Color
  • .bg-canvas
  • .bg-surface
  • .bg-frosted
  • .bg-frosted-soft
  • .bg-frosted-strong
  • .bg-backdrop
  • .bg-success-frosted
  • .bg-success-frosted-soft
  • .bg-warning-frosted
  • .bg-warning-frosted-soft
  • .bg-error-frosted
  • .bg-error-frosted-soft
  • .bg-info-frosted
  • .bg-info-frosted-soft
Open in Stackblitz
<!doctype html>
<html lang="en" class="scheme-light-dark">
<head>
  <title></title>
</head>
<body class="bg-canvas">

<ul class="grid gap-fluid-sm prose-text-sm">
  <li class="flex items-center gap-static-md">
    <div class="bg-canvas w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-canvas
  </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-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-frosted-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-frosted-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-frosted-strong w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-frosted-strong
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-backdrop w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-backdrop
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-success-frosted w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-success-frosted
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-success-frosted-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-success-frosted-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-warning-frosted w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-warning-frosted
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-warning-frosted-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-warning-frosted-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-error-frosted w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-error-frosted
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-error-frosted-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-error-frosted-soft
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-info-frosted w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-info-frosted
  </li>
  <li class="flex items-center gap-static-md">
    <div class="bg-info-frosted-soft w-10 h-10 rounded-md border border-contrast-low"></div>
    .bg-info-frosted-soft
  </li>
</ul>
<script>

</script>
</body>
</html>
Border Color
  • .border-primary
  • .border-contrast-higher
  • .border-contrast-high
  • .border-contrast-medium
  • .border-contrast-low
  • .border-contrast-lower
  • .border-info-medium
  • .border-info-low
  • .border-success-medium
  • .border-success-low
  • .border-warning-medium
  • .border-warning-low
  • .border-error-medium
  • .border-error-low
Open in Stackblitz
<!doctype html>
<html lang="en" class="scheme-light-dark">
<head>
  <title></title>
</head>
<body class="bg-canvas">

<ul class="grid gap-fluid-sm prose-text-sm">
  <li class="flex items-center gap-static-md">
    <div class="border-primary w-10 h-10 rounded-md border"></div>
    .border-primary
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-contrast-higher w-10 h-10 rounded-md border"></div>
    .border-contrast-higher
  </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>
  <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-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-lower w-10 h-10 rounded-md border"></div>
    .border-contrast-lower
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-info-medium w-10 h-10 rounded-md border"></div>
    .border-info-medium
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-info-low w-10 h-10 rounded-md border"></div>
    .border-info-low
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-success-medium w-10 h-10 rounded-md border"></div>
    .border-success-medium
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-success-low w-10 h-10 rounded-md border"></div>
    .border-success-low
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-warning-medium w-10 h-10 rounded-md border"></div>
    .border-warning-medium
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-warning-low w-10 h-10 rounded-md border"></div>
    .border-warning-low
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-error-medium w-10 h-10 rounded-md border"></div>
    .border-error-medium
  </li>
  <li class="flex items-center gap-static-md">
    <div class="border-error-low w-10 h-10 rounded-md border"></div>
    .border-error-low
  </li>
</ul>
<script>

</script>
</body>
</html>
Global settingsColor SchemeAll color tokens use the light-dark() CSS function. Set the theme via the CSS color-scheme property: light for light mode, dark for dark mode, or light dark to follow the user's system preference.LightDarkLight DarkDirectionThe 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%