-
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
Add icons to navigation sidebar items #36893
Conversation
Size Change: +234 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
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 👍 , just a tiny feedback.
@@ -182,6 +182,10 @@ export const ItemUI = styled.div` | |||
width: 100%; | |||
color: inherit; | |||
opacity: 0.7; | |||
|
|||
> svg:first-of-type { |
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 selector seems a little bit fragile. Could we add a className
to the <Icon>
component or wrap it with a <span>
?
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.
Yeah, this is what I was unsure about. I guess BEM style classnames aren't generally used in components that use css-in-js.
Adding another wrapper isn't great either, but that's what I've gone for here to remove this fragile selector.
If there's another way I'm open to more feedback and can fix it in a follow-up.
* Add icons to navigation sidebar items * Add storybook example * Move icon into main item file and add margin * Target first child * Use first-of-type * Switch to using the sybmolFilled icon for template parts * Add another wrapper to replace fragile class
Description
Adds icons to navigation sidebar items:
This required adding an
icon
prop to the navigation item component.I'm not completely familiar with how these components are written (particularly the styles), so this may need some feedback.
This works fine in the Navigation Sidebar in the site editor at the moment.
In terms of the navigation component itself, there are a few things to think about, like how an implementer would mix navigation items that have icons with those that don't:
But it doesn't have to be solved straight away.
How has this been tested?
Screenshots
Types of changes
Enhancement
Checklist:
*.native.js
files for terms that need renaming or removal).