Skip to content

Commit 3fab0f8

Browse files
author
Eric Olkowski
committed
feat(Page): Added secondary variant styling for Penta work
1 parent 8bc9f34 commit 3fab0f8

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

packages/react-core/src/components/Page/PageSection.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { formatBreakpointMods } from '../../helpers/util';
55
import { PageContext } from './PageContext';
66

77
export enum PageSectionVariants {
8-
default = 'default'
8+
default = 'default',
9+
secondary = 'secondary'
910
}
1011

1112
export enum PageSectionTypes {
@@ -22,8 +23,8 @@ export interface PageSectionProps extends React.HTMLProps<HTMLDivElement> {
2223
children?: React.ReactNode;
2324
/** Additional classes added to the section */
2425
className?: string;
25-
/** Section background color variant */
26-
variant?: 'default';
26+
/** Section background color variant. This will only apply when the type prop has the "default" value. */
27+
variant?: 'default' | 'secondary';
2728
/** Section type variant */
2829
type?: 'default' | 'nav' | 'subnav' | 'breadcrumb' | 'tabs' | 'wizard';
2930
/** Enables the page section to fill the available vertical space */
@@ -74,7 +75,8 @@ const variantType = {
7475
};
7576

7677
const variantStyle = {
77-
[PageSectionVariants.default]: ''
78+
[PageSectionVariants.default]: '',
79+
[PageSectionVariants.secondary]: styles.modifiers.secondary
7880
};
7981

8082
export const PageSection: React.FunctionComponent<PageSectionProps> = ({
@@ -112,7 +114,7 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
112114
variantType[type],
113115
formatBreakpointMods(padding, styles),
114116
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
115-
variantStyle[variant],
117+
type === PageSectionTypes.default && variantStyle[variant],
116118
isFilled === false && styles.modifiers.noFill,
117119
isFilled === true && styles.modifiers.fill,
118120
isWidthLimited && styles.modifiers.limitWidth,

packages/react-core/src/components/Page/examples/Page.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ propComponents:
1616
---
1717

1818
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
19-
import './page.css';
2019
import c_page_section_m_limit_width_MaxWidth from '@patternfly/react-tokens/dist/esm/c_page_section_m_limit_width_MaxWidth';
2120

2221
## Examples

packages/react-core/src/components/Page/examples/page.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)