Skip to content

Commit

Permalink
feat(paragraph): support monospace font family
Browse files Browse the repository at this point in the history
  • Loading branch information
glrodasz committed Jan 11, 2022
1 parent 77cfacb commit 180ede5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions atoms/Paragraph/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const Paragraph = ({
className,
isStriked,
isInline,
isMonospace,
}) => {
return (
<div
Expand All @@ -21,6 +22,7 @@ export const Paragraph = ({
{
'is-striked': isStriked,
'is-inline': isInline,
'is-monospace': isMonospace,
}
)}
>
Expand All @@ -38,6 +40,7 @@ Paragraph.propTypes = {
className: PropTypes.string,
isStriked: PropTypes.bool,
isInline: PropTypes.bool,
isMonospace: PropTypes.bool,
}

Paragraph.defaultProps = {
Expand Down
4 changes: 4 additions & 0 deletions atoms/Paragraph/Paragraph.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
display: inline-block;
max-width: max-content;
}

.is-monospace {
font-family: var(--font-family-mono);
}
3 changes: 3 additions & 0 deletions atoms/Paragraph/Paragraph.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Striked.args = { isStriked: true }
export const Inline = Template.bind({})
Inline.args = { isInline: true, children: 'Swords are no more.' }

export const Monospace = Template.bind({})
Monospace.args = { isMonospace: true }

export const Colors = ListTemplate.bind({})
Colors.args = { items: options.colors.map((color) => ({ color })) }

Expand Down
23 changes: 23 additions & 0 deletions atoms/Paragraph/__snapshots__/Paragraph.stories.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ exports[`Storyshots Atoms/Paragraph Inline 1`] = `
</div>
`;

exports[`Storyshots Atoms/Paragraph Monospace 1`] = `
<div
style={
Object {
"alignContent": "flex-start",
"display": "flex",
"flexDirection": "column",
"flexWrap": "wrap",
"gap": "10px 30px",
"height": "100%",
"justifyContent": "flex-start",
"maxHeight": "auto",
}
}
>
<div
className="paragraph color-base size-md weight-normal is-monospace"
>
Swords are no more use here. Esquire days mountain Fangorn champion brace waiting laboring preparing! Canopy plunder deceit cakehole strange Udùn piled fighters potent?
</div>
</div>
`;

exports[`Storyshots Atoms/Paragraph Sizes 1`] = `
<div
style={
Expand Down

0 comments on commit 180ede5

Please sign in to comment.