Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-core/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export interface CardProps extends React.HTMLProps<HTMLElement>, OUIAProps {
isFullHeight?: boolean;
/** Modifies the card to include plain styling; this removes border and background */
isPlain?: boolean;
/** Modifies the card to include glass styling */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be worth clarifying that it'll include glass styling when the glass contrast mode is enabled?

isGlass?: boolean;
/** Flag indicating if a card is expanded. Modifies the card to be expandable. */
isExpanded?: boolean;
/** Card background color variant */
Expand Down Expand Up @@ -81,6 +83,7 @@ const CardBase: React.FunctionComponent<CardProps> = ({
isLarge = false,
isFullHeight = false,
isPlain = false,
isGlass = false,
variant = 'default',
ouiaId,
ouiaSafe = true,
Expand Down Expand Up @@ -138,6 +141,7 @@ const CardBase: React.FunctionComponent<CardProps> = ({
isLarge && styles.modifiers.displayLg,
isFullHeight && styles.modifiers.fullHeight,
isPlain && styles.modifiers.plain,
isGlass && styles.modifiers.glass,
variant === 'secondary' && styles.modifiers.secondary,
getSelectableModifiers(),
isDisabled && styles.modifiers.disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ describe('Card', () => {
expect(consoleWarnMock).toHaveBeenCalled();
});

test('card with isGlass applied', () => {
render(<Card isGlass>glass card</Card>);
expect(screen.getByText('glass card')).toHaveClass('pf-m-glass');
});

test('card with variant set to secondary ', () => {
render(<Card variant="secondary">secondary card</Card>);

Expand Down
Loading