In a manually defined skin for tcolorbox
, I'd like to have a frame for the complete box, but no particular background or borderings for \tcbsubtitle
. I don't know if one can select transparency for the subtitle style
, but selecting colback = white
leads to a white background that reaches into the boxes frame by just a bit.
How can I avoid that the subtitle background leaps over into the frame? Maybe something like frame engine=pathmiddle
just for the subtitle?
\documentclass{article}
\usepackage{tcolorbox, xcolor}
\tcbuselibrary{breakable, skins, xparse}
\tcbset
{
skin = empty,
width = \linewidth,
breakable = true,
fonttitle = \sffamily\bfseries\Large,
coltitle = black,
graphical environment = tikzpicture,
sharp corners = all,
no shadow
}
\DeclareTColorBox{framed}{m O{1mm} O{blue}}
{
graphical environment = tikzpicture,
title = {#1},
boxsep = 0pt,
toptitle = 5mm,
top = 5mm,
bottom = 5mm,
left = 5mm,
right = 5mm,
borderline = {#2}{0pt}{#3},
beforeafter skip balanced = \baselineskip,
subtitle style =
{
top = 3.25ex,
boxrule = 0pt,
colback = white,
fontupper = \normalfont\sffamily\bfseries\large
}
}
\begin{document}
\begin{framed}{My title}
content...
\tcbsubtitle{My subtitle}
\end{framed}
\end{document}