reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Italics removed?

Open garretwilson opened this issue 9 years ago • 5 comments
trafficstars

I'm testing reveal.js. When I use <cite> within a presentation, it doesn't come out in italics. I even try to explicitly specify italics using CSS font-style: italic, but it doesn't work. The only way I can get italics for <cite> is if I force it using CSS !important.

What does reveal.js have against italics? <cite> should be in italics by default. Let me know if you need more info.

Thanks.

garretwilson avatar Aug 24 '16 21:08 garretwilson

Just ran into this myself, for folks who may not know much CSS, here's an example:

<p class="fragment">
What do I need to do EVERY TIME I work with X versus 
what I <i style="font-style: italic !important">may</i> do with X.
</p>

cfjedimaster avatar May 04 '20 19:05 cfjedimaster

I don't know how that applies to this issue. I am wanting <cite> to be shown in italics. I want to use the standard approach to styling elements: providing the italics in a stylesheet. You didn't even mention <cite> in your example.

Without trying to be mean, almost everything you provided in your example is against best practices.

  • Inline styles are bad practice.
  • The use of !important should only be used as a last resort.
  • Moreover the use of <i> to represent emphasis is directly against semantic use of HTML. Instead <em> should be used.

All of this is against best practices as described in the specifications themselves. I can provide references if you want, but all of this is in introductory HTML/CSS books. I don't want to seem critical, but I wouldn't want some person learning HTML/CSS to look at your example and follow it. It is an example of how not to do things, unfortunately.

garretwilson avatar May 04 '20 19:05 garretwilson

Wow.

So first off, I wasn't using cite, and I also had italics removed. So I figured it was a problem globally within Reveal.

Secondly, I wanted to provide a quick and dirty solution that worked. I rarely use inline styles, but will from time to time when I'm doing a quick modification. I also do so in Reveal from time to time when I need to do something not directly supported. I'm typically more concerned about the content of the presentation than following best practices for a web application.

You could have made your point so much easier about the cite issue without needing to go so far over the top in your reply. I absolutely agree I should have mentioned that it happened w/o using cite, that would be been helpful.

Have a nice day.

cfjedimaster avatar May 04 '20 20:05 cfjedimaster

You could have made your point so much easier about the cite issue without needing to go so far over the top in your reply.

My friend, you specifically mentioned that your example was "for folks who may not know much CSS". I feel it very important that those "who may not know much about CSS" understand that the example above is directly contrary to best practices; otherwise they might be learning the wrong way to do things, especially since you implied that your example was something for newbies to learn from and follow. I did go out of my way to mention several times I wasn't trying to be mean, and I reiterate that.

All the best.

garretwilson avatar May 05 '20 00:05 garretwilson

It is no longer necessary to write !important to make cite go italic, although the font-style: italic rule is needed to make it so. How about we close this issue?

Martinomagnifico avatar Sep 10 '22 16:09 Martinomagnifico

I have very good news all around on this ticket. I tested with the latest version 4.3.1.

  • !important is no longer needed to override the font-style CSS property for <em>, <dfn>, and <cite>.
  • In fact the simple theme already sets <em> to have a font-style of italic.
  • Even better, all of these elements allow the default user agent font-style (usually font-style: italic) to appear if unset elsewhere!

This is wonderful news. Thank you for addressing this. I'll close the ticket.

garretwilson avatar Oct 13 '22 21:10 garretwilson