diff --git a/packages/react-core/src/components/Page/PageSection.tsx b/packages/react-core/src/components/Page/PageSection.tsx index b3b7ed03c92..dee8237f8c7 100644 --- a/packages/react-core/src/components/Page/PageSection.tsx +++ b/packages/react-core/src/components/Page/PageSection.tsx @@ -5,7 +5,8 @@ import { formatBreakpointMods } from '../../helpers/util'; import { PageContext } from './PageContext'; export enum PageSectionVariants { - default = 'default' + default = 'default', + secondary = 'secondary' } export enum PageSectionTypes { @@ -22,8 +23,8 @@ export interface PageSectionProps extends React.HTMLProps { children?: React.ReactNode; /** Additional classes added to the section */ className?: string; - /** Section background color variant */ - variant?: 'default'; + /** Section background color variant. This will only apply when the type prop has the "default" value. */ + variant?: 'default' | 'secondary'; /** Section type variant */ type?: 'default' | 'nav' | 'subnav' | 'breadcrumb' | 'tabs' | 'wizard'; /** Enables the page section to fill the available vertical space */ @@ -74,7 +75,8 @@ const variantType = { }; const variantStyle = { - [PageSectionVariants.default]: '' + [PageSectionVariants.default]: '', + [PageSectionVariants.secondary]: styles.modifiers.secondary }; export const PageSection: React.FunctionComponent = ({ @@ -112,7 +114,7 @@ export const PageSection: React.FunctionComponent = ({ variantType[type], formatBreakpointMods(padding, styles), formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true), - variantStyle[variant], + type === PageSectionTypes.default && variantStyle[variant], isFilled === false && styles.modifiers.noFill, isFilled === true && styles.modifiers.fill, isWidthLimited && styles.modifiers.limitWidth, diff --git a/packages/react-core/src/components/Page/examples/Page.md b/packages/react-core/src/components/Page/examples/Page.md index 4685d7a01d3..fea03fad8bb 100644 --- a/packages/react-core/src/components/Page/examples/Page.md +++ b/packages/react-core/src/components/Page/examples/Page.md @@ -16,7 +16,6 @@ propComponents: --- import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon'; -import './page.css'; import c_page_section_m_limit_width_MaxWidth from '@patternfly/react-tokens/dist/esm/c_page_section_m_limit_width_MaxWidth'; ## Examples diff --git a/packages/react-core/src/components/Page/examples/PageHorizontalNav.tsx b/packages/react-core/src/components/Page/examples/PageHorizontalNav.tsx index b3c26ba24cc..983ce3336b9 100644 --- a/packages/react-core/src/components/Page/examples/PageHorizontalNav.tsx +++ b/packages/react-core/src/components/Page/examples/PageHorizontalNav.tsx @@ -35,7 +35,7 @@ export const PageHorizontalNav: React.FunctionComponent = () => { return ( Section 1 - Section 2 + Section 2 with secondary variant styling Section 3 ); diff --git a/packages/react-core/src/components/Page/examples/PageVerticalNav.tsx b/packages/react-core/src/components/Page/examples/PageVerticalNav.tsx index a1248de01c1..d339c51e088 100644 --- a/packages/react-core/src/components/Page/examples/PageVerticalNav.tsx +++ b/packages/react-core/src/components/Page/examples/PageVerticalNav.tsx @@ -62,7 +62,7 @@ export const PageVerticalNav: React.FunctionComponent = () => { return ( Section 1 - Section 2 + Section 2 with secondary variant styling Section 3 ); diff --git a/packages/react-core/src/components/Page/examples/page.css b/packages/react-core/src/components/Page/examples/page.css deleted file mode 100644 index f2c0ff57695..00000000000 --- a/packages/react-core/src/components/Page/examples/page.css +++ /dev/null @@ -1,3 +0,0 @@ -.pf-v5-c-page__sidebar-body { - color: var(--pf-v5-global--Color--light-100); -}