aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/inline-code.tsx
blob: 561666b0f13e7f79ff0c3915bfdea0840ca80419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as React from 'react';
import styled from 'styled-components';

import { colors } from '../variables';

interface InlineCodeProps {
    isAlt?: boolean;
    children: React.ReactNode;
}

const Code: React.StatelessComponent<InlineCodeProps> = ({ isAlt, children, ...props }) => (
    <code {...props}>{children}</code>
);

const InlineCode = styled(Code)`
    background-color: ${props => (props.isAlt ? '#E5E8E9' : colors.blueGray)};
    padding: 0.3125rem;
`;

export { InlineCode };