Visitar URL original
Customizing | Red Hat design system Skip to main content Home About the Design SystemRoadmap OverviewDesignersDevelopers OverviewColorGridIconographyInteractionsSpacingTypography Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button group Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Menu dropdown Navigation link Navigation (primary) Navigation (secondary) Navigation (vertical) Pagination PopoverPlanned Progress stepper Readtime Scheme dropdown Scheme toggle Select Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed How to useProject FeltColor PalettesCustomizingDevelopers All PatternsAccordionAlertCall to ActionCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile AI design principlesLegal requirementsTransparency noticesIconographyColorChatbot avatarsAnimation All Personalization PatternsAnnouncement FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers Design/code status Release notes Get support

Customizing

Custom themesWhen to use custom themesCustom themesWhen to use custom themes

Red Hat Design System is composed of tokens, elements, and patterns, each layer building on the last. Theming emerges as a design possibility from the composition of those smaller pieces. By setting custom values for themable design tokens, elements, sections, or entire pages can take on a new color scheme, layout density, etc. Custom themes can apply to multiple color-palettes and to both the light and dark backgrounds.

Custom themes

To create a custom theme, designers and developers need only set the values for the relevant color properties in the design system in their page's CSS. For example, let's create a custom Bordeaux theme. We'll write a CSS rule which selects for the theme-bordeaux class, and in that rule we'll set the values of RHDS theming tokens to our custom theme colors. In the following example, you can see how we first define some custom theme colors as CSS custom properties beginning with --bordeaux-, then we use those values in our custom theme by applying them to RHDS theming tokens.

In order to support user's color scheme preference as well as elements with dark color palettes, always use sure to always use the light-dark() function when crafting custom themes.