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
fix(icons): removing inline styles from SVG icons #5275
fix(icons): removing inline styles from SVG icons #5275
Conversation
@@ -0,0 +1,5 @@ | |||
@charset "UTF-8"; | |||
|
|||
.pf-svg-vertical-align { |
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 don't know exactly where to put this CSS class. It would require manually importing this file in the every application for this to work properly.
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, this belongs in https://github.com/patternfly/patternfly or existing applications will not get the styles.
Edit: I'd ask @mcoker where to put it. I suppose you could add it to the base styles.
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.
@wojta we have a global PF class stylesheet here where you could add this class https://github.com/patternfly/patternfly/blob/master/src/patternfly/base/_common.scss. Let me know if you'd like me to create the issue/PR.
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.
@mcoker added there patternfly/patternfly#3775
PF4 preview: https://patternfly-react-pr-5275.surge.sh |
c4fa837
to
adf71fd
Compare
adf71fd
to
a8ff3fa
Compare
Codecov Report
@@ Coverage Diff @@
## master #5275 +/- ##
==========================================
- Coverage 51.91% 51.85% -0.06%
==========================================
Files 579 579
Lines 11272 11321 +49
Branches 4184 4201 +17
==========================================
+ Hits 5852 5871 +19
- Misses 4683 4710 +27
- Partials 737 740 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 not seeing the styles applied - looks like this needs a core bump?
Yes, it needs newer @patternfly/patternfly. I'm not sure how is this done properly. |
d444ac8
to
6831af9
Compare
The core version has been updated. You can rebase this PR now to get the styles |
6831af9
to
1615259
Compare
Rebased, demos look good, styles are there now. |
this one has a conflict. Can you please rebase again. |
1615259
to
f733e11
Compare
Everything looks good visually, though a couple of discrepancies I see that I'd like to confirm:
|
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.
Since you put 'pf-svg-vertical-align' in the common styles there's no to introduce @patternfly/react-styles
as a dependency. Someone might want to use icons without styles.
f733e11
to
0585aab
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.
Sorry I missed @mcoker 's comment yesterday!
72c68aa
to
6bc0771
Compare
8b2e529
to
be96b98
Compare
I added an update to this issue: #8794 to make sure the react-icons read me is updated. Once CI passes here, we can get this merged. |
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.
CI is passing - ready for review @nicolethoen !
@@ -29,7 +29,7 @@ export const CustomPreviewFileUpload: React.FunctionComponent = () => { | |||
> | |||
{value && ( | |||
<div className="pf-u-m-md"> | |||
<FileUploadIcon size="lg" /> Custom preview here for your {value.size}-byte file named {value.name} | |||
<FileUploadIcon width="2em" height="2em" /> Custom preview here for your {value.size}-byte file named {value.name} |
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 not sure why this change, but I'm also not a React dev :-)
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.
The size
prop was removed in createIcon.tsx
and the default is now small, so I had to set this custom styling here to match the styling we had before @srambach - not sure if there is a better way to do this
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.
Ok, I see that now. 🤷♀️
@@ -29,7 +29,7 @@ export const CustomPreviewFileUpload: React.FunctionComponent = () => { | |||
> | |||
{value && ( | |||
<div className="pf-u-m-md"> | |||
<FileUploadIcon size="lg" /> Custom preview here for your {value.size}-byte file named {value.name} | |||
<FileUploadIcon width="2em" height="2em" /> Custom preview here for your {value.size}-byte file named {value.name} |
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.
Ok, I see that now. 🤷♀️
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.
Nice job @jenny-s51! 🚀
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.
LGTM Jenny!
Do we have a code mod issue for this?
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.
@tlabaj we do now 🙂 patternfly/pf-codemods#370
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.
@jenny-s51 We can merge this one once it is rebased
a2fcbd8
to
9fde82a
Compare
9fde82a
to
0cae3eb
Compare
Your changes have been released in:
Thanks for your contribution! 🎉 |
According to the PatternFly codemod this no longer is valid, it still works however but `orange` is not the same as `--pf-v5-global--warning-color--100` so this was wrong anyway. patternfly/patternfly-react#5275
According to the PatternFly codemod this no longer is valid, it still works however but `orange` is not the same as `--pf-v5-global--warning-color--100` so this was wrong anyway. patternfly/patternfly-react#5275
According to the PatternFly codemod this no longer is valid, it still works however but `orange` is not the same as `--pf-v5-global--warning-color--100` so this was wrong anyway. patternfly/patternfly-react#5275
According to the PatternFly codemod this no longer is valid, it still works however but `orange` is not the same as `--pf-v5-global--warning-color--100` so this was wrong anyway. patternfly/patternfly-react#5275 Cherry-picked from main commit f0ba89d
According to the PatternFly codemod this no longer is valid, it still works however but `orange` is not the same as `--pf-v5-global--warning-color--100` so this was wrong anyway. patternfly/patternfly-react#5275 Cherry-picked from main commit f0ba89d
What:
Closes #4767
How
vertical-align: -0.125em;
Additional issues:
patternfly/patternfly#3774