diff --git a/src/components/Icon/Icon.less b/src/components/Icon/Icon.less new file mode 100644 index 00000000..931d7527 --- /dev/null +++ b/src/components/Icon/Icon.less @@ -0,0 +1,15 @@ +// Calculation methodology +// https://github.com/cfpb/design-stories/issues/130#issuecomment-1670396537 +@width-of-1-nbsp: 0.3098125em; + +.u-icon-before-text .cf-icon-svg-wrapper { + margin-right: @width-of-1-nbsp; +} + +.u-icon-after-text .cf-icon-svg-wrapper { + margin-left: @width-of-1-nbsp; +} + +.t-icon-with-text { + width: 100%; +} \ No newline at end of file diff --git a/src/components/Icon/Icon.stories.tsx b/src/components/Icon/Icon.stories.tsx index 95869aa7..8bd2ff29 100644 --- a/src/components/Icon/Icon.stories.tsx +++ b/src/components/Icon/Icon.stories.tsx @@ -71,6 +71,56 @@ export const IconWithBackground = (): React.ReactElement => ( ); +export const IconWithText = (): React.ReactElement => { + const elements = ['h1', 'h2', 'h3', 'h4', 'h5', 'p', 'a']; + + return ( +
Element | +Text + Icon | +Icon + Text | +Round Icon + Text | +
---|---|---|---|
{element} | +
+ |
+
+
+ |
+
+ |
+
test space | +