This is an automated email from the ASF dual-hosted git repository.

ashb pushed a commit to branch details-tabs
in repository https://gitbox.apache.org/repos/asf/airflow-site.git

commit bc5d2aafa3702e0c3041f758bddf815bf1ef681b
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Tue Nov 3 14:11:13 2026 +0000

    Float the copy button and tighten padding on blog code blocks
    
    Docsy only positions its copy button inside .td-content, but blog posts
    render in .markdown-content, so the button took its own row above every
    code block. The inline-code padding also matched the <code> inside each
    <pre>, leaving a coloured strip before the first line.
    
    With the button floating over the top padding, the bottom no longer
    needs to match the top, and a full 1rem left a visible gap above the
    horizontal scrollbar. The top keeps 1rem so the button doesn't cover
    the first line.
---
 .../site/assets/scss/_markdown-content.scss        | 32 ++++++++++++++++++++++
 landing-pages/site/assets/scss/main-custom.scss    |  4 +++
 2 files changed, 36 insertions(+)

diff --git a/landing-pages/site/assets/scss/_markdown-content.scss 
b/landing-pages/site/assets/scss/_markdown-content.scss
index 48ac96550e..6f9512d866 100644
--- a/landing-pages/site/assets/scss/_markdown-content.scss
+++ b/landing-pages/site/assets/scss/_markdown-content.scss
@@ -72,6 +72,38 @@
   li {
     color: #707070;
   }
+
+  // Docsy floats its copy button only inside .td-content, which blog posts 
don't use.
+  .highlight {
+    position: relative;
+  }
+
+  pre {
+    padding-bottom: 0.5rem;
+  }
+
+  button.td-click-to-copy {
+    --bs-btn-box-shadow: 0;
+
+    position: absolute;
+    top: 2px;
+    right: 4px;
+    padding: var(--bs-btn-padding-y) calc(var(--bs-btn-padding-x) / 2);
+    border-width: 0;
+    background-color: transparent;
+    background-image: none;
+    color: var(--bs-tertiary-color);
+
+    &:hover,
+    &:active {
+      color: var(--bs-secondary-color);
+      background-color: var(--bs-dark-bg-subtle);
+    }
+
+    &:active {
+      transform: translateY(2px);
+    }
+  }
 }
 
 [data-bs-theme="dark"] .markdown-content {
diff --git a/landing-pages/site/assets/scss/main-custom.scss 
b/landing-pages/site/assets/scss/main-custom.scss
index aed26c099a..abcc2b2e5b 100644
--- a/landing-pages/site/assets/scss/main-custom.scss
+++ b/landing-pages/site/assets/scss/main-custom.scss
@@ -285,6 +285,10 @@ main li code,
   background-color: #1a1f2e;
 }
 
+.markdown-content pre > code {
+  padding: 0;
+}
+
 /* Focus-visible enhancement for interactive elements */
 :focus-visible {
   outline: 3px solid #017cee;

Reply via email to