diff --git a/apps/website/pages/principles/color.tsx b/apps/website/pages/foundations/color.tsx similarity index 75% rename from apps/website/pages/principles/color.tsx rename to apps/website/pages/foundations/color.tsx index b228b907ce..8d5435b33b 100644 --- a/apps/website/pages/principles/color.tsx +++ b/apps/website/pages/foundations/color.tsx @@ -1,5 +1,5 @@ import Head from "next/head"; -import ColorPage from "screens/principles/color/ColorPage"; +import ColorPage from "screens/foundations/color/ColorPage"; const Color = () => ( <> diff --git a/apps/website/screens/common/pagesList.ts b/apps/website/screens/common/pagesList.ts index 5256c6349a..ea34e4313d 100644 --- a/apps/website/screens/common/pagesList.ts +++ b/apps/website/screens/common/pagesList.ts @@ -33,7 +33,6 @@ const utilitiesLinks: LinkDetails[] = [ ]; const principlesLinks: LinkDetails[] = [ - { label: "Color", path: "/principles/color" }, { label: "Data visualization", path: "/principles/data-visualization" }, { label: "Iconography", path: "/principles/iconography" }, { label: "Layout", path: "/principles/layout" }, @@ -42,11 +41,14 @@ const principlesLinks: LinkDetails[] = [ { label: "Typography", path: "/principles/typography" }, ]; +const foundationsLinks: LinkDetails[] = [{ label: "Color", path: "/foundations/color" }]; + const componentsLinks = componentsList as LinkDetails[]; export const LinksSections: LinksSectionDetails[] = [ { label: "Overview", links: overviewLinks }, { label: "Principles", links: principlesLinks }, + { label: "Foundations", links: foundationsLinks }, { label: "Utilities", links: utilitiesLinks }, { label: "Components", links: componentsLinks }, ]; @@ -66,8 +68,10 @@ const getCurrentLinkIndex = (links: LinkDetails[], currentPath: string) => { export const getNavigationLinks = (currentPath: string): NavigationLinks => { const links = LinksSections.flatMap((section) => section.links); const currentLinkIndex = getCurrentLinkIndex(links, currentPath); - return currentLinkIndex === -1 ? {} : { - nextLink: currentLinkIndex + 1 < links.length ? links[currentLinkIndex + 1] : undefined, - previousLink: currentLinkIndex - 1 >= 0 ? links[currentLinkIndex - 1] : undefined, - }; + return currentLinkIndex === -1 + ? {} + : { + nextLink: currentLinkIndex + 1 < links.length ? links[currentLinkIndex + 1] : undefined, + previousLink: currentLinkIndex - 1 >= 0 ? links[currentLinkIndex - 1] : undefined, + }; }; diff --git a/apps/website/screens/foundations/color/ColorPage.tsx b/apps/website/screens/foundations/color/ColorPage.tsx new file mode 100644 index 0000000000..e64b178c9e --- /dev/null +++ b/apps/website/screens/foundations/color/ColorPage.tsx @@ -0,0 +1,274 @@ +import { DxcFlex, DxcLink, DxcParagraph, DxcHeading, DxcBulletedList } from "@dxc-technology/halstack-react"; +import Figure from "@/common/Figure"; +import Image from "@/common/Image"; +import QuickNavContainer from "@/common/QuickNavContainer"; +import DocFooter from "@/common/DocFooter"; +import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; +import neutralColors from "./images/neutral_colors.png"; +import alphaColors from "./images/alpha_colors.png"; +import primaryColor from "./images/primary_color.png"; +import secondaryColor from "./images/secondary_color.png"; +import tertiaryColor from "./images/tertiary_color.png"; +import semanticColors from "./images/semantic_colors.png"; +import PageHeading from "@/common/PageHeading"; + +const sections = [ + { + title: "Introduction", + content: ( + <> + + Color is a fundamental element of any design system. It{" "} + communicates brand identity, guides user interaction, and establishes visual hierarchy. A + well-structured color foundation ensures consistency across interfaces, reinforces accessibility, and enhances + the emotional impact of the product. + + + Halstack defines a flexible and accessible color foundation to support brand expression, + usability, and consistency across all digital products. The color palette is built on a system of design + tokens that enable scalability, maintainability, and theming. + + + The color system ensures optimal contrast ratios for readability and accessibility, aligning + with{" "} + + WCAG 2.1 + + standards. Token naming follows a semantic structure to promote clarity in implementation and usage. + + + Color is foundational to delivering a coherent user experience and is{" "} + tightly integrated with components, typography, and layout strategies throughout the Halstack + ecosystem. + + + ), + }, + { + title: "Transition from HSL to LCH", + content: ( + <> + + Previously, Halstack used the HSL color space to define and manipulate colors. While HSL offers simplicity, it + falls short in delivering perceptual consistency; equal steps in saturation or lightness do not translate into + equal visual changes, often resulting in tonal ramps that feel uneven or unreadable. + + + We now adopt the LCH (Lightness, Chroma, Hue) color space as a foundation for our color + generation and manipulation. LCH is perceptually uniform, meaning changes in values + correspond more closely to how humans actually perceive color differences. This results in: + + + + More balanced and predictable tonal scales + + + Improved accessibility through consistent contrast across tones + + + Better visual harmony in both light and dark themes + + + + By switching to LCH, Halstack ensures a more robust, inclusive, and visually coherent color system that scales + effectively across all interfaces and user needs. + + + ), + }, + { + title: "Core color tokens", + content: ( + + Colors are categorized by purpose (primary, secondary, neutral and semantic) and are extended + through tonal ranges to offer clarity, depth, and hierarchy in UI design. + + ), + subSections: [ + { + title: "Neutral colors", + content: ( + <> + + Neutral colors in Halstack{" "} + provide structure, depth, and hierarchy without drawing attention. These include a range + of grays used across surfaces, borders, dividers, and text. + + + They help balance the interface by supporting the primary and semantic colors, and are essential for + creating clear layout separation and focus without introducing visual noise. + +
+ Neutral colors +
+ + ), + }, + { + title: "Alpha colors", + content: ( + <> + + Alpha colors are translucent overlays derived from base colors. These tokens are + typically applied in background overlays, elevation and shadows. + + + Alpha values enhance depth and interactivity while maintaining accessibility and visual consistency. + +
+ Alpha colors +
+ + ), + }, + { + title: "Primary color", + content: ( + <> + + Represents the core identity of DXC and is used to drive the main interactions across the + interface. It appears in key components such as primary buttons, active elements and highlights. + + + It is the most prominent color in the system and should be used intentionally to guide attention and + reinforce brand consistency. Variants in tone are available for hover, active, and disabled states to + ensure clarity and accessibility. + +
+ Primary color +
+ + ), + }, + { + title: "Secondary color", + content: ( + <> + + Complements the primary color and is used to support secondary actions or highlight less + prominent interface elements. It helps introduce visual variety without overwhelming the user or competing + with primary actions. Common use cases include{" "} + secondary buttons, accent elements or supporting visuals. + +
+ Secondary color +
+ + ), + }, + { + title: "Tertiary color", + content: ( + <> + + The tertiary color is an identity-supporting color that{" "} + complements both the primary and secondary colors. It reinforces the overall visual + language and helps highlight less prominent elements without drawing attention away from core actions. + + +
+ Tertiary color +
+ + ), + }, + { + title: "Semantic colors", + content: ( + <> + + Semantic colors are{" "} + used to communicate system feedback and status clearly and immediately. These colors are + designed to be universally recognizable and accessible, ensuring that users can quickly interpret the + state of the system. + + + + Green - Success: Communicates successful operations, confirmations, or valid states. It + reassures users and reinforces positive outcomes. + + + Orange - Warning: Used for cautionary messages or potential risks that don’t block + progress but may require attention. + + + Red - Error: Indicates destructive actions, form validation errors, or system failures. + It draws immediate attention and signals that something needs user correction or caution. + + + + These colors are used in components such as alerts, form fields and status indicators among others. + +
+ Semantic colors +
+ + ), + }, + ], + }, + { + title: "Best practices", + content: ( + <> + + To ensure color is used effectively, inclusively, and consistently across all user interfaces, follow these + best practices: + + + + Don't rely solely on color to communicate information + + Use color in combination with text labels, icons, or patterns. Some users may be color-blind, have limited + color perception, or interpret colors differently based on cultural context. Always pair color with an + additional visual cue to convey meaning. + + + + Ensure sufficient contrast for accessibility + + Text and interactive elements must meet minimum contrast requirements to remain legible for all users. + Follow these WCAG 2.1 guidelines: + + + + Use a contrast ratio of at least 4.5:1 for normal body text. + + + Use a contrast ratio of at least 3:1 for large text (18pt or 14pt bold) and essential + graphical objects (such as icons conveying meaning). + + + + + Maintain a limited core palette + + Avoid excessive use of colors. Stick to the defined palette to strengthen visual harmony and brand + recognition. Introduce neutral tones to balance visual weight and focus user attention appropriately. + + + + Use tonal scales for depth and hierarchy + Leverage color ramps to create spatial relationships and support elevation. + + + + ), + }, +]; + +export default function ColorPage() { + return ( + + + + + + + + + + + + ); +} diff --git a/apps/website/screens/foundations/color/images/alpha_colors.png b/apps/website/screens/foundations/color/images/alpha_colors.png new file mode 100644 index 0000000000..6f2783002a Binary files /dev/null and b/apps/website/screens/foundations/color/images/alpha_colors.png differ diff --git a/apps/website/screens/foundations/color/images/neutral_colors.png b/apps/website/screens/foundations/color/images/neutral_colors.png new file mode 100644 index 0000000000..e6104a0982 Binary files /dev/null and b/apps/website/screens/foundations/color/images/neutral_colors.png differ diff --git a/apps/website/screens/foundations/color/images/primary_color.png b/apps/website/screens/foundations/color/images/primary_color.png new file mode 100644 index 0000000000..898c264d30 Binary files /dev/null and b/apps/website/screens/foundations/color/images/primary_color.png differ diff --git a/apps/website/screens/foundations/color/images/secondary_color.png b/apps/website/screens/foundations/color/images/secondary_color.png new file mode 100644 index 0000000000..a1da47363b Binary files /dev/null and b/apps/website/screens/foundations/color/images/secondary_color.png differ diff --git a/apps/website/screens/foundations/color/images/semantic_colors.png b/apps/website/screens/foundations/color/images/semantic_colors.png new file mode 100644 index 0000000000..b56a993552 Binary files /dev/null and b/apps/website/screens/foundations/color/images/semantic_colors.png differ diff --git a/apps/website/screens/foundations/color/images/tertiary_color.png b/apps/website/screens/foundations/color/images/tertiary_color.png new file mode 100644 index 0000000000..a704999b75 Binary files /dev/null and b/apps/website/screens/foundations/color/images/tertiary_color.png differ diff --git a/apps/website/screens/principles/color/ColorPage.tsx b/apps/website/screens/principles/color/ColorPage.tsx deleted file mode 100644 index 0677565d38..0000000000 --- a/apps/website/screens/principles/color/ColorPage.tsx +++ /dev/null @@ -1,824 +0,0 @@ -import { DxcTable, DxcFlex, DxcLink, DxcParagraph, DxcHeading } from "@dxc-technology/halstack-react"; -import Figure from "@/common/Figure"; -import Image from "@/common/Image"; -import QuickNavContainer from "@/common/QuickNavContainer"; -import DocFooter from "@/common/DocFooter"; -import Code from "@/common/Code"; -import QuickNavContainerLayout from "@/common/QuickNavContainerLayout"; -import colorOverview from "./images/color_overview.png"; -import colorFamilies from "./images/color_families.png"; -import PageHeading from "@/common/PageHeading"; - -const sections = [ - { - title: "Introduction", - content: ( - <> -
- DXC Colors -
- - The color palette is an essential asset as a communication resource of our Design System. - - - Halstack color palette brings a unified consistency and helps in guiding the user's perception order. Our - color palette is based in the{" "} - - HSL model - - . All our color families are calculated using the lightness value of the standard DXC palette colors. - - - ), - }, - { - title: "Color tokens", - content: ( - - Halstack uses tokens to manage color. Apart from a multi-purpose greyscale family, purple and blue are the core - color families used in our set of components. Additional families as red, green and yellow help as feedback - role-based color palettes and must not be used outside this context. - - ), - subSections: [ - { - title: "Core color tokens", - content: ( - <> -
- Core color families values -
- - ), - subSections: [ - { - title: "Absolutes", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-white - - #ffffff - (0, 0%, 100%) - - - - color-black - - #000000 - (0, 0%, 0%) - - - - color-transparent - - transparent - - - - - - ), - }, - { - title: " Greyscale", - subSections: [ - { - title: "Solid variants", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-grey-50 - - #fafafa - (0, 0%, 98%) - - - - color-grey-100 - - #f2f2f2 - (0, 0%, 95%) - - - - color-grey-200 - - #e6e6e6 - (0, 0%, 90%) - - - - color-grey-300 - - #cccccc - (0, 0%, 80%) - - - - color-grey-400 - - #bfbfbf - (0, 0%, 75%) - - - - color-grey-500 - - #999999 - (0, 0%, 60%) - - - - color-grey-600 - - #808080 - (0, 0%, 60%) - - - - color-grey-700 - - #666666 - (0, 0%, 40%) - - - - color-grey-800 - - #4d4d4d - (0, 0%, 30%) - - - - color-grey-900 - - #333333 - (0, 0%, 20%) - - - - ), - }, - { - title: "Trasparent variants", - content: ( - - - - Token - Opacity - Value (hsla) - Value (#RRGGBBAA) - - - - - - color-grey-50-a - - 0.02 - hsla(0,0%,0% / 0.02) - #00000005 - - - - color-grey-100-a - - 0.05 - hsla(0,0%,0% / 0.05) - #0000000d - - - - color-grey-200-a - - 0.1 - hsla(0,0%,0% / 0.1) - #0000001a - - - - color-grey-300-a - - 0.2 - hsla(0,0%,0% / 0.2) - #00000033 - - - - color-grey-400-a - - 0.3 - hsla(0,0%,0% / 0.3) - #0000004d - - - - color-grey-500-a - - 0.4 - hsla(0,0%,0% / 0.4) - #00000066 - - - - color-grey-600-a - - 0.5 - hsla(0,0%,0% / 0.5) - #00000080 - - - - color-grey-700-a - - 0.6 - hsla(0,0%,0% / 0.6) - #00000099 - - - - color-grey-800-a - - 0.7 - hsla(0,0%,0% / 0.7) - #000000b3 - - - - color-grey-900-a - - 0.8 - hsla(0,0%,0% / 0.8) - #000000cc - - - - ), - }, - ], - }, - { - title: "Purple", - content: ( - <> - The core Purple family serves as the primary action color. - - - - Name - Value (hex) - Value (hsl) - - - - - - color-purple-50 - - #faf7fd - (269, 63%, 98%) - - - - color-purple-100 - - #f2eafa - (269, 63%, 95%) - - - - color-purple-200 - - #e5d5f6 - (269, 63%, 90%) - - - - color-purple-300 - - #cbacec - (269, 63%, 80%) - - - - color-purple-400 - - #b182e3 - (269, 63%, 70%) - - - - color-purple-500 - - #a46ede - (269, 63%, 65%) - - - - color-purple-600 - - #7d2fd0 - (269, 63%, 50%) - - - - color-purple-700 - - #5f249f - (269, 63%, 38%) - - - - color-purple-800 - - #4b1c7d - (269, 63%, 30%) - - - - color-purple-900 - - #321353 - (269, 63%, 20%) - - - - - ), - }, - { - title: "Blue", - content: ( - <> - The core Blue family serves as the accent color. - - - - Name - Value (hex) - Value (hsl) - - - - - - color-blue-50 - - #f5fbff - (205, 100%, 98%) - - - - color-blue-100 - - #e6f4ff - (205, 100%, 95%) - - - - color-blue-200 - - #cceaff - (205, 100%, 90%) - - - - color-blue-300 - - #99d5ff - (205, 100%, 80%) - - - - color-blue-400 - - #66bfff - (205, 100%, 70%) - - - - color-blue-500 - - #33aaff - (205, 100%, 60%) - - - - color-blue-600 - - #0095ff - (205, 100%, 50%) - - - - color-blue-700 - - #0086e6 - (205, 100%, 45%) - - - - color-blue-800 - - #0067b3 - (205, 100%, 35%) - - - - color-blue-900 - - #003c66 - (205, 100%, 20%) - - - - - ), - }, - { - title: "Red", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-red-50 - - #fff5f6 - (352, 99%, 98%) - - - - color-red-100 - - #ffe6e9 - (352, 99%, 95%) - - - - color-red-200 - - #ffccd3 - (352, 99%, 90%) - - - - color-red-300 - - #fe9aa7 - (352, 99%, 80%) - - - - color-red-400 - - #fe677b - (352, 99%, 70%) - - - - color-red-500 - - #fe344f - (352, 99%, 60%) - - - - color-red-600 - - #fe0123 - (352, 99%, 50%) - - - - color-red-700 - - #d0011b - (352, 99%, 41%) - - - - color-red-800 - - #980115 - (352, 99%, 30%) - - - - color-red-900 - - #65010e - (352, 99%, 20%) - - - - ), - }, - { - title: "Green", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-green-50 - - #f7fdf9 - (137, 63%, 95%) - - - - color-green-100 - - #eafaef - (137, 63%, 95%) - - - - color-green-200 - - #d5f6df - (137, 63%, 90%) - - - - color-green-300 - - #acecbe - (137, 63%, 80%) - - - - color-green-400 - - #82e39e - (137, 63%, 70%) - - - - color-green-500 - - #59d97d - (137, 63%, 60%) - - - - color-green-600 - - #2fd05d - (137, 63%, 50%) - - - - color-green-700 - - #24a148 - (137, 63%, 39%) - - - - color-green-800 - - #1c7d38 - (137, 63%, 30%) - - - - color-green-900 - - #135325 - (137, 63%, 20%) - - - - ), - }, - { - title: "Yellow", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-yellow-50 - - #fffdf5 - (48, 93%, 98%) - - - - color-yellow-100 - - #fef9e6 - (48, 93%, 95%) - - - - color-yellow-200 - - #fdf4ce - (48, 93%, 90%) - - - - color-yellow-300 - - #fbe89d - (48, 93%, 80%) - - - - color-yellow-400 - - #fadd6b - (48, 93%, 70%) - - - - color-yellow-500 - - #f7cf2b - (48, 93%, 57%) - - - - color-yellow-600 - - #f6c709 - (48, 93%, 50%) - - - - color-yellow-700 - - #c59f07 - (48, 93%, 40%) - - - - color-yellow-800 - - #947705 - (48, 93%, 30%) - - - - color-yellow-900 - - #624f04 - (48, 93%, 20%) - - - - ), - }, - { - title: "Orange", - content: ( - - - - Name - Value (hex) - Value (hsl) - - - - - - color-orange-50 - - #fefaf5 - (32, 90%, 98%) - - - - color-orange-100 - - #fef3e7 - (32, 90%, 95%) - - - - color-orange-200 - - #fce7cf - (32, 90%, 90%) - - - - color-orange-300 - - #facf9e - (32, 90%, 80%) - - - - color-orange-400 - - #f7b76e - (32, 90%, 70%) - - - - color-orange-500 - - #f59f3d - (32, 90%, 60%) - - - - color-orange-600 - - #f38f20 - (32, 90%, 54%) - - - - color-orange-700 - - #c26c0a - (32, 90%, 40%) - - - - color-orange-800 - - #915108 - (32, 90%, 30%) - - - - color-orange-900 - - #613605 - (32, 90%, 20%) - - - - ), - }, - ], - }, - ], - }, -]; - -export default function ColorPage() { - return ( - - - - - - - - - - - - ); -} diff --git a/apps/website/screens/principles/color/images/color_families.png b/apps/website/screens/principles/color/images/color_families.png deleted file mode 100644 index b1aa04db7b..0000000000 Binary files a/apps/website/screens/principles/color/images/color_families.png and /dev/null differ diff --git a/apps/website/screens/principles/color/images/color_overview.png b/apps/website/screens/principles/color/images/color_overview.png deleted file mode 100644 index d771842049..0000000000 Binary files a/apps/website/screens/principles/color/images/color_overview.png and /dev/null differ