-
Notifications
You must be signed in to change notification settings - Fork 375
Description
The border comes from the presence of the header.
@mmenestr @mcarrano according to the design guidelines:
Code blocks can include multiple actions. By default, the copy action is always present and any other actions are optional and customizable.
It isn't built in to the react component - it has to be defined by the user. Does the design doc blurb imply the copy button is required? Or can it be optional? I would lean toward it being optional, in case it does something like show a code example/format that isn't meant to be copied/pasted. If so, I don't think we should render the header/actions block unless something is passed.
patternfly-react/packages/react-core/src/components/CodeBlock/CodeBlock.tsx
Lines 21 to 23 in 44af730
| <div className={css(styles.codeBlockHeader)}> | |
| <div className={css(styles.codeBlockActions)}>{actions && actions}</div> | |
| </div> |
We may also consider adding a __header-main element that is adjacent to the actions block for a user to place other items in the header. Currently it's only setup to accept the actions block. This code language toggle group is a good use case for that? https://codesandbox.io/s/code-editor-language-toggle-group-jcmqlb?file=/toggle.js
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

