11import { css } from '@patternfly/react-styles' ;
22import styles from '@patternfly/react-styles/css/components/Accordion/accordion' ;
3- import { hasGlassTheme } from '../../helpers/util' ;
43import { AccordionContext } from './AccordionContext' ;
54
65export interface AccordionProps extends React . HTMLProps < HTMLDListElement > {
@@ -16,11 +15,9 @@ export interface AccordionProps extends React.HTMLProps<HTMLDListElement> {
1615 asDefinitionList ?: boolean ;
1716 /** Flag to indicate the accordion had a border */
1817 isBordered ?: boolean ;
19- /**
20- * Flag to indicate if the accordion uses plain styling. Only applicable when the PatternFly glass
21- * theme is active (e.g. `pf-v6-theme-glass` on the document root); when the glass theme is not
22- * active, this prop has no effect.
23- */
18+ /** Flag to prevent the accordion from automatically applying plain styling when glass theme is enabled. */
19+ isNoPlainOnGlass ?: boolean ;
20+ /** Flag to add plain styling to the accordion. */
2421 isPlain ?: boolean ;
2522 /** Display size variant. */
2623 displaySize ?: 'default' | 'lg' ;
@@ -35,6 +32,7 @@ export const Accordion: React.FunctionComponent<AccordionProps> = ({
3532 headingLevel = 'h3' ,
3633 asDefinitionList = true ,
3734 isBordered = false ,
35+ isNoPlainOnGlass = false ,
3836 isPlain = false ,
3937 displaySize = 'default' ,
4038 togglePosition = 'end' ,
@@ -46,7 +44,8 @@ export const Accordion: React.FunctionComponent<AccordionProps> = ({
4644 className = { css (
4745 styles . accordion ,
4846 isBordered && styles . modifiers . bordered ,
49- ! isPlain && hasGlassTheme ( ) && styles . modifiers . noPlain ,
47+ isNoPlainOnGlass && styles . modifiers . noPlain ,
48+ isPlain && styles . modifiers . plain ,
5049 togglePosition === 'start' && styles . modifiers . toggleStart ,
5150 displaySize === 'lg' && styles . modifiers . displayLg ,
5251 className
0 commit comments