From 794d13495c88d91d1a2c0859d0864ba4a7e01583 Mon Sep 17 00:00:00 2001 From: Hichem Fantar Date: Sat, 25 Jan 2025 23:31:22 +0100 Subject: [PATCH 1/2] fix(styles): improve subheading anchor visibility and color adjustments --- packages/nextra/styles/subheading-anchor.css | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/nextra/styles/subheading-anchor.css b/packages/nextra/styles/subheading-anchor.css index 871eb40e0f..4a4f580aae 100644 --- a/packages/nextra/styles/subheading-anchor.css +++ b/packages/nextra/styles/subheading-anchor.css @@ -1,26 +1,25 @@ +:hover>.subheading-anchor { + @apply x:opacity-100; +} + .subheading-anchor { @apply x:ms-1; - /* to avoid conflicts with docs heading which has class `target:_animate-[fade-in_1.5s]` */ - :not(:target) > & { - @apply x:opacity-0 x:transition; - } + @apply x:opacity-0 x:transition; - &, :target > &, - &:hover, &:focus { @apply x:opacity-100; } :target > & { /* https://github.com/tailwindlabs/tailwindcss/issues/15597#issuecomment-2582673546 */ - @apply x:after:text-gray-400 x:dark:after:text-neutral-500; + @apply x:after:text-gray-500 x:dark:after:text-neutral-500; } &:after { @apply x:content-['#'] x:px-1; } /* https://github.com/tailwindlabs/tailwindcss/issues/15597#issuecomment-2582673546 */ - @apply x:after:text-gray-300 x:dark:after:text-neutral-700; + @apply x:after:text-gray-400 x:dark:after:text-neutral-600; } From 0c49f5600bd3971d59dcc08e796a13a157e21263 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Tue, 28 Jan 2025 17:36:04 +0700 Subject: [PATCH 2/2] allow change `_meta` file `theme.toc` property with `type: 'page'` --- .changeset/early-flowers-wash.md | 5 +++++ packages/nextra/styles/subheading-anchor.css | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/early-flowers-wash.md diff --git a/.changeset/early-flowers-wash.md b/.changeset/early-flowers-wash.md new file mode 100644 index 0000000000..2563c21a92 --- /dev/null +++ b/.changeset/early-flowers-wash.md @@ -0,0 +1,5 @@ +--- +"nextra-theme-docs": patch +--- + +fix: show heading anchor when hover on heading itself diff --git a/packages/nextra/styles/subheading-anchor.css b/packages/nextra/styles/subheading-anchor.css index 4a4f580aae..bf1eaa494a 100644 --- a/packages/nextra/styles/subheading-anchor.css +++ b/packages/nextra/styles/subheading-anchor.css @@ -1,4 +1,4 @@ -:hover>.subheading-anchor { +:hover > .subheading-anchor { @apply x:opacity-100; }