File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
apps/builder/app/builder/shared Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -234,9 +234,16 @@ export const AddStyleInput = forwardRef<
234234 if ( property . startsWith ( "--" ) ) {
235235 const error = validateCssVariableName ( property ) ;
236236 if ( error ) {
237- // Show error via toast
238- toast . error ( error . message ) ;
239- return ;
237+ // For duplicate variables, show warning and continue updating the values
238+ if ( error . type === "duplicate" ) {
239+ toast . warn (
240+ `CSS variable "${ property } " already exists. Its value will be updated.`
241+ ) ;
242+ } else {
243+ // Show error via toast and block submission
244+ toast . error ( error . message ) ;
245+ return ;
246+ }
240247 }
241248 }
242249
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ export const $unusedCssVariables = computed(
270270 }
271271) ;
272272
273- export type CssVariableError =
273+ type CssVariableError =
274274 | { type : "required" ; message : string }
275275 | { type : "invalid" ; message : string }
276276 | { type : "duplicate" ; message : string } ;
You can’t perform that action at this time.
0 commit comments