This is a follow-up question from Google forms with tcolorbox
I am trying to get a higher top bar and a title and I get this:
Is there a way to vertically center the title? When augmenting the height of the title bar, there appears more space above the content text (Some content...). Is it possible to fix that too?
The code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[skins]{tcolorbox}
\definecolor{googleform-header}{HTML}{673AB7}
\definecolor{googleform-bg}{HTML}{EDE7f6}
\definecolor{googleform-frame}{RGB}{218,219,223}
\definecolor{googleform-pagebg}{RGB}{238,234,247}
\pgfkeys{/tcb/googlebox/.cd,top bar/.initial=1ex,frame arc/.initial=1mm}
\newtcolorbox{googlebox}[1][]{%
colback=white,colbacktitle=googleform-header,colframe=googleform-frame,
enhanced,width=0.9\linewidth,%halign title=flush center,
#1,
overlay={\pgfmathsetmacro\mytop{\pgfkeysvalueof{/tcb/googlebox/top bar}}
\pgfmathsetmacro\myarc{\pgfkeysvalueof{/tcb/googlebox/frame arc}}
\ifdim\mytop pt>\myarc pt
\fill[googleform-header]
([yshift=-\mytop pt]frame.north west) --
([yshift=-\myarc pt]frame.north west) arc[start angle=180,end angle=90,radius=\myarc pt]
--
([xshift=-\myarc pt]frame.north east) arc[start angle=90,end angle=0,radius=\myarc pt]
--
([yshift=-\mytop pt]frame.north east) -- cycle;
\fi},
boxrule=0.6pt,top=\pgfkeysvalueof{/tcb/googlebox/top bar}+2mm,
arc=\pgfkeysvalueof{/tcb/googlebox/frame arc},
fontupper=\sffamily,fonttitle=\sffamily
}
\begin{document}
\fcolorbox{googleform-pagebg}{googleform-pagebg}{\begin{minipage}{0.9\textwidth}
\centering
\begin{googlebox}[googlebox/top bar=7ex,
title={How to vertically center this title?}]
Some content with too much space above.
\end{googlebox}
\end{minipage}}
\end{document}
halign title=flush center,
has been commented out -- remove the % sign and tryvalign title=flush center
gives an error:Package pgfkeys Error: I do not know the key '/tcb/valign title'
,center title
title={\vphantom{\scriptsize1}\\How to vertically center this title?}]