Commit d4096622 authored by Kyle Keating's avatar Kyle Keating Committed by Kyle Keating

Rename svg-icon.scss to SvgIcon.scss

Rename "svg-icon" class to "SvgIcon"
parent de48c42f
...@@ -68,7 +68,7 @@ export function SvgIcon({ name, className = '', inline = false, title = '' }) { ...@@ -68,7 +68,7 @@ export function SvgIcon({ name, className = '', inline = false, title = '' }) {
return ( return (
<span <span
className={classnames('svg-icon', { 'svg-icon--inline': inline })} className={classnames('SvgIcon', { 'SvgIcon--inline': inline })}
dangerouslySetInnerHTML={{ __html: markup }} dangerouslySetInnerHTML={{ __html: markup }}
ref={element} ref={element}
{...spanProps} {...spanProps}
......
...@@ -65,16 +65,16 @@ describe('SvgIcon', () => { ...@@ -65,16 +65,16 @@ describe('SvgIcon', () => {
const container = document.createElement('div'); const container = document.createElement('div');
render(<SvgIcon name="arrow-left" />, container); render(<SvgIcon name="arrow-left" />, container);
const wrapper = container.querySelector('span'); const wrapper = container.querySelector('span');
assert.isTrue(wrapper.classList.contains('svg-icon')); assert.isTrue(wrapper.classList.contains('SvgIcon'));
assert.isFalse(wrapper.classList.contains('svg-icon--inline')); assert.isFalse(wrapper.classList.contains('SvgIcon--inline'));
}); });
it('appends an inline class to wrapper if `inline` prop is `true`', () => { it('appends an inline class to wrapper if `inline` prop is `true`', () => {
const container = document.createElement('div'); const container = document.createElement('div');
render(<SvgIcon name="arrow-left" inline={true} />, container); render(<SvgIcon name="arrow-left" inline={true} />, container);
const wrapper = container.querySelector('span'); const wrapper = container.querySelector('span');
assert.isTrue(wrapper.classList.contains('svg-icon')); assert.isTrue(wrapper.classList.contains('SvgIcon'));
assert.isTrue(wrapper.classList.contains('svg-icon--inline')); assert.isTrue(wrapper.classList.contains('SvgIcon--inline'));
}); });
it('sets a title to the containing `span` element if `title` is present', () => { it('sets a title to the containing `span` element if `title` is present', () => {
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
// e.g. // e.g.
// @use '@hypothesis/frontend-shared/styles' // @use '@hypothesis/frontend-shared/styles'
@use './components/svg-icon'; @use './components/SvgIcon';
/* Make the wrapper element's size match the contained `svg` element */ /* Make the wrapper element's size match the contained `svg` element */
.svg-icon { .SvgIcon {
display: flex; display: flex;
&--inline { &--inline {
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
* @FIXME Find workaround for SvgIcon exception * @FIXME Find workaround for SvgIcon exception
*/ */
@mixin vertical-rhythm($size: var.$layout-space) { @mixin vertical-rhythm($size: var.$layout-space) {
& > * + *:not([class*='svg-icon--inline']) { & > * + *:not([class*='SvgIcon--inline']) {
margin-top: $size; margin-top: $size;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment