diff --git a/agnosticui-svelte/copystyles.js b/agnosticui-svelte/copystyles.js index 3d6b54989..ea40ca708 100644 --- a/agnosticui-svelte/copystyles.js +++ b/agnosticui-svelte/copystyles.js @@ -7,13 +7,6 @@ const fs = require('fs'); * Buttons */ let css = fs.readFileSync('../agnosticui-css/button.css', 'utf8'); - -// For svelte we have to do a replacement since svg is a global: -css = css.replace(/(.*btn-icon-left )(svg)/, '$1:global($2)'); // :global(svg) -css = css.replace(/(.*btn-icon-right )(svg)/, '$1:global($2)') -css = css.replace(/(.*btn-icon-left )(\.btn-icon)/, '$1:global($2)'); // :global(svg) -css = css.replace(/(.*btn-icon-right )(\.btn-icon)/, '$1:global($2)') - const buttonSvelte = fs.readFileSync('./src/stories/Button.svelte', 'utf8'); const styleRegex = /`); diff --git a/agnosticui-svelte/src/__snapshots__/Storyshots.test.js.snap b/agnosticui-svelte/src/__snapshots__/Storyshots.test.js.snap index 27287905d..1959965c5 100644 --- a/agnosticui-svelte/src/__snapshots__/Storyshots.test.js.snap +++ b/agnosticui-svelte/src/__snapshots__/Storyshots.test.js.snap @@ -310,65 +310,64 @@ exports[`Storyshots Button Groups Button Group 1`] = ` `; -exports[`Storyshots Button Icons Button Icon Left Test 1`] = ` +exports[`Storyshots Button Icons Button Icons 1`] = `
- -
-`; - -exports[`Storyshots Button Icons Button Icon Right Test 1`] = ` -
- + + + /> + + Call + +
`; diff --git a/agnosticui-svelte/src/stories/Button.svelte b/agnosticui-svelte/src/stories/Button.svelte index fa2129cb0..539c4a610 100644 --- a/agnosticui-svelte/src/stories/Button.svelte +++ b/agnosticui-svelte/src/stories/Button.svelte @@ -560,24 +560,6 @@ Apply this class to the nth-of-type(2) onwards to ensure the borders line up pro margin-top: -1px; } -/** - * Button Icons - */ - -/* For envs like React, CSS Modules appears to allow element-based selector (e.g. `svg` here) -to leak through. So we leverage that so we don't have to do fancy regex when copying over styles. */ -.btn-icon-left :global(svg), -.btn-icon-left :global(.btn-icon) { /* When copying needs to become :global(.btn-icon) */ - margin-right: 6px; -} - -/* For envs like React, CSS Modules appears to allow element-based selector (e.g. `svg` here) -to leak through. So we leverage that so we don't have to do fancy regex when copying over styles. */ -.btn-icon-right :global(svg), -.btn-icon-right :global(.btn-icon) { /* When copying needs to become :global(.btn-icon) */ - margin-left: 6px; -} - /** * Invisible buttons. Generally used for a Cancel or icon button that behaves like a button, * semantically and for a11y, but, does so without all the typical "button chrome" behind it. @@ -595,7 +577,6 @@ to leak through. So we leverage that so we don't have to do fancy regex when cop outline: none; box-shadow: none; } - diff --git a/agnosticui-svelte/src/stories/ButtonIconRight.svelte b/agnosticui-svelte/src/stories/ButtonIconRight.svelte index 3c3b5e74f..a681ff443 100644 --- a/agnosticui-svelte/src/stories/ButtonIconRight.svelte +++ b/agnosticui-svelte/src/stories/ButtonIconRight.svelte @@ -8,9 +8,7 @@ } - + + +