CSS special case style treatment of dropcap when italicized versus only paragraph without em
- :first-child ::first-letter inline element em
With normal style, the dropcap looked best with no padding, but with italics we needed a little bit of right padding to prevent overlap. I could not find a way to stick em
into the targeting of the style directly, nested as i would ordinarily like to do with Sass, so ended up having to have two separate rules, with the em
one duplicating the other and adding the padding.
.full-article-has-dropcap > p:first-child:first-letter {
float: left;
font-size: 2.8em;
font-weight: 700;
}
// It is stupidly hard to conditionally change styles for italics dropcap.
// Need to make the em tag inline block so styles can work on it.
.full-article-has-dropcap > p:first-child > em {
display: inline-block;
&::first-letter {
float: left;
font-size: 2.8em;
font-weight: 700;
padding: 0 0.1em 0 0;
}
}