Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(typography): fix code type styles not using mono font #3429

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions src/components/TypesetStyle/TypesetExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
baseFontSize,
breakpoints as carbonBreakpoints,
} from '@carbon/elements';
import { CodeSnippet } from '@carbon/react';
import { CodeSnippet, Layer } from '@carbon/react';

const breakpoints = {
sm: Number(carbonBreakpoints.sm.width.replace('rem', '')) * baseFontSize,
Expand Down Expand Up @@ -112,10 +112,10 @@ const TypesetExample = (props) => (
warning: currentBreakpointSpecs.warning,
};

const versionClassName = type.version ? `bx--type-${type.version}` : '';
const versionClassName = type.version ? `cds--type-${type.version}` : '';

const versionClassNames = classnames(
`bx--type-${type.key}`,
`cds--type-${type.key}`,
versionClassName
);

Expand All @@ -132,39 +132,41 @@ const TypesetExample = (props) => (
</div>
<div
className={`cds--typeset-example-specs cds--col-md-3 cds--padding`}>
<span className={`bx--type-body-short-01`}>
<span className={`bx--type-semibold`}>{type.name} </span>
<br />
Type: {displaySpecs.font}
<br />
Size: {displaySpecs.fontSize}
<br />
Line height: {displaySpecs.lineHeight}
<br />
Weight:{' '}
<span style={{ textTransform: 'capitalize' }}>
{displaySpecs.fontWeight}
</span>
<br />
Letter spacing: {displaySpecs.letterSpacing}px
<br />
Type set: {displaySpecs.typeSet}
{displaySpecs.warning != null ? (
<span>
<br />
<span className={`bx--type-semibold`}>warning: </span>
{displaySpecs.warning}
<br />
<Layer>
<span className={`cds--type-body-short-01`}>
<span className={`cds--type-semibold`}>{type.name} </span>
<br />
Type: {displaySpecs.font}
<br />
Size: {displaySpecs.fontSize}
<br />
Line height: {displaySpecs.lineHeight}
<br />
Weight:{' '}
<span style={{ textTransform: 'capitalize' }}>
{displaySpecs.fontWeight}
</span>
) : (
<br />
)}
<div className={`cds--typeset-example-code-style`}>
<CodeSnippet type="inline" feedback="Copied!" light>
${type.name.split(' ')[0]}
</CodeSnippet>
</div>
</span>
Letter spacing: {displaySpecs.letterSpacing}px
<br />
Type set: {displaySpecs.typeSet}
{displaySpecs.warning != null ? (
<span>
<br />
<span className={`cds--type-semibold`}>warning: </span>
{displaySpecs.warning}
<br />
</span>
) : (
<br />
)}
<div className={`cds--typeset-example-code-style`}>
<CodeSnippet type="inline" feedback="Copied!" light>
${type.name.split(' ')[0]}
</CodeSnippet>
</div>
</span>
</Layer>
</div>
</div>
</div>
Expand Down