\vspace adds the space at the point where it's called. So, for example if you write
Foo
\vspace{1in}
Foo
The space goes betwen paragraphs, while
Foo
\vspace{1in}
Foo
puts it after the line on which the first Foo appears. So surely, we should see, if we have
Foo
\desc{Foo}
that the space comes between the paragraphs, right? Except that you're using \DeclareTextFontCommand which does a little bit more. In particular, it does:
\def \DeclareTextFontCommand #1#2{%
\DeclareRobustCommand#1[1]{%
\ifmmode
\nfss@text{#2##1}%
\else
\hmode@bgroup % ❶
\text@command{##1}%
#2\check@icl ##1\check@icr
\expandafter
\egroup \fi
}
❶ is the critical line here. \hmode@bgroup leaves vertical mode (so it begins the paragraph) and then begins a group. So your \vspace is being output after the paragraph begins and comes after the first line.
Most likely, what you want is not to use \DeclareTextFontCommand at all. Assuming that you want to use this as a marker at the beginning of paragraphs, you could instead do:
\NewDocumentCommand{ m }{%
\par
\vspace{10px}
{%
\fontsize{11pt}{11pt}%
\fontseries{light}\selectfont
#1
}%
}
to get your desired effect.
(Side note, I'd not seen px as a unit in TeX before. It's apparently equivalent to bp or the PostScript point of 1/72 in. It's not mentioned in The TeXbook as far as I know. Apparently an eTeX enhancement as it's an illegal unit if I use tex but is available with pdftex and any of the LaTeX engines which all require eTeX.)
\vspaceexpands to the TeX primitive\vadjust, which does what you see. See e.g. https://tex.stackexchange.com/a/30065/82917. Oh, and the indentation is likely the product of spurious spaces in your definition. But again, please post a minimal working example (MWE) showing the issue. – campa Jun 07 '21 at 17:14