I want to redefine the aufgabe environment and combine it with the declared tcolorbox. In the end Aufgabe 1 subtitle should have the same textcolor/backgroundcolor like Exercise 0.1.
I also want to use the same command \begin{aufgabe}...\end{aufgabe}
with the redefined environment.
\documentclass{article}
\usepackage[skins,hooks,xparse,breakable]{tcolorbox}
\usepackage{xcolor}
\usepackage{chngcntr}
\usepackage{blindtext}
\usepackage{tikz}
\newcounter{examplecounter}
\counterwithin{examplecounter}{section}
\usetikzlibrary{calc}
\definecolor{headercolourgreen}{rgb}{0,0.7019,0.7019}
\usepackage[
typ=ab,
fach=,
lerngruppe=,
farbig
% nummer=2A,
% datumAnzeigen,
% namensfeldAnzeigen,
]{schule}
\DeclareTColorBox{new}{O{}}{
enhanced,
breakable,
arc=0pt,
boxrule=0pt,
colback=white,
before skip={2em}, % increase spacing before the env
overlay unbroken and first={
% draw box on the left
\node[fill=headercolourgreen!5,
font=\color{headercolourgreen}\sffamily\bfseries\large,
anchor=south west,
xshift=2mm
] (titlebox) at (frame.north west)
{Exercise \refstepcounter{examplecounter}\theexamplecounter};
\draw[draw=headercolourgreen, line width=2pt]
(titlebox.north west-|frame.north west)--+(0,-1.5);
},
%
}
\author{}
\title{}
\date{\today}
\begin{document}
\begin{aufgabe}[subtitle=subtitle]
\blindtext
\end{aufgabe}
\null
\begin{aufgabe}[subtitle=subtitle]
\blindtext
\end{aufgabe}
\null
\begin{new}
\blindtext
\end{new}
\null
\begin{new}
\blindtext
\end{new}
\end{document}