/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ .codeBlockContainer { margin-bottom: var(--ifm-leading); border-radius: var(--ifm-global-radius); box-shadow: var(--ifm-global-shadow-lw); overflow: hidden; } .codeBlockContent { position: relative; /*rtl:ignore*/ direction: ltr; } .codeBlockTitle { border-bottom: 1px solid var(--ifm-color-emphasis-300); font-size: var(--ifm-code-font-size); font-weight: 500; padding: 0.75rem var(--ifm-pre-padding); } .codeBlock { margin: 0; padding: 0; border-radius: 0; } /* Holds the Try and Copy buttons in the top-right corner and drives the shared hover-reveal, so the two buttons always fade in and out together. */ .buttonGroup { position: absolute; top: calc(var(--ifm-pre-padding) / 2); right: calc(var(--ifm-pre-padding) / 2); display: flex; align-items: center; gap: 0.5rem; opacity: 0; transition: opacity 200ms ease-in-out; } .copyButton, .tryButton { display: inline-flex; align-items: center; gap: 0.3rem; background: rgba(0, 0, 0, 0.3); border-radius: var(--ifm-global-radius); color: var(--ifm-color-white); font-size: 0.8rem; user-select: none; padding: 0.4rem 0.5rem; transition: color 150ms ease-in-out; } .buttonIcon { width: 0.9rem; height: 0.9rem; fill: currentColor; flex-shrink: 0; } /* On docs pages these blocks render inside .markdown, whose prose-link rule (custom.css) underlines every and recolors it on hover. The Try button is an anchor, so keep it identical to the Copy button: no underline in any state, always white. Scoped through .codeBlockContent to outweigh that rule. line-height: normal matches the anchor's height to the