Skip to content

Commit

Permalink
Make Button's PaddingY effected by SizeVariant
Browse files Browse the repository at this point in the history
  • Loading branch information
ImAvafe committed Oct 24, 2024
1 parent 17d3cdb commit ec190e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Components/Button.luau
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,15 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
return UDim.new(0, VariantSizes[Use(SizeVariant)])
end)
local PaddingY = Scope:Computed(function(Use)
return UDim.new(0, Use(Theme.Spacing["0.25"]))
local VariantSizes = {
ExtraSmall = 0.5,
Small = 0.75,
Medium = 1.25,
Large = 1.5,
ExtraLarge = 2,
}

return UDim.new(0, Use(Theme.Spacing["0.25"]) * VariantSizes[Use(SizeVariant)])
end)

return Scope:BaseButton(Util.CombineProps(Props, {
Expand Down

0 comments on commit ec190e0

Please sign in to comment.