-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(svg): convert jsx svgs to raw svgs #6843
Conversation
Generated by 🚫 danger |
@ckj I think you will be able to review this in full, as there aren't any substantive changes. just:
I reviewed all of these visually and they should look identical, minus a few alignment bugs I tweaked to fix. This looks like a lot of code but it's all pretty fluffy! |
@@ -32,6 +32,17 @@ module.exports = { | |||
test: /\.css$/, | |||
use: ['style-loader', 'css-loader'], | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes are just a duplication of what we do in the primary webpack config file, since we need the same support in storybook land.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -330,7 +329,7 @@ class FormField extends React.Component { | |||
} else if (isSaved) { | |||
return ( | |||
<SettingsIsSaved> | |||
<IconCheckmarkSm size="18" /> | |||
<InlineSvg src="icon-checkmark-sm" size="18px" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most browsers use a common sense approach when it comes to unit-less values as attributes, which is why all these naked numbers get converted to pixels and not ems, percentages, vms, etc.
But that kind of ambiguity is somewhat confusing and unpredictable. So I converted them all to pixel values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
cea48f1
to
2eb7764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the camelCased SVG attributes (I commented on them inline). If they're not a concern, then it LGTM otherwise 👍
@@ -32,6 +32,17 @@ module.exports = { | |||
test: /\.css$/, | |||
use: ['style-loader', 'css-loader'], | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
strokeWidth="1" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to manually camelCase all of these attributes to js-ify them for React. In the SVG spec, they're hyphenated e.g. stroke-linejoin="round"
. Is this something we should revert back to or does it matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! good call!!
@@ -330,7 +329,7 @@ class FormField extends React.Component { | |||
} else if (isSaved) { | |||
return ( | |||
<SettingsIsSaved> | |||
<IconCheckmarkSm size="18" /> | |||
<InlineSvg src="icon-checkmark-sm" size="18px" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Unrelated, but it would be awesome if we had a section in storybook for all of our icons |
Not gonna include
icon-file-generic
andicon-open
in this one because I need to get mock data working for release overviews.Everything else has been tested and looks identical.