diff --git a/css/elements.css b/css/elements.css index 7a6c0934..ad2183a2 100644 --- a/css/elements.css +++ b/css/elements.css @@ -769,6 +769,24 @@ table.lightweight-table th { vertical-align: baseline; } +/* for non-clause-like link targets, apply a fading highlight + and a persistent focus-associated highlight */ +@keyframes highlight-target-bg { + 0% { + background-color: rgba(249, 241, 172, 1); + } + 100% { + background-color: rgba(249, 241, 172, 0) + } +} +#spec-container :target:not(emu-annex, emu-clause, emu-intro, emu-note, body) { + animation: highlight-target-bg 2.5s ease-out; +} +#spec-container :target:focus-within:not(:has(:not(a))) { + animation: none; + background-color: rgba(249, 241, 172, 1); +} + /* diff styles */ ins { background-color: #e0f8e0; diff --git a/src/Dfn.ts b/src/Dfn.ts index d2da9e1b..b048b98f 100644 --- a/src/Dfn.ts +++ b/src/Dfn.ts @@ -7,6 +7,10 @@ import Builder from './Builder'; /*@internal*/ export default class Dfn extends Builder { static async enter({ spec, node, clauseStack }: Context) { + if (!node.hasAttribute('tabindex')) { + node.setAttribute('tabindex', '-1'); + } + const parentClause = clauseStack[clauseStack.length - 1]; if (!parentClause) return; diff --git a/test/baselines/generated-reference/autolinking.html b/test/baselines/generated-reference/autolinking.html index f1f8fe75..e2d51ec8 100644 --- a/test/baselines/generated-reference/autolinking.html +++ b/test/baselines/generated-reference/autolinking.html @@ -11,12 +11,12 @@
Type, type,
Lowercase
-strict mode
-%Percent%
-extra spaces
-Await
-Variants
+Lowercase
+strict mode
+%Percent%
+extra spaces
+Await
+Variants
The term dfn means the dfn tag. Other mentions of dfn in this clause should not be auto-linked.
+The term dfn means the dfn tag. Other mentions of dfn in this clause should not be auto-linked.
-Terms with ids are called id dfns. Since this dfn has an id, other occurences +
Terms with ids are called id dfns. Since this dfn has an id, other occurences
of
This is some content and such.
+This is some content and such.
Normative Optional is a defined term, as is Legacy. For comparison, "Deprecated" is not.
+Normative Optional is a defined term, as is Legacy. For comparison, "Deprecated" is not.