From cb474dcce7add45af96136b598e0d0dd112bfca8 Mon Sep 17 00:00:00 2001
From: Philipp Stracker
Date: Wed, 22 Jan 2025 17:19:23 +0100
Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Shorten=20generic=20CSS=20?=
=?UTF-8?q?class=20names?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../reusable-components/_settings-block.scss | 12 ++++++------
.../Components/ReusableComponents/Elements/Action.js | 2 +-
.../ReusableComponents/Elements/Content.js | 2 +-
.../ReusableComponents/Elements/Description.js | 5 +----
.../Components/ReusableComponents/Elements/Header.js | 5 +----
.../Components/ReusableComponents/Elements/Title.js | 12 ++++--------
.../ReusableComponents/Elements/TitleExtra.js | 6 +-----
.../ReusableComponents/Elements/TitleWrapper.js | 2 +-
.../SettingsBlocks/ControlToggleButton.js | 8 ++++++--
9 files changed, 22 insertions(+), 32 deletions(-)
diff --git a/modules/ppcp-settings/resources/css/components/reusable-components/_settings-block.scss b/modules/ppcp-settings/resources/css/components/reusable-components/_settings-block.scss
index 95f479339..137079ca1 100644
--- a/modules/ppcp-settings/resources/css/components/reusable-components/_settings-block.scss
+++ b/modules/ppcp-settings/resources/css/components/reusable-components/_settings-block.scss
@@ -11,7 +11,7 @@
gap: 6px 0;
}
- .ppcp-r-settings-block__header {
+ .ppcp--header {
display: flex;
flex-direction: column;
gap: 6px;
@@ -21,7 +21,7 @@
}
}
- .ppcp-r-settings-block__title {
+ .ppcp--title {
@include font(11, 22, 600);
color: var(--color-text-title);
display: block;
@@ -42,14 +42,14 @@
}
}
- .ppcp-r-settings-block__title-wrapper {
+ .ppcp--title-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
}
&.ppcp-r-settings-block__feature {
- .ppcp-r-settings-block__title {
+ .ppcp--title {
@include font(13, 20, 600);
color: var(--color-text-main);
text-transform: none;
@@ -72,7 +72,7 @@
}
}
- .ppcp-r-settings-block__description {
+ .ppcp--description {
@include font(13, 20, 400);
margin: 0;
color: var(--color-text-description);
@@ -90,7 +90,7 @@
}
}
- .ppcp-r-settings-block__supplementary-title-label {
+ .ppcp--title-extra {
@include font(13, 20, 400);
color: var(--color-text-teriary);
text-transform: none;
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Action.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Action.js
index 3e5075503..d1b935a71 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Action.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Action.js
@@ -1,5 +1,5 @@
const Action = ( { children } ) => (
- { children }
+ { children }
);
export default Action;
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Content.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Content.js
index 4b22e1c78..feb544497 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Content.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Content.js
@@ -1,7 +1,7 @@
import classNames from 'classnames';
const Content = ( { children, asCard = true, className = '', id = '' } ) => {
- const elementClasses = classNames( 'ppcp-r-settings-content', className, {
+ const elementClasses = classNames( 'ppcp--content', className, {
'ppcp--is-card': asCard,
} );
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Description.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Description.js
index 87e61dba5..6f939db75 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Description.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Description.js
@@ -6,10 +6,7 @@ const Description = ( { children, className = '' } ) => {
return null;
}
- const elementClasses = classNames(
- 'ppcp-r-settings-block__description',
- className
- );
+ const elementClasses = classNames( 'ppcp--description', className );
if ( 'string' !== typeof children ) {
return { children };
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Header.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Header.js
index cfed32dd5..7a00e1ee8 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Header.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Header.js
@@ -5,10 +5,7 @@ const Header = ( { children, className = '' } ) => {
return null;
}
- const elementClasses = classNames(
- 'ppcp-r-settings-block__header',
- className
- );
+ const elementClasses = classNames( 'ppcp--header', className );
return { children }
;
};
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Title.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Title.js
index c3f42e6b2..4736fbed4 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Title.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Title.js
@@ -5,14 +5,10 @@ const Title = ( { children, noCaps = false, big = false, className = '' } ) => {
return null;
}
- const elementClasses = classNames(
- 'ppcp-r-settings-block__title',
- className,
- {
- 'ppcp--no-caps': noCaps,
- 'ppcp--big': big,
- }
- );
+ const elementClasses = classNames( 'ppcp--title', className, {
+ 'ppcp--no-caps': noCaps,
+ 'ppcp--big': big,
+ } );
return { children };
};
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleExtra.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleExtra.js
index 1d5025038..026ffa166 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleExtra.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleExtra.js
@@ -3,11 +3,7 @@ const TitleExtra = ( { children } ) => {
return null;
}
- return (
-
- { children }
-
- );
+ return { children };
};
export default TitleExtra;
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleWrapper.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleWrapper.js
index d3f55186e..ef66b0e6a 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleWrapper.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/TitleWrapper.js
@@ -1,5 +1,5 @@
const TitleWrapper = ( { children } ) => (
- { children }
+ { children }
);
export default TitleWrapper;
diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlToggleButton.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlToggleButton.js
index da4500086..7de0aa6d1 100644
--- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlToggleButton.js
+++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlToggleButton.js
@@ -2,15 +2,19 @@ import { ToggleControl } from '@wordpress/components';
import { Action, Description } from '../Elements';
const ControlToggleButton = ( { label, description, value, onChange } ) => {
+ const descriptionContent = description ? (
+ { description }
+ ) : null;
+
return (
{ description } }
+ help={ descriptionContent }
/>
);