\documentclass{book}
\usepackage[x11names]{xcolor}
\usepackage[explicit]{titlesec}
\usepackage{framed}
\colorlet{shadecolor}{Thistle3!30!}
\colorlet{framecolor}{PaleVioletRed3}
\definecolor{darkblue}{rgb}{0,0.08,0.45}
\newenvironment{frshaded*}{%
\def\FrameCommand{\fboxrule=\FrameRule\fboxsep=\FrameSep \fcolorbox{framecolor}{shadecolor}}%
\MakeFramed {\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
\titleformat{\chapter}[hang] %
{\color{PaleVioletRed4}\normalfont\Large\sffamily\bfseries\FrameSep 20pt\FrameRule=3pt}
{}
{0pt} % was 3pt
{\begin{frshaded*}\chaptername\hspace{3.6pt}\thechapter\kern8pt#1\end{frshaded*}\vskip-0.8ex\color{framecolor} \titlerule[1.2pt]}
\newcommand\Bheadfont{\fontsize{12pt}{\baselineskip}\selectfont}
\titleformat{\section}[hang] %
{\normalfont\scshape\color{darkblue}\Large\colorlet{shadecolor}{LightSteelBlue2!25!}\colorlet{framecolor}{darkblue} \FrameRule=1pt}
{}
{0pt}{\begin{frshaded*}\thesection\hskip0.618em\Bheadfont#1\end{frshaded*}}
\titleformat{\subsection}[hang] %
{\normalfont\scshape\color{darkblue}\colorlet{shadecolor}{LightSteelBlue2!25!}\colorlet{framecolor}{darkblue} \FrameRule=1pt\FrameSep=6pt}
{}
{0pt}{\begin{frshaded*}\thesubsection\hskip0.618em#1\end{frshaded*}}
\begin{document}
\chapter{This is a framed chapter}
\section{This is a framed section}
\subsection{This is a framed sub section}
\end{document}
答案1
您已\scshape
指定大写字母和小写字母。