-
Notifications
You must be signed in to change notification settings - Fork 841
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(docusaurus-theme): fill Codesandbox icon with currentColor #8127
base: main
Are you sure you want to change the base?
fix(docusaurus-theme): fill Codesandbox icon with currentColor #8127
Conversation
A general fyi for the "QA" section:
There is no expected pattern for this, just in general some instructions to follow for people to know what to look at and verify considering someone might see it and not fully know what it's about (this PR is simple but more as a common approach) |
@mgadewoll that's a good point 👌🏻 I updated the description with proper QA instructions. |
viewBox="-20 0 296 296"> | ||
<path | ||
d="M115.498 261.088v-106.61L23.814 101.73v60.773l41.996 24.347v45.7l49.688 28.54Zm23.814.627 50.605-29.151V185.78l42.269-24.495v-60.011l-92.874 53.621v106.82Zm80.66-180.887-48.817-28.289-42.863 24.872-43.188-24.897-49.252 28.667 91.914 52.882 92.206-53.235ZM0 222.212V74.495L127.987 0 256 74.182v147.797l-128.016 73.744L0 222.212Z" /> | ||
<svg |
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.
This solution works but I think we might be able to make it even better 🙂
The icon is passed to EuiButtonIcon
(here) which then passes icons to EuiIcon
(here) and EuiIcon
returns the icon component with added props here.
If we want the icon to behave like an EuiIcon
- and not only update color - the only thing missing here is making sure that we spread the props to this custom svg. This will then also ensure other props e.g. className
or a11y props like role
, aria-hidden
or aria-label
are passed along.
// since it's not actually an EuiIcon component but the return of that component that's not
// specifically defined and it could be used in other places, I'd think `any` type is fine here
const CodeSandboxIcon = (props: any) => (
<svg {...props}
...
/>
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.
Actually let's use HTMLAttributes<SVGElement>
as type for props to have some limitations at least.
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.
@mgadewoll thanks for the suggestion! 🙌🏻 I implemented the changes and re-tested, and added one more commit with a typo fix. Could you review again?
c40dfd1
to
259e21c
Compare
259e21c
to
18a416a
Compare
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
Summary
The Codesandbox icon in the footer of each example in EUI+ doesn't change the color depending on the theme (dark / light mode).
QA
Screen.Recording.2024-11-08.at.19.34.42.mov