To style copy-to-clipboard codeblocks, use the following CSS properties:
| Variable name | Description |
|---|---|
|
Sets copy block button's background color. |
|
Sets copy block button's color. |
|
Sets copy block button's icon size. |
|
Sets copy block's background color. |
|
Sets copy block's border color. |
|
Sets copy block's border radius. |
|
Sets copy block's border style. |
|
Sets copy block's border width. |
|
Sets copy block button's height. |
|
Sets copy block's spacing between elements. |
For example:
-
Add the following example to a Markdown document:
<ft-copy-block>console.log("Hello world!")</ft-copy-block> -
Publish the Markdown document.
-
Add the following example to the portal's Content styles:
ft-copy-block { font-family: monospace, monospace; --ft-button-background-color: transparent; --ft-button-color: indigo; --ft-copy-block-background-color: rgb(230, 230, 234); --ft-copy-block-border-color: indigo; --ft-copy-block-border-style: dotted; --ft-copy-block-border-width: 5px; }
This styling results in the following example: