Makie: Using a theme to set the margin of `axislegend`

Hello! Consider the following code:

using CairoMakie
x = 1:100
y = randn(length(x))

theme = Theme(
        padding=(50, 10, 10, 10),
        margin=(50, 50, 50, 50)
with_theme(theme) do
    fig = Figure(resolution=(300, 300))
    axis = Axis(fig[1, 1], xscale=log2)
    lines!(axis, x, y, label="test")
    axislegend(axis, position=:rb)
    save("test.pdf", fig, pt_per_unit=1)

It produces this image

Notice that the legend applied padding as specified by the theme, yet it ignored margin. To set margin, one needs to pass it as an argument, axislegend(..., margin=...).

Is that the intended behavior?