How to use the @patternfly/react-styles.getModifier function in @patternfly/react-styles

To help you get started, we’ve selected a few @patternfly/react-styles examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Form / FormHelperText.tsx View on Github external
export const FormHelperText: React.FunctionComponent = ({
  children = null,
  isError = false,
  isHidden = true,
  className = '',
  ...props
}: FormHelperTextProps) => (
  <p>
    {children}
  </p>
);
github patternfly / patternfly-react / packages / react-core / src / layouts / Alignment / Alignment.js View on Github external
const Alignment = ({ children, className, align, component: Component, ...props }) =&gt; (
  
    {children}
  
);
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Progress / Progress.tsx View on Github external
'aria-valuemax': max
    };

    if (valueText) {
      ariaProps['aria-valuetext'] = valueText;
    }

    const scaledValue = Math.min(100, Math.max(0, Math.floor(((value - min) / (max - min)) * 100)));
    return (
      <div role="progressbar" id="{this.id}">
        
      </div>
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Alert / Alert.js View on Github external
'aria-label': ariaLabel = getDefaultAriaLabel(variant),
  action,
  title,
  children,
  className,
  ...props
}) =&gt; {
  variantLabel = variantLabel || capitalize(AlertVariant[variant]);
  const readerTitle = (
    
      <span>{`${variantLabel} alert:`}</span>
      {title}
    
  );

  const customClassName = css(styles.alert, getModifier(styles, variant, styles.modifiers.info), className);

  return (
    <div aria-label="{ariaLabel}">
      
      <h4>{readerTitle}</h4>
      {children &amp;&amp; (
        <div>
          <p>{children}</p>
        </div>
      )}
      {action &amp;&amp; (
        <div>{React.cloneElement(action, { title, variantLabel })}</div>
      )}
    </div>
  );
};
github patternfly / patternfly-react / packages / react-core / src / layouts / Grid / gridUtils.js View on Github external
export const getOffsetModifier = (value, size) => getModifier(styles, `offset-${value}-col${getSizeSuffix(size)}`);
github patternfly / patternfly-react / packages / patternfly-4 / react-table / src / components / Table / utils / decorators / cellWidth.ts View on Github external
export const cellWidth = (width: number | string): ITransform => () => ({
  className: css(getModifier(styles, `width_${width}`))
});
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / layouts / Grid / gridUtils.js View on Github external
export const getRowSpanModifier = (value, size) => getModifier(styles, `${value}-row${getSizeSuffix(size)}`);
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Title / Title.js View on Github external
const Title = ({ size, className, children, headingLevel: HeadingLevel, ...props }) =&gt; (
  
    {children}
  
);
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Popover / Popover.tsx View on Github external
{randomId =&gt;
          (
            
              <div aria-describedby="{`popover-${randomId}-body`}" aria-labelledby="{headerContent" aria-label="{headerContent" aria-modal="true" role="dialog">
                
                  
                  {headerContent &amp;&amp; {headerContent}}
                  {bodyContent}
                  {footerContent &amp;&amp; {footerContent}}
                
              </div>
github patternfly / patternfly-react / packages / patternfly-4 / react-core / src / components / Breadcrumb / BreadcrumbItem.tsx View on Github external
children = null,
  className = '',
  to = null,
  isActive = false,
  target = null,
  component = 'a',
  ...props
}: BreadcrumbItemProps) =&gt; {
  const Component = component as any;
  return (
    <li>
      {to &amp;&amp; (
        
          {children}
        
      )}
      {!to &amp;&amp; {children}}
      {!isActive &amp;&amp; (
        <span>
          
        </span>
      )}
    </li>
  );
};