From c90e491562c74d8f2bb0f52897cde86300ac0363 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Wed, 12 Oct 2022 03:00:48 -0700 Subject: [PATCH] Improve accessibility for expandable details (#24532) --- plugins/details.rb | 23 +++++++++++++++++------ sass/custom/_details.scss | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/plugins/details.rb b/plugins/details.rb index 5e081d1de98..d1d5daa96bc 100644 --- a/plugins/details.rb +++ b/plugins/details.rb @@ -4,6 +4,7 @@ module Jekyll def initialize(tag_name, title, tokens) super @title = title + @details_idx = 1 end def render(context) @@ -15,25 +16,35 @@ module Jekyll end title = title.to_s.delete("\"") + idx = context["details_idx"] + if idx.nil? then + idx = 0 + end + context["details_idx"] = idx + 1 + <<~MARKUP
-
+
+ +
MARKUP diff --git a/sass/custom/_details.scss b/sass/custom/_details.scss index 038428b8d00..04b5b9957be 100644 --- a/sass/custom/_details.scss +++ b/sass/custom/_details.scss @@ -18,6 +18,9 @@ div.details-block { justify-content: space-between; display: flex; align-items: center; + background-color: white; + border: 0px; + width: 100%; } .details-block-content { margin: 4px 32px 12px 0;