Skip to content

Commit

Permalink
update monospace font styles, support custom width in toniq-chip
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Jul 28, 2022
1 parent d267ca4 commit 341f981
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system",
"version": "0.0.15",
"version": "0.0.16",
"private": false,
"description": "Design system elements for Toniq Labs",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions src/elements/toniq-chip/toniq-chip.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const ToniqChip = defineToniqElement({
:host {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
${toniqFontStyles.boldLabelFont}
padding: 4px 8px;
Expand Down
12 changes: 4 additions & 8 deletions src/elements/toniq-chip/toniq-chip.story.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ArgTypes, ComponentMeta} from '@storybook/react';
import React from 'react';
import {allIconsByCategory, Copy16Icon, Icp16Icon} from '../../icons';
import {allIconsByCategory, Copy16Icon} from '../../icons';
import {toniqFontStyles} from '../../styles';
import {cssToReactStyleObject} from '../../styles/css-to-react';
import {ToniqChip, ToniqIcon} from '../react-components';
Expand Down Expand Up @@ -83,14 +83,10 @@ export const mainStory = (controls: Record<keyof typeof chipStoryControls, strin
icon={Copy16Icon}
/>
<ToniqChip
style={{width: '200px'}}
className={className}
text={'with increased spacing styles'}
icon={Icp16Icon}
style={{
gap: '8px',
paddingRight: '12px',
paddingLeft: '12px',
}}
text={'with custom size'}
icon={Copy16Icon}
/>
</div>
</>
Expand Down
9 changes: 1 addition & 8 deletions src/styles/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const fontStylesFallbacks = wrapTypeWithReadonly<
},
monospaceFont: {
'font-family': css`'Inconsolata', monospace`,
'line-height': css`1.125em`,
},
boldMonospaceFont: {},
});

export const toniqFontStylesCssVarNames = mapObject(
Expand Down Expand Up @@ -136,15 +136,9 @@ export const toniqFontStyles = (() => {
`;

const monospaceFont = css`
${paragraphFont};
${combineFallbacksAndVars('monospaceFont')}
`;

const boldMonospaceFont = css`
${monospaceFont};
${combineFallbacksAndVars('boldFont')};
`;

return wrapTypeWithReadonly<Record<FontStyleKey, FontStyleDefinition>>()({
toniqFont,
normalWeightFont,
Expand All @@ -158,6 +152,5 @@ export const toniqFontStyles = (() => {
h2Font,
h3Font,
monospaceFont,
boldMonospaceFont,
});
})();

0 comments on commit 341f981

Please sign in to comment.