variant: fix auto mode variant detection in stylesheet generator #679

This commit is contained in:
Sören Weber 2023-11-23 21:51:01 +01:00
parent 93d42ffb5e
commit 286b6a13ac
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -353,18 +353,18 @@ var variants = {
changeColor: function( c, without_prompt ){
var with_prompt = !(without_prompt || false);
if( this.getVariant() == 'auto' ){
if( with_prompt ){
alert( 'The Auto variant can not be changed. Please select the light/dark variant directly to make changes' );
}
return;
}
var read_style = this.findLoadedStylesheet( 'R-custom-variant-style' );
var write_style = this.findLoadedStylesheet( 'R-variant-style' );
if( !read_style ){
read_style = write_style;
}
if( !read_style ){
if( with_prompt ){
alert( 'A auto mode variant can not be changed. Please select its light/dark variant directly to make changes' );
}
return;
}
var e = this.findColor( c );
var v = this.getColorProperty( c, read_style );