♻️ Add prefix to CSS state-classes

This commit is contained in:
Philipp Stracker 2025-01-22 15:08:14 +01:00
parent 193e046a9a
commit 54504b7591
No known key found for this signature in database
15 changed files with 32 additions and 33 deletions

View file

@ -1,17 +1,16 @@
import classNames from 'classnames';
const Title = ( {
children,
altStyle = false,
big = false,
className = '',
} ) => {
const Title = ( { children, noCaps = false, big = false, className = '' } ) => {
if ( ! children ) {
return null;
}
const elementClasses = classNames(
'ppcp-r-settings-block__title',
className,
{
'style-alt': altStyle,
'style-big': big,
'ppcp--no-caps': noCaps,
'ppcp--big': big,
}
);

View file

@ -19,7 +19,7 @@ const Checkbox = ( {
}
}
const className = classNames( { 'is-disabled': disabled } );
const className = classNames( { 'ppcp--is-disabled': disabled } );
const onChange = ( newState ) => {
let newValue;

View file

@ -21,7 +21,7 @@ const SelectableContent = ( {
}
const boxClassName = classNames( 'ppcp-r-select-box', {
selected: isSelected,
'ppcp--selected': isSelected,
} );
const InputField = ( { isRadio } ) => {

View file

@ -2,7 +2,7 @@ import classNames from 'classnames';
const SettingsBlock = ( { className, children, separatorAndGap = true } ) => {
const blockClassName = classNames( 'ppcp-r-settings-block', className, {
'no-gap': ! separatorAndGap,
'ppcp--no-gap': ! separatorAndGap,
} );
return <div className={ blockClassName }>{ children }</div>;

View file

@ -20,10 +20,10 @@ const TopNavigation = ( {
const { isScrolled } = useIsScrolled();
const className = classNames( 'ppcp-r-navigation-container', {
'is-scrolled': isScrolled,
'ppcp--is-scrolled': isScrolled,
} );
const titleClassName = classNames( 'title', {
big: isMainTitle,
const titleClassName = classNames( 'ppcp--title', {
'ppcp--big': isMainTitle,
} );
const handleTitleClick = useCallback( () => {