RFR: 8344301: Refine stylesheet for API docs [v4]

Hannes Wallnöfer hannesw at openjdk.org
Fri Mar 7 09:27:54 UTC 2025


On Thu, 6 Mar 2025 12:04:49 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

>> Hannes Wallnöfer has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Changes:
>>     - Adjust subnav link color to meet WCAG contrast rules
>>     - Use subnav color for captions with links to meet WCAG rules
>>     - Make table header work with new caption color
>>     - Adjust some gaps
>>  - Changes:
>>     - Bring back breadcrumb highlight for current element
>>     - Use default tab color for search page caption
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css line 827:
> 
>> 825:     font-size: inherit;
>> 826: }
>> 827: code {
> 
> I noticed there is a duplicate `code` selector (first used in line 162), is this intentional?
> I also think it's odd to have `code` after `:is(h1, h2, h3, h4, h5, h6, sup, sub, small, big) code`

I merged the duplicate selectors. 

The `:is(...) code` selector is to use inherited (natural) font size in places where our standard code font size is not appropriate, such as in headings or the ["Discussion" sections in j.l.invoke.MethodHandles](https://cr.openjdk.org/~hannesw/8344301/api.06/java.base/java/lang/invoke/MethodHandles.html#exactInvoker(java.lang.invoke.MethodType)). This wouldn't be necessary if we would use relative font size for code, but we want a constant size in most places (text, summary lists, block tags, signatures) which would be much harder to get with relative size.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23678#discussion_r1984728510


More information about the javadoc-dev mailing list