Expanding macro defined by \csdef to define a style via \tikzset

You can use expanded instead of expand once in your MWE:

\tikzset{Node Options/.style/.expanded=\csuse{My Node Option}}%% ????

\csuse{...} is not quite the same as \csname...\endcsname:

% etoolbox.sty, line 883:

If you expand once in your context you get

\ifcsname My Node Option\endcsname\csname My Node Option\endcsname\fi

A further expansion step will remove the conditional, leaving

\csname My Node Option\endcsname\fi

which requires two expansion steps in order to deliver

draw=red, thick, fill=yellow\fi

but then the \fi kicks in, because it is shuffled around at the wrong place.

You can do

\tikzset{Node Options/.style/.expand twice=\csname My Node Option\endcsname}

that avoids the problem of the dangling \if.

However, the best strategy, in my opinion, is to use styles all around:




\tikzset{My Node Option/.style={draw=red, thick, fill=yellow}}

\tikzset{Node Options/.style=My Node Option}

\node [Node Options] at (0,0) {Node Text};


You can use the \begingroup\edef\x{\endgroup <stuff to expand>}\x expansion trick:




\csdef{My Node Option}{draw=red, thick, fill=yellow}

    \noexpand\tikzset{Node Options/.style={\csuse{My Node Option}}}}%

  \node [Node Options] at (0,0) {Node Text};


Note the additional braces around the \csuse.