For some reason I want to mix tikz with commands, but sometimes it doesn't work.
What works
If I use \newcommand{\mycommand}{ultra thick} it compiles.
\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\newcommand{\mycommand}{ultra thick}
\begin{document}
\begin{tikzpicture}
\draw [\mycommand, draw=black, fill=yellow, fill opacity=0.2]
(0,0) -- (0,1) -- (1,1) -- cycle;
\end{tikzpicture}
\end{document}
What doesn't work
If I use \newcommand{\mycommand}{fill=yellow} it doesn't compile.
\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\newcommand{\mycommand}{fill=yellow}
\begin{document}
\begin{tikzpicture}
\draw [ultra thick, draw=black, \mycommand, fill opacity=0.2]
(0,0) -- (0,1) -- (1,1) -- cycle;
\end{tikzpicture}
\end{document}
Can somebody help me to fix the second example?
Maybe there's even a better solution.