I would like to shade a node and the border of the node.
The following code works but I don't like it very much that I have to draw something after the node on the background layer. I would prefer a solution which can be used in a style and used on the node directly. Has someone a good idea?
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\tikzset{
shrink inner sep/.code={
\pgfkeysgetvalue{/pgf/inner xsep}{\currentinnerxsep}
\pgfkeysgetvalue{/pgf/inner ysep}{\currentinnerysep}
\pgfkeyssetvalue{/pgf/inner xsep}{\currentinnerxsep - 0.5\pgflinewidth}
\pgfkeyssetvalue{/pgf/inner ysep}{\currentinnerysep - 0.5\pgflinewidth}
}}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[rectangle,
rounded corners,
shading=axis,
thick,
outer sep=0pt,
shrink inner sep,
left color=red!50!white,
right color=green!50!white
](A){abcabc abc};
\begin{scope}[on background layer]
\shade[rectangle,
left color = red,
right color= green,
thick,
rounded corners=4pt+\pgflinewidth]
($(A.south west)+(-\pgflinewidth,-\pgflinewidth)$) rectangle
($(A.north east)+(\pgflinewidth,\pgflinewidth)$)
;
\end{scope};
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) node[rectangle,
rounded corners,
fill=red!50!white,
draw=red,
thick
](A){abcabc abc};
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) node[rectangle,
rounded corners,
shading=axis,
left color=red!50!white,
right color=green!50!white,
draw=red,
thick
](A){abcabc abc};
\end{tikzpicture}
\end{document}