Skip to content

Commit 6a26a97

Browse files
committed
fix: add comments, title in generated css
1 parent 8c52346 commit 6a26a97

File tree

2 files changed

+4
-2
lines changed
  • src
    • components/advanced-range-control
    • plugins/global-settings/preset-controls

2 files changed

+4
-2
lines changed

src/components/advanced-range-control/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ const AdvancedRangeControl = props => {
181181
}
182182

183183
// We need to change the way we handle the value and onChange if we're doing marks
184+
// Convert to float if the attribute is string to work with the slider
184185
let rangeValue = propsToPass.isDynamic || props.hasCSSVariableValue ? parseFloat( derivedValue ) : derivedValue
185186
let rangeOnChange = _onChange
186187
if ( isMarkMode ) {
@@ -266,7 +267,7 @@ AdvancedRangeControl.defaultProps = {
266267

267268
marks: undefined, // [{ value: '14px', name: 'S' }, { value: '16px', name: 'M' }]
268269
allowCustom: true,
269-
hasCSSVariableValue: false,
270+
hasCSSVariableValue: false, // If the attribute can have CSS variable value (string attribute\)
270271
isCustomPreset: false,
271272
}
272273

src/plugins/global-settings/preset-controls/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public function deepGet( $array, $keys ) {
107107
* @return String
108108
*/
109109
public function add_preset_controls_styles( $current_css ) {
110-
$generated_css = ":root {\n";
110+
$generated_css = "\n/* Global Preset Controls */\n";
111+
$generated_css .= ":root {\n";
111112

112113
foreach ( self::PRESET_MAPPING as $key => $value ) {
113114
if ( ! empty( $this->deepGet( $this->theme_presets, $value[ 'settings' ] )[ 'theme' ] ) ) {

0 commit comments

Comments
 (0)