summaryrefslogtreecommitdiffstats
path: root/wp-includes/style-engine/class-wp-style-engine.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/style-engine/class-wp-style-engine.php')
-rw-r--r--wp-includes/style-engine/class-wp-style-engine.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/wp-includes/style-engine/class-wp-style-engine.php b/wp-includes/style-engine/class-wp-style-engine.php
index 99372b5..1ba813e 100644
--- a/wp-includes/style-engine/class-wp-style-engine.php
+++ b/wp-includes/style-engine/class-wp-style-engine.php
@@ -364,6 +364,7 @@ final class WP_Style_Engine {
* Stores a CSS rule using the provided CSS selector and CSS declarations.
*
* @since 6.1.0
+ * @since 6.6.0 Added the `$rules_group` parameter.
*
* @param string $store_name A valid store key.
* @param string $css_selector When a selector is passed, the function will return
@@ -371,12 +372,14 @@ final class WP_Style_Engine {
* otherwise a concatenated string of properties and values.
* @param string[] $css_declarations An associative array of CSS definitions,
* e.g. `array( "$property" => "$value", "$property" => "$value" )`.
+ * @param string $rules_group Optional. A parent CSS selector in the case of nested CSS, or a CSS nested @rule,
+ * such as `@media (min-width: 80rem)` or `@layer module`.
*/
- public static function store_css_rule( $store_name, $css_selector, $css_declarations ) {
+ public static function store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group = '' ) {
if ( empty( $store_name ) || empty( $css_selector ) || empty( $css_declarations ) ) {
return;
}
- static::get_store( $store_name )->add_rule( $css_selector )->add_declarations( $css_declarations );
+ static::get_store( $store_name )->add_rule( $css_selector, $rules_group )->add_declarations( $css_declarations );
}
/**
@@ -467,6 +470,7 @@ final class WP_Style_Engine {
foreach ( $style_definition['classnames'] as $classname => $property_key ) {
if ( true === $property_key ) {
$classnames[] = $classname;
+ continue;
}
$slug = static::get_slug_from_preset_value( $style_value, $property_key );