Tcolorbox, titlerule or attach boxed title ruins transparency of the title

tcolorbox

Based on this answer I tried to get a transparent tcolorbox but I'd like to have a titlerule

enter image description here

I notice that when I add the line

  • the upperbox is not transparent, attach boxed title to top left
  • the full box appears titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}} ]

enter image description here

enter image description here

There must be a reason and I am certainly missing something.

MWE

\documentclass[tikz]{article}
\usepackage{xcolor}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}} ] <= I'd like it to be transparent
%    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}

Best Answer

With boxed titles, title style is independent of tcolorbox style, then you have to repeat opacity options into boxed title style.

In general the frame is not a line but a filled box over which the colback box is added. This is the reason why with opacityback=0 the resulting box shows darker because the frame is still visible.

\documentclass[tikz]{article}
\usepackage{xcolor}
\usepackage{pagecolor}
\pagecolor{yellow}
\usepackage[most]{tcolorbox}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, % <= I'd like it to be transparent
%    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}

\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
%    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, %  <= I'd like it to be transparent
    attach boxed title to top left, % <= I'd like it to be transparent
     opacityframe=0,    
    opacityback=0,  
    opacitybacktitle=0,
    boxed title style={opacityframe=0, opacityback=0}
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}

\begin{tcolorbox}[
%    standard jigsaw,
    enhanced,    
    title=Title,
    coltitle = red,
    titlerule style={red,arrows = {Hooks[arc=270]-Hooks[arc=270]}}, % <= I'd like it to be transparent
    %attach boxed title to top left, % <= I'd like it to be transparent
    opacityframe=0,    
    opacityback=0,  
%   opacitybacktitle=0,
%   boxed title style={opacityframe=0, opacityback=0}
]
This should have transparent backround. \\
Background should look yellow. 
\end{tcolorbox}
\end{document}

enter image description here

Related Question