fix button border radius processed by parse_size()
This commit is contained in:
@@ -371,11 +371,6 @@ static func parse_utility_class_internal(rule: CSSRule, utility_name: String) ->
|
||||
rule.properties["order"] = val.to_int()
|
||||
return
|
||||
|
||||
# Handle border-radius classes like rounded-8, rounded-lg, etc.
|
||||
if utility_name.begins_with("rounded-"):
|
||||
var val = utility_name.substr(8)
|
||||
rule.properties["border-radius"] = parse_size(val)
|
||||
return
|
||||
if utility_name == "rounded":
|
||||
rule.properties["border-radius"] = "4px" # Default rounded
|
||||
return
|
||||
@@ -454,6 +449,13 @@ static func parse_utility_class_internal(rule: CSSRule, utility_name: String) ->
|
||||
rule.properties["border-radius"] = radius_value
|
||||
return
|
||||
|
||||
# Handle numeric border radius classes like rounded-8, rounded-12, etc.
|
||||
if utility_name.begins_with("rounded-"):
|
||||
var val = utility_name.substr(8)
|
||||
if val.is_valid_int():
|
||||
rule.properties["border-radius"] = str(int(val)) + "px"
|
||||
return
|
||||
|
||||
# Handle more utility classes as needed
|
||||
# Add more cases here for other utilities
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ extends Control
|
||||
@onready var rich_text_label: RichTextLabel = $RichTextLabel
|
||||
|
||||
func init(element: HTMLParser.HTMLElement, parser: HTMLParser = null) -> void:
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -3,4 +3,4 @@ extends Control
|
||||
@onready var rich_text_label: RichTextLabel = $RichTextLabel
|
||||
|
||||
func init(element: HTMLParser.HTMLElement, parser: HTMLParser = null) -> void:
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user